versions
Creates, updates, deletes, gets or lists a versions
resource.
Overview
Name | versions |
Type | Resource |
Id | google.apihub.versions |
Fields
The following fields are returned by SELECT
queries:
- get
- list
Successful response
Name | Datatype | Description |
---|---|---|
name | string | Identifier. The name of the version. Format: projects/{project}/locations/{location}/apis/{api}/versions/{version} |
accreditation | object | The attribute values associated with resource. (id: GoogleCloudApihubV1AttributeValues) |
apiOperations | array | Output only. The operations contained in the API version. These operations will be added to the version when a new spec is added or when an existing spec is updated. Format is projects/{project}/locations/{location}/apis/{api}/versions/{version}/operations/{operation} |
attributes | object | Optional. The list of user defined attributes associated with the Version resource. The key is the attribute name. It will be of the format: projects/{project}/locations/{location}/attributes/{attribute} . The value is the attribute values associated with the resource. |
compliance | object | The attribute values associated with resource. (id: GoogleCloudApihubV1AttributeValues) |
createTime | string (google-datetime) | Output only. The time at which the version was created. |
definitions | array | Output only. The definitions contained in the API version. These definitions will be added to the version when a new spec is added or when an existing spec is updated. Format is projects/{project}/locations/{location}/apis/{api}/versions/{version}/definitions/{definition} |
deployments | array | 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) Format is projects/{project}/locations/{location}/deployments/{deployment} |
description | string | Optional. The description of the version. |
displayName | string | Required. The display name of the version. |
documentation | object | Optional. The documentation of the version. (id: GoogleCloudApihubV1Documentation) |
lifecycle | object | The attribute values associated with resource. (id: GoogleCloudApihubV1AttributeValues) |
selectedDeployment | string | Optional. The selected deployment for a Version resource. This can be used when special handling is needed on client side for a particular deployment linked to the version. Format is projects/{project}/locations/{location}/deployments/{deployment} |
sourceMetadata | array | Output only. The list of sources and metadata from the sources of the version. |
specs | array | Output only. The specs associated with this version. Note that an API version can be associated with multiple specs. Format is projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec} |
updateTime | string (google-datetime) | Output only. The time at which the version was last updated. |
Successful response
Name | Datatype | Description |
---|---|---|
name | string | Identifier. The name of the version. Format: projects/{project}/locations/{location}/apis/{api}/versions/{version} |
accreditation | object | The attribute values associated with resource. (id: GoogleCloudApihubV1AttributeValues) |
apiOperations | array | Output only. The operations contained in the API version. These operations will be added to the version when a new spec is added or when an existing spec is updated. Format is projects/{project}/locations/{location}/apis/{api}/versions/{version}/operations/{operation} |
attributes | object | Optional. The list of user defined attributes associated with the Version resource. The key is the attribute name. It will be of the format: projects/{project}/locations/{location}/attributes/{attribute} . The value is the attribute values associated with the resource. |
compliance | object | The attribute values associated with resource. (id: GoogleCloudApihubV1AttributeValues) |
createTime | string (google-datetime) | Output only. The time at which the version was created. |
definitions | array | Output only. The definitions contained in the API version. These definitions will be added to the version when a new spec is added or when an existing spec is updated. Format is projects/{project}/locations/{location}/apis/{api}/versions/{version}/definitions/{definition} |
deployments | array | 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) Format is projects/{project}/locations/{location}/deployments/{deployment} |
description | string | Optional. The description of the version. |
displayName | string | Required. The display name of the version. |
documentation | object | Optional. The documentation of the version. (id: GoogleCloudApihubV1Documentation) |
lifecycle | object | The attribute values associated with resource. (id: GoogleCloudApihubV1AttributeValues) |
selectedDeployment | string | Optional. The selected deployment for a Version resource. This can be used when special handling is needed on client side for a particular deployment linked to the version. Format is projects/{project}/locations/{location}/deployments/{deployment} |
sourceMetadata | array | Output only. The list of sources and metadata from the sources of the version. |
specs | array | Output only. The specs associated with this version. Note that an API version can be associated with multiple specs. Format is projects/{project}/locations/{location}/apis/{api}/versions/{version}/specs/{spec} |
updateTime | string (google-datetime) | Output only. The time at which the version was last updated. |
Methods
The following methods are available for this resource:
Name | Accessible by | Required Params | Optional Params | Description |
---|---|---|---|---|
get | select | projectsId , locationsId , apisId , versionsId | Get details about the API version of an API resource. This will include information about the specs and operations present in the API version as well as the deployments linked to it. | |
list | select | projectsId , locationsId , apisId | filter , pageSize , pageToken | List API versions of an API resource in the API hub. |
create | insert | projectsId , locationsId , apisId | versionId | Create an API version for an API resource in the API hub. |
patch | update | projectsId , locationsId , apisId , versionsId | updateMask | Update API version. The following fields in the version can be updated currently: * display_name * description * documentation * deployments * lifecycle * compliance * accreditation * attributes The update_mask should be used to specify the fields being updated. |
delete | delete | projectsId , locationsId , apisId , versionsId | force | Delete an API version. Version can only be deleted if all underlying specs, operations, definitions and linked deployments are deleted. |
Parameters
Parameters can be passed in the WHERE
clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
Name | Datatype | Description |
---|---|---|
apisId | string | |
locationsId | string | |
projectsId | string | |
versionsId | string | |
filter | string | |
force | boolean | |
pageSize | integer (int32) | |
pageToken | string | |
updateMask | string (google-fieldmask) | |
versionId | string |
SELECT
examples
- get
- list
Get details about the API version of an API resource. This will include information about the specs and operations present in the API version as well as the deployments linked to it.
SELECT
name,
accreditation,
apiOperations,
attributes,
compliance,
createTime,
definitions,
deployments,
description,
displayName,
documentation,
lifecycle,
selectedDeployment,
sourceMetadata,
specs,
updateTime
FROM google.apihub.versions
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND apisId = '{{ apisId }}' -- required
AND versionsId = '{{ versionsId }}' -- required;
List API versions of an API resource in the API hub.
SELECT
name,
accreditation,
apiOperations,
attributes,
compliance,
createTime,
definitions,
deployments,
description,
displayName,
documentation,
lifecycle,
selectedDeployment,
sourceMetadata,
specs,
updateTime
FROM google.apihub.versions
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND apisId = '{{ apisId }}' -- required
AND filter = '{{ filter }}'
AND pageSize = '{{ pageSize }}'
AND pageToken = '{{ pageToken }}';
INSERT
examples
- create
- Manifest
Create an API version for an API resource in the API hub.
INSERT INTO google.apihub.versions (
data__name,
data__displayName,
data__description,
data__documentation,
data__deployments,
data__lifecycle,
data__compliance,
data__accreditation,
data__attributes,
data__selectedDeployment,
projectsId,
locationsId,
apisId,
versionId
)
SELECT
'{{ name }}',
'{{ displayName }}',
'{{ description }}',
'{{ documentation }}',
'{{ deployments }}',
'{{ lifecycle }}',
'{{ compliance }}',
'{{ accreditation }}',
'{{ attributes }}',
'{{ selectedDeployment }}',
'{{ projectsId }}',
'{{ locationsId }}',
'{{ apisId }}',
'{{ versionId }}'
RETURNING
name,
accreditation,
apiOperations,
attributes,
compliance,
createTime,
definitions,
deployments,
description,
displayName,
documentation,
lifecycle,
selectedDeployment,
sourceMetadata,
specs,
updateTime
;
# Description fields are for documentation purposes
- name: versions
props:
- name: projectsId
value: string
description: Required parameter for the versions resource.
- name: locationsId
value: string
description: Required parameter for the versions resource.
- name: apisId
value: string
description: Required parameter for the versions resource.
- name: name
value: string
description: >
Identifier. The name of the version. Format: `projects/{project}/locations/{location}/apis/{api}/versions/{version}`
- name: displayName
value: string
description: >
Required. The display name of the version.
- name: description
value: string
description: >
Optional. The description of the version.
- name: documentation
value: object
description: >
Optional. The documentation of the version.
- name: deployments
value: array
description: >
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) Format is `projects/{project}/locations/{location}/deployments/{deployment}`
- name: lifecycle
value: object
description: >
The attribute values associated with resource.
- name: compliance
value: object
description: >
The attribute values associated with resource.
- name: accreditation
value: object
description: >
The attribute values associated with resource.
- name: attributes
value: object
description: >
Optional. The list of user defined attributes associated with the Version resource. The key is the attribute name. It will be of the format: `projects/{project}/locations/{location}/attributes/{attribute}`. The value is the attribute values associated with the resource.
- name: selectedDeployment
value: string
description: >
Optional. The selected deployment for a Version resource. This can be used when special handling is needed on client side for a particular deployment linked to the version. Format is `projects/{project}/locations/{location}/deployments/{deployment}`
- name: versionId
value: string
UPDATE
examples
- patch
Update API version. The following fields in the version can be updated currently: * display_name * description * documentation * deployments * lifecycle * compliance * accreditation * attributes The update_mask should be used to specify the fields being updated.
UPDATE google.apihub.versions
SET
data__name = '{{ name }}',
data__displayName = '{{ displayName }}',
data__description = '{{ description }}',
data__documentation = '{{ documentation }}',
data__deployments = '{{ deployments }}',
data__lifecycle = '{{ lifecycle }}',
data__compliance = '{{ compliance }}',
data__accreditation = '{{ accreditation }}',
data__attributes = '{{ attributes }}',
data__selectedDeployment = '{{ selectedDeployment }}'
WHERE
projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND apisId = '{{ apisId }}' --required
AND versionsId = '{{ versionsId }}' --required
AND updateMask = '{{ updateMask}}'
RETURNING
name,
accreditation,
apiOperations,
attributes,
compliance,
createTime,
definitions,
deployments,
description,
displayName,
documentation,
lifecycle,
selectedDeployment,
sourceMetadata,
specs,
updateTime;
DELETE
examples
- delete
Delete an API version. Version can only be deleted if all underlying specs, operations, definitions and linked deployments are deleted.
DELETE FROM google.apihub.versions
WHERE projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND apisId = '{{ apisId }}' --required
AND versionsId = '{{ versionsId }}' --required
AND force = '{{ force }}';