specs
Creates, updates, deletes, gets or lists a specs resource.
Overview
| Name | specs |
| Type | Resource |
| Id | google.apigeeregistry.specs |
Fields
The following fields are returned by SELECT queries:
- projects_locations_apis_versions_specs_get
- projects_locations_apis_versions_specs_list
| Name | Datatype | Description |
|---|---|---|
name | string | Resource name. |
annotations | object | Annotations attach non-identifying metadata to resources. Annotation keys and values are less restricted than those of labels, but should be generally used for small values of broad interest. Larger, topic- specific metadata should be stored in Artifacts. |
contents | string (byte) | Input only. The contents of the spec. Provided by API callers when specs are created or updated. To access the contents of a spec, use GetApiSpecContents. |
createTime | string (google-datetime) | Output only. Creation timestamp; when the spec resource was created. |
description | string | A detailed description. |
filename | string | A possibly-hierarchical name used to refer to the spec from other specs. |
hash | string | Output only. A SHA-256 hash of the spec's contents. If the spec is gzipped, this is the hash of the uncompressed spec. |
labels | object | Labels attach identifying metadata to resources. Identifying metadata can be used to filter list operations. Label keys and values can be no longer than 64 characters (Unicode codepoints), can only contain lowercase letters, numeric characters, underscores and dashes. International characters are allowed. No more than 64 user labels can be associated with one resource (System labels are excluded). See https://goo.gl/xmQnxf for more information and examples of labels. System reserved label keys are prefixed with apigeeregistry.googleapis.com/ and cannot be changed. |
mimeType | string | A style (format) descriptor for this spec that is specified as a Media Type. Possible values include application/vnd.apigee.proto, application/vnd.apigee.openapi, and application/vnd.apigee.graphql, with possible suffixes representing compression types. These hypothetical names are defined in the vendor tree defined in RFC6838 (https://tools.ietf.org/html/rfc6838) and are not final. Content types can specify compression. Currently only GZip compression is supported (indicated with "+gzip"). |
revisionCreateTime | string (google-datetime) | Output only. Revision creation timestamp; when the represented revision was created. |
revisionId | string | Output only. Immutable. The revision ID of the spec. A new revision is committed whenever the spec contents are changed. The format is an 8-character hexadecimal string. |
revisionUpdateTime | string (google-datetime) | Output only. Last update timestamp: when the represented revision was last modified. |
sizeBytes | integer (int32) | Output only. The size of the spec file in bytes. If the spec is gzipped, this is the size of the uncompressed spec. |
sourceUri | string | The original source URI of the spec (if one exists). This is an external location that can be used for reference purposes but which may not be authoritative since this external resource may change after the spec is retrieved. |
| Name | Datatype | Description |
|---|---|---|
name | string | Resource name. |
annotations | object | Annotations attach non-identifying metadata to resources. Annotation keys and values are less restricted than those of labels, but should be generally used for small values of broad interest. Larger, topic- specific metadata should be stored in Artifacts. |
contents | string (byte) | Input only. The contents of the spec. Provided by API callers when specs are created or updated. To access the contents of a spec, use GetApiSpecContents. |
createTime | string (google-datetime) | Output only. Creation timestamp; when the spec resource was created. |
description | string | A detailed description. |
filename | string | A possibly-hierarchical name used to refer to the spec from other specs. |
hash | string | Output only. A SHA-256 hash of the spec's contents. If the spec is gzipped, this is the hash of the uncompressed spec. |
labels | object | Labels attach identifying metadata to resources. Identifying metadata can be used to filter list operations. Label keys and values can be no longer than 64 characters (Unicode codepoints), can only contain lowercase letters, numeric characters, underscores and dashes. International characters are allowed. No more than 64 user labels can be associated with one resource (System labels are excluded). See https://goo.gl/xmQnxf for more information and examples of labels. System reserved label keys are prefixed with apigeeregistry.googleapis.com/ and cannot be changed. |
mimeType | string | A style (format) descriptor for this spec that is specified as a Media Type. Possible values include application/vnd.apigee.proto, application/vnd.apigee.openapi, and application/vnd.apigee.graphql, with possible suffixes representing compression types. These hypothetical names are defined in the vendor tree defined in RFC6838 (https://tools.ietf.org/html/rfc6838) and are not final. Content types can specify compression. Currently only GZip compression is supported (indicated with "+gzip"). |
revisionCreateTime | string (google-datetime) | Output only. Revision creation timestamp; when the represented revision was created. |
revisionId | string | Output only. Immutable. The revision ID of the spec. A new revision is committed whenever the spec contents are changed. The format is an 8-character hexadecimal string. |
revisionUpdateTime | string (google-datetime) | Output only. Last update timestamp: when the represented revision was last modified. |
sizeBytes | integer (int32) | Output only. The size of the spec file in bytes. If the spec is gzipped, this is the size of the uncompressed spec. |
sourceUri | string | The original source URI of the spec (if one exists). This is an external location that can be used for reference purposes but which may not be authoritative since this external resource may change after the spec is retrieved. |
Methods
The following methods are available for this resource:
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 | |
specsId | string | |
versionsId | string | |
allowMissing | boolean | |
apiSpecId | string | |
filter | string | |
force | boolean | |
orderBy | string | |
pageSize | integer (int32) | |
pageToken | string | |
updateMask | string (google-fieldmask) |
SELECT examples
- projects_locations_apis_versions_specs_get
- projects_locations_apis_versions_specs_list
Returns a specified spec.
SELECT
name,
annotations,
contents,
createTime,
description,
filename,
hash,
labels,
mimeType,
revisionCreateTime,
revisionId,
revisionUpdateTime,
sizeBytes,
sourceUri
FROM google.apigeeregistry.specs
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND apisId = '{{ apisId }}' -- required
AND versionsId = '{{ versionsId }}' -- required
AND specsId = '{{ specsId }}' -- required
;
Returns matching specs.
SELECT
name,
annotations,
contents,
createTime,
description,
filename,
hash,
labels,
mimeType,
revisionCreateTime,
revisionId,
revisionUpdateTime,
sizeBytes,
sourceUri
FROM google.apigeeregistry.specs
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND apisId = '{{ apisId }}' -- required
AND versionsId = '{{ versionsId }}' -- required
AND pageToken = '{{ pageToken }}'
AND pageSize = '{{ pageSize }}'
AND filter = '{{ filter }}'
AND orderBy = '{{ orderBy }}'
;
INSERT examples
- projects_locations_apis_versions_specs_create
- Manifest
Creates a specified spec.
INSERT INTO google.apigeeregistry.specs (
data__name,
data__labels,
data__description,
data__contents,
data__annotations,
data__sourceUri,
data__filename,
data__mimeType,
projectsId,
locationsId,
apisId,
versionsId,
apiSpecId
)
SELECT
'{{ name }}',
'{{ labels }}',
'{{ description }}',
'{{ contents }}',
'{{ annotations }}',
'{{ sourceUri }}',
'{{ filename }}',
'{{ mimeType }}',
'{{ projectsId }}',
'{{ locationsId }}',
'{{ apisId }}',
'{{ versionsId }}',
'{{ apiSpecId }}'
RETURNING
name,
annotations,
contents,
createTime,
description,
filename,
hash,
labels,
mimeType,
revisionCreateTime,
revisionId,
revisionUpdateTime,
sizeBytes,
sourceUri
;
# Description fields are for documentation purposes
- name: specs
props:
- name: projectsId
value: "{{ projectsId }}"
description: Required parameter for the specs resource.
- name: locationsId
value: "{{ locationsId }}"
description: Required parameter for the specs resource.
- name: apisId
value: "{{ apisId }}"
description: Required parameter for the specs resource.
- name: versionsId
value: "{{ versionsId }}"
description: Required parameter for the specs resource.
- name: name
value: "{{ name }}"
description: |
Resource name.
- name: labels
value: "{{ labels }}"
description: |
Labels attach identifying metadata to resources. Identifying metadata can be used to filter list operations. Label keys and values can be no longer than 64 characters (Unicode codepoints), can only contain lowercase letters, numeric characters, underscores and dashes. International characters are allowed. No more than 64 user labels can be associated with one resource (System labels are excluded). See https://goo.gl/xmQnxf for more information and examples of labels. System reserved label keys are prefixed with `apigeeregistry.googleapis.com/` and cannot be changed.
- name: description
value: "{{ description }}"
description: |
A detailed description.
- name: contents
value: "{{ contents }}"
description: |
Input only. The contents of the spec. Provided by API callers when specs are created or updated. To access the contents of a spec, use GetApiSpecContents.
- name: annotations
value: "{{ annotations }}"
description: |
Annotations attach non-identifying metadata to resources. Annotation keys and values are less restricted than those of labels, but should be generally used for small values of broad interest. Larger, topic- specific metadata should be stored in Artifacts.
- name: sourceUri
value: "{{ sourceUri }}"
description: |
The original source URI of the spec (if one exists). This is an external location that can be used for reference purposes but which may not be authoritative since this external resource may change after the spec is retrieved.
- name: filename
value: "{{ filename }}"
description: |
A possibly-hierarchical name used to refer to the spec from other specs.
- name: mimeType
value: "{{ mimeType }}"
description: |
A style (format) descriptor for this spec that is specified as a [Media Type](https://en.wikipedia.org/wiki/Media_type). Possible values include `application/vnd.apigee.proto`, `application/vnd.apigee.openapi`, and `application/vnd.apigee.graphql`, with possible suffixes representing compression types. These hypothetical names are defined in the vendor tree defined in RFC6838 (https://tools.ietf.org/html/rfc6838) and are not final. Content types can specify compression. Currently only GZip compression is supported (indicated with "+gzip").
- name: apiSpecId
value: "{{ apiSpecId }}"
UPDATE examples
- projects_locations_apis_versions_specs_patch
Used to modify a specified spec.
UPDATE google.apigeeregistry.specs
SET
data__name = '{{ name }}',
data__labels = '{{ labels }}',
data__description = '{{ description }}',
data__contents = '{{ contents }}',
data__annotations = '{{ annotations }}',
data__sourceUri = '{{ sourceUri }}',
data__filename = '{{ filename }}',
data__mimeType = '{{ mimeType }}'
WHERE
projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND apisId = '{{ apisId }}' --required
AND versionsId = '{{ versionsId }}' --required
AND specsId = '{{ specsId }}' --required
AND updateMask = '{{ updateMask}}'
AND allowMissing = {{ allowMissing}}
RETURNING
name,
annotations,
contents,
createTime,
description,
filename,
hash,
labels,
mimeType,
revisionCreateTime,
revisionId,
revisionUpdateTime,
sizeBytes,
sourceUri;
DELETE examples
- projects_locations_apis_versions_specs_delete
Removes a specified spec, all revisions, and all child resources (e.g., artifacts).
DELETE FROM google.apigeeregistry.specs
WHERE projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND apisId = '{{ apisId }}' --required
AND versionsId = '{{ versionsId }}' --required
AND specsId = '{{ specsId }}' --required
AND force = '{{ force }}'
;
Lifecycle Methods
- projects_locations_apis_versions_specs_rollback
- projects_locations_apis_versions_specs_tag_revision
Sets the current revision to a specified prior revision. Note that this creates a new revision with a new revision ID.
EXEC google.apigeeregistry.specs.projects_locations_apis_versions_specs_rollback
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@apisId='{{ apisId }}' --required,
@versionsId='{{ versionsId }}' --required,
@specsId='{{ specsId }}' --required
@@json=
'{
"revisionId": "{{ revisionId }}"
}'
;
Adds a tag to a specified revision of a spec.
EXEC google.apigeeregistry.specs.projects_locations_apis_versions_specs_tag_revision
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@apisId='{{ apisId }}' --required,
@versionsId='{{ versionsId }}' --required,
@specsId='{{ specsId }}' --required
@@json=
'{
"tag": "{{ tag }}"
}'
;