specs
Creates, updates, deletes, gets or lists a specs
resource.
Overview
Name | specs |
Type | Resource |
Id | google.apigeeregistry.specs |
Fields
Name | Datatype | Description |
---|---|---|
name | string | Resource name. |
description | string | A detailed description. |
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 | 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 | Output only. Creation timestamp; when the spec resource was created. |
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 | 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 | Output only. Last update timestamp: when the represented revision was last modified. |
sizeBytes | integer | 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
Name | Accessible by | Required Params | Description |
---|---|---|---|
projects_locations_apis_versions_specs_get | SELECT | apisId, locationsId, projectsId, specsId, versionsId | Returns a specified spec. |
projects_locations_apis_versions_specs_list | SELECT | apisId, locationsId, projectsId, versionsId | Returns matching specs. |
projects_locations_apis_versions_specs_create | INSERT | apisId, locationsId, projectsId, versionsId | Creates a specified spec. |
projects_locations_apis_versions_specs_delete | DELETE | apisId, locationsId, projectsId, specsId, versionsId | Removes a specified spec, all revisions, and all child resources (e.g., artifacts). |
projects_locations_apis_versions_specs_patch | UPDATE | apisId, locationsId, projectsId, specsId, versionsId | Used to modify a specified spec. |
projects_locations_apis_versions_specs_rollback | EXEC | apisId, locationsId, projectsId, specsId, versionsId | Sets the current revision to a specified prior revision. Note that this creates a new revision with a new revision ID. |
projects_locations_apis_versions_specs_tag_revision | EXEC | apisId, locationsId, projectsId, specsId, versionsId | Adds a tag to a specified revision of a spec. |
SELECT
examples
Returns matching specs.
SELECT
name,
description,
annotations,
contents,
createTime,
filename,
hash,
labels,
mimeType,
revisionCreateTime,
revisionId,
revisionUpdateTime,
sizeBytes,
sourceUri
FROM google.apigeeregistry.specs
WHERE apisId = '{{ apisId }}'
AND locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}'
AND versionsId = '{{ versionsId }}';
INSERT
example
Use the following StackQL query and manifest file to create a new specs
resource.
- All Properties
- Manifest
/*+ create */
INSERT INTO google.apigeeregistry.specs (
apisId,
locationsId,
projectsId,
versionsId,
name,
filename,
description,
mimeType,
sourceUri,
contents,
labels,
annotations
)
SELECT
'{{ apisId }}',
'{{ locationsId }}',
'{{ projectsId }}',
'{{ versionsId }}',
'{{ name }}',
'{{ filename }}',
'{{ description }}',
'{{ mimeType }}',
'{{ sourceUri }}',
'{{ contents }}',
'{{ labels }}',
'{{ annotations }}'
;
- name: your_resource_model_name
props:
- name: name
value: string
- name: filename
value: string
- name: description
value: string
- name: revisionId
value: string
- name: createTime
value: string
- name: revisionCreateTime
value: string
- name: revisionUpdateTime
value: string
- name: mimeType
value: string
- name: sizeBytes
value: integer
- name: hash
value: string
- name: sourceUri
value: string
- name: contents
value: string
- name: labels
value: object
- name: annotations
value: object
UPDATE
example
Updates a specs
resource.
/*+ update */
UPDATE google.apigeeregistry.specs
SET
name = '{{ name }}',
filename = '{{ filename }}',
description = '{{ description }}',
mimeType = '{{ mimeType }}',
sourceUri = '{{ sourceUri }}',
contents = '{{ contents }}',
labels = '{{ labels }}',
annotations = '{{ annotations }}'
WHERE
apisId = '{{ apisId }}'
AND locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}'
AND specsId = '{{ specsId }}'
AND versionsId = '{{ versionsId }}';
DELETE
example
Deletes the specified specs
resource.
/*+ delete */
DELETE FROM google.apigeeregistry.specs
WHERE apisId = '{{ apisId }}'
AND locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}'
AND specsId = '{{ specsId }}'
AND versionsId = '{{ versionsId }}';