Create a Registry

Use this API to create a new registry.

POST/v1.3/registry

Request Body ParametersRequest Body Parameters

Parameter

Mandatory/Optional

Data Type

Description

ACR

connectorId

Mandatory

string

Provide the ACR (Azure Container Registry) connector Id if your registry will be hosted on Azure.

This parameter is required when the registryType is Azure and you want to create a new ACR connector.

AWS

accountId

Mandatory

string

Provide the AWS account Id if your registry will be hosted on AWS.

Parameters accountId, arn, and region are required when the registryType is AWS ECR and you want to create a new AWS connector.

arn

Mandatory

string 

ARN number of the account ID. Specify the ARN if you want to use an existing AWS connector, or if you want to create a new connector.

region

Mandatory

 string

Region where your AWS account belongs.

You must specify a US GovCloud region when accountType is US_Gov.

accountType

Mandatory

 string

Specify the AWS account type as Global or US_Gov.

GCP

connectorId

Mandatory

string

Provide the GCR connector Id if you registry will be hosted on GCP.

Parameters connectorId, location, and projectId are required when the registryType is GCP and you want to create a new GCR connector.

location

Mandatory

string

Location where your GCP account belong to.

projectId

Mandatory

string

Your GCP project ID, which is alphanumeric.

GCAR

connectorId

Mandatory

string

Provide the GCAR connector Id if your registry will be hosted on GCP.

Parameters connectorId, projectId, and registry are required when the registryType is GOOGLE_ARTIFACT_REGISTRY and you want to create a new GCAR connector.

projectId

Mandatory

string

Your GCP project ID, which is alphanumeric (e.g. cs-registry).

registry

Mandatory

string

Name of the Google Artifact Registry repository (e.g. docker-v2-repo).

Others

accessToken - string

Access token to connect to the registry. This parameter is only applicable for JFrog Artifactory Private registry.

  • It is recommended to generate a never-expiring token.
  • If your token has expired, the authentication fails an error message.

username

Mandatory

string

Username to connect to the registry. It must be in base64 format.

password

 -

string

Password to connect to the registry. It must be in base64 format.

credentialType

Mandatory

string 

None, Token, BasicAuth, DockerHub, AWS, GCP, GHCR

This parameter is not required while creating Azure or GCP registries.

dockerHubOrgName

Optional

string

Organization name if the registryType is DockerHub.

registryName

Mandatory

string

Registry name should be alphanumeric character which can also include “-”, “_” and“.” upto 63 characters.

It is a mandatory field, it must be unique and no whitespace allowed.

registryType

Mandatory

string

AWS ECR, Azure, GCP, DockerHub, Docker V2, Docker V2-Private, GOOGLE_ARTIFACT_REGISTRY, GHCR

registryUri

Mandatory

string 

URL of the registry to connect to.

registryUuid

Mandatory

string

This parameter should be empty during the connector creation. Specify null if there is no registryUuid.

Sample for AWSSample for AWS

API request

    curl -X POST 
"<qualys_base_url>/csapi/v1.3/registry" 
-d "{"aws": 
{"accountId":"383031258652", "arn":"arn:aws:iam::383031258652:role/testabcd", "region":"us-east-2", 
"accountType":"Global"}, 
"credentialType":"AWS", 
"registryName":"AWSregistry", 
"registryType":"AWS", 
"registryUri":"https://383031258652.dkr.ecr.us-east-2.amazonaws.com"
}" 
--header "Authorization: Bearer <token>"   
    

Response

    {
    "registryUuid": "95b715e0-0fc7-4dac-b4de-2e1b92fc527d"
}
Response Code: 200  
    

Sample for GCARSample for GCAR

API request

    
    curl -X POST 
"<qualys_base_url>/csapi/v1.3/registry" 
-d "{
"gcarRequest":
{"connectorId":"1131360358474747331",
"projectId":"qualys-cs",
"registry":"cstest"
},
"credentialType":"GCP",
"registryName":"GOOGLE_ARTIFACT_REGISTRY",
"registryType":"GOOGLE_ARTIFACT_REGISTRY",
"registryUri":"https://us-central1-docker.pkg.dev",
"registryUuid": null
}" 
--header "Authorization: Bearer <token>" 
    

Response

    {
    "registryUuid": "b36965d6-c111-4964-a0ef-6d817454c3c1"
}
Response Code: 200