- HTTP request
- Path parameters
- Request body
- Response body
- Authorization scopes
- IAM Permissions
- CollectionType
- ApiData
- ApiMetadataList
- APIMetadata
- VersionMetadata
- SpecMetadata
- DeploymentMetadata
Collect API data from a source and push it to Hub's collect layer.
HTTP request
POST https://apihub.googleapis.com/v1/{location=projects/*/locations/*}:collectApiData
The URL uses gRPC Transcoding syntax.
Path parameters
| Parameters | |
|---|---|
location |
Required. The regional location of the API hub instance and its resources. Format: |
Request body
The request body contains data with the following structure:
| JSON representation |
|---|
{ "collectionType": enum ( |
| Fields | |
|---|---|
collectionType |
Required. The type of collection. Applies to all entries in |
pluginInstance |
Required. The plugin instance collecting the API data. Format: |
actionId |
Required. The action ID to be used for collecting the API data. This should map to one of the action IDs specified in action configs in the plugin. |
apiData |
Required. The API data to be collected. |
Response body
If successful, the response body contains an instance of Operation.
Authorization scopes
Requires one of the following OAuth scopes:
https://www.googleapis.com/auth/apihub.readwritehttps://www.googleapis.com/auth/cloud-platform
IAM Permissions
Requires the following IAM permission on the location resource:
apihub.locations.collectApiData
For more information, see the IAM documentation.
CollectionType
The type of the collect request.
| Enums | |
|---|---|
COLLECTION_TYPE_UNSPECIFIED |
The default value. This value is used if the collection type is omitted. |
COLLECTION_TYPE_UPSERT |
The collection type is upsert. This should be used when an API is created or updated at the source. |
COLLECTION_TYPE_DELETE |
The collection type is delete. This should be used when an API is deleted at the source. |
ApiData
The API data to be collected.
| JSON representation |
|---|
{
// The following is a list of mutually exclusive fields. At most one of the
// fields will be set in a response:
"apiMetadataList": {
object ( |
| Fields | |
|---|---|
| The data to be collected. The following is a list of mutually exclusive fields. At most one of the fields will be set in a response: | |
apiMetadataList |
Optional. The list of API metadata. |
| End of mutually exclusive fields. | |
ApiMetadataList
The message to hold repeated API metadata.
| JSON representation |
|---|
{
"apiMetadata": [
{
object ( |
| Fields | |
|---|---|
apiMetadata[] |
Required. The list of API metadata. |
APIMetadata
The API metadata.
| JSON representation |
|---|
{ "api": { object ( |
| Fields | |
|---|---|
api |
Required. The API resource to be pushed to Hub's collect layer. The ID of the API resource will be generated by Hub to ensure uniqueness across all APIs across systems. |
versions[] |
Optional. The list of versions present in an API resource. |
originalId |
Optional. The unique identifier of the API in the system where it was originally created. |
originalCreateTime |
Optional. Timestamp indicating when the API was created at the source. Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: |
originalUpdateTime |
Required. Timestamp indicating when the API was last updated at the source. Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: |
VersionMetadata
The metadata associated with a version of the API resource.
| JSON representation |
|---|
{ "version": { object ( |
| Fields | |
|---|---|
version |
Required. Represents a version of the API resource in API hub. The ID of the version will be generated by Hub. |
specs[] |
Optional. The specs associated with this version. Note that an API version can be associated with multiple specs. |
deployments[] |
Optional. The deployments linked to this API version. Note: A particular API version could be deployed to multiple deployments (for dev deployment, UAT deployment, etc.) |
originalId |
Optional. The unique identifier of the version in the system where it was originally created. |
originalCreateTime |
Optional. Timestamp indicating when the version was created at the source. Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: |
originalUpdateTime |
Required. Timestamp indicating when the version was last updated at the source. Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: |
SpecMetadata
The metadata associated with a spec of the API version.
| JSON representation |
|---|
{
"spec": {
object ( |
| Fields | |
|---|---|
spec |
Required. The spec resource to be pushed to Hub's collect layer. The ID of the spec will be generated by Hub. |
originalId |
Optional. The unique identifier of the spec in the system where it was originally created. |
originalCreateTime |
Optional. Timestamp indicating when the spec was created at the source. Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: |
originalUpdateTime |
Required. Timestamp indicating when the spec was last updated at the source. Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: |
deploymentResourceUris[] |
Optional. The gateway-side URIs of deployments that serve this spec. If provided, the API Hub service creates links between this spec and the deployments identified by these URIs. URIs that don't match any known deployment are ignored; a subsequent ingestion cycle that includes the missing deployment will re-establish the link. The maximum number of URIs allowed is 100. |
DeploymentMetadata
The metadata associated with a deployment.
| JSON representation |
|---|
{
"deployment": {
object ( |
| Fields | |
|---|---|
deployment |
Required. The deployment resource to be pushed to Hub's collect layer. The ID of the deployment will be generated by Hub. |
originalId |
Optional. The unique identifier of the deployment in the system where it was originally created. |
originalCreateTime |
Optional. Timestamp indicating when the deployment was created at the source. Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: |
originalUpdateTime |
Required. Timestamp indicating when the deployment was last updated at the source. Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: |