Connecting using a hostname

Content Platform Tenant Management Help

Version
9.7.x
File Size
4269 KB
Audience
anonymous
Part Number
MK-95HCPH002-19

When connecting to HCP using a hostname, the URL format you use depends on the namespaces you are querying:

One or more namespaces owned by an HCP tenant

To query one or more namespaces owned by an HCP tenant, use this format:

http[s]://hcp-tenant-name.hcp-domain-name/query

For example:

https://europe.hcp.example.com/query

To use this format, you need either a tenant-level user account or, if the tenant has granted system-level users administrative access to itself, a system-level user account. In either case, the account must be configured to allow use of the metadata query API.

When you use a tenant-level user account, HCP returns results only for objects in namespaces for which the tenant-level user has search permission.

Unlike with requests to the /rest interface, you do not specify a namespace in this URL.

Only the default namespace

To query only the default namespace, use this format:

https://default.hcp-domain-name/query

For example:

https://default.hcp.example.com/query

o use this format, you need a system-level user account that’s configured to allow the user to use the metadata query API.

For this URL format, you need to use HTTP with SSL security (HTTPS). If the query specifies HTTP instead of HTTPS in the URL, HCP returns a 403 (Forbidden) error.

Entire repository

To query the entire repository (that is, both the default namespace and all namespaces owned by each tenant that has granted system-level users administrative access to itself), use this format:

https://admin.hcp-domain-name/query

For example:

https://admin.hcp.example.com/query

To use this format, you need a system-level user account that ‘s configured to allow use of the metadata query API.

For this URL format, you need to use HTTP with SSL security (HTTPS). If the query specifies HTTP instead of HTTPS in the URL, HCP returns a 403 (Forbidden) error.

Considerations

The following considerations apply to these URLs:

  • The URL must specify query, in all lowercase, as the first element following the hostname in the URL.
  • If the URL specifies HTTPS and the HCP system uses a self-signed SSL server certificate, the request must include an instruction not to perform SSL certificate verification. With cURL, you do this by including the -k option in the request command line. In Python with PycURL, you do this by setting the SSL_VERIFYPEER option to false.