description |
---|
This guide lists the steps needed to create Connect Projects using the Connect API v2. |
The following static values should be used when creating Projects within the the OpenShift & Containers Zone:
rh_product_id: 3602271
rh_product_version: 3602281
The following prerequisites steps and values must be completed and collected before creating Projects using the API.
First, using the Connect web interface, a Product must be created. This is required so that Projects created later can be attached to a parent Product.
- Navigate to Product Certification > Manage products > Create Listing
- Enter Product name and major version
- Select OpenShift Operator or Containerized Product
- Click Create listing
Collect the Company ID from the Connect web interface:
-
Navigate to My Company > View company information
-
Click EDIT COMPANY PROFILE
-
Note the URL. It will be in the following format:
https://connect.redhat.com/node/#######/edit
The
#######
portion is the Company ID. Record this 7 digit integer.
Generate an API key from the Connect web interface:
- Navigate to Product Certification > Manage container API keys
- Click Generate New Key
- Enter a Key Name
- Click Copy to copy the API Key
- Record this key
Perform the following steps to create a Project using the Connect API:
-
Ensure that the following values have been collected from the Prerequisites and Static Values sections above:
rh_product_id
rh_product_version
company_id
\ -
Note the following option choices and values:
OS Content Type (os_content_type
):
- RHEL -Red Hat Enterprise Linux
- UBI -
Red Hat Universal Base Image (UBI)
Distribution Method (
distribution_method
):- Red Hat Container Catalog -
rhcc
- Red Hat Marketplace Only -
marketplace_only
- External Registry -
external
- Non-Registry -
non_registry
Registry Vendor (
registry_vendor
):- Red Hat Container Catalog -
""
(empty string)- External Registry -
Own
ORDocker
ORQuay.io
-
Run the following command to create a new Project, replacing API_KEY, PROJECT_NAME, COMPANY_ID, and REPO_NAMESPACE with their respective values:
Note: This example creates a UBI container Project using an external registry.
$ curl -X POST "https://connect.redhat.com/api/v2/projects" \
-H "accept: */*" \
-H "Authorization: Bearer API_KEY" \
-H "Content-Type: application/json" \
-d "{\"zone\":\"containers\",\"project_name\":\"PROJECT_NAME\",\"company_id\":COMPANY_ID,\"project_type\":\"Container Application\",\"rel_cat\":\"generally_available\",\"rh_product_id\":3602271,\"rh_product_version\":3602281,\"os_content_type\":\"Red Hat Universal Base Image (UBI)\",\"registry_vendor\":\"Own\",\"registry_override_instruct\":\"Registry usage instructions here.\",\"repo\":\"REPO_NAMESPACE\",\"repo_desc\":\"Description of repo.\",\"repo_path\":\"registry.example.com:5000/path/to/repository\",\"support_platforms\":[\"OpenShift Container Platform\"],\"distribution_method\":\"external\"}"
Example successful output:
"status":"Ok","message":"Project created.","code":200,"data":{"rid":"4209251","pid":"ospid-3b0fedb9-c611-4a70-bf1e-b2a6323dd00e","api":"https://connect.redhat.com/api/v2/projects/ospid-3b0fedb9-c611-4a70-bf1e-b2a6323dd00e"}}
4. Verify the new project exists:
$ curl -X GET "https://connect.redhat.com/api/v2/projects/PROJECT_ID" \
-H "accept: */*" \
-H "Authorization: Bearer API_KEY"
5. Attach the Project to the Product:
1. Navigate to Partner Connect using a web browser
2. Select Product Certification > Manage products
**** 3. Select the Product
4. Click Certification Projects on the left side
5. Click the appropriate Attach Project button (note Project type created above)
6. Select the new Project
7. Click Attach