schemas
Creates, updates, deletes, gets or lists a schemas
resource.
Overview
Name | schemas |
Type | Resource |
Id | google.pubsub.schemas |
Fields
Name | Datatype | Description |
---|---|---|
name | string | Required. Name of the schema. Format is projects/{project}/schemas/{schema} . |
definition | string | The definition of the schema. This should contain a string representing the full definition of the schema that is a valid schema definition of the type specified in type . |
revisionCreateTime | string | Output only. The timestamp that the revision was created. |
revisionId | string | Output only. Immutable. The revision ID of the schema. |
type | string | The type of the schema definition. |
Methods
Name | Accessible by | Required Params | Description |
---|---|---|---|
projects_schemas_get | SELECT | projectsId, schemasId | Gets a schema. |
projects_schemas_list | SELECT | projectsId | Lists schemas in a project. |
projects_schemas_create | INSERT | projectsId | Creates a schema. |
projects_schemas_delete | DELETE | projectsId, schemasId | Deletes a schema. |
projects_schemas_commit | EXEC | projectsId, schemasId | Commits a new schema revision to an existing schema. |
projects_schemas_rollback | EXEC | projectsId, schemasId | Creates a new schema revision that is a copy of the provided revision_id. |
projects_schemas_validate | EXEC | projectsId | Validates a schema. |
projects_schemas_validate_message | EXEC | projectsId | Validates a message against a schema. |
SELECT
examples
Lists schemas in a project.
SELECT
name,
definition,
revisionCreateTime,
revisionId,
type
FROM google.pubsub.schemas
WHERE projectsId = '{{ projectsId }}';
INSERT
example
Use the following StackQL query and manifest file to create a new schemas
resource.
- All Properties
- Manifest
/*+ create */
INSERT INTO google.pubsub.schemas (
projectsId,
name,
type,
definition
)
SELECT
'{{ projectsId }}',
'{{ name }}',
'{{ type }}',
'{{ definition }}'
;
- name: your_resource_model_name
props:
- name: name
value: string
- name: type
value: string
- name: definition
value: string
- name: revisionId
value: string
- name: revisionCreateTime
value: string
DELETE
example
Deletes the specified schemas
resource.
/*+ delete */
DELETE FROM google.pubsub.schemas
WHERE projectsId = '{{ projectsId }}'
AND schemasId = '{{ schemasId }}';