Skip to main content

subjects

Creates, updates, deletes, gets or lists a subjects resource.

Overview

Namesubjects
TypeResource
Idgoogle.managedkafka.subjects

Fields

The following fields are returned by SELECT queries:

Successful response

NameDatatypeDescription
contentTypestringThe HTTP Content-Type header value specifying the content type of the body.
datastring (byte)The HTTP request/response body as raw binary.
extensionsarrayApplication specific response metadata. Must be set in the first response for streaming APIs.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
listselectprojectsId, locationsId, schemaRegistriesIdsubjectPrefix, deletedList subjects in the schema registry. The response will be an array of subject names.
deletedeleteprojectsId, locationsId, schemaRegistriesId, subjectsIdpermanentDelete a subject. The response will be an array of versions of the deleted subject.
lookup_versionexecprojectsId, locationsId, schemaRegistriesId, subjectsIdLookup a schema under the specified subject.

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.

NameDatatypeDescription
locationsIdstring
projectsIdstring
schemaRegistriesIdstring
subjectsIdstring
deletedboolean
permanentboolean
subjectPrefixstring

SELECT examples

List subjects in the schema registry. The response will be an array of subject names.

SELECT
contentType,
data,
extensions
FROM google.managedkafka.subjects
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND schemaRegistriesId = '{{ schemaRegistriesId }}' -- required
AND subjectPrefix = '{{ subjectPrefix }}'
AND deleted = '{{ deleted }}';

DELETE examples

Delete a subject. The response will be an array of versions of the deleted subject.

DELETE FROM google.managedkafka.subjects
WHERE projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND schemaRegistriesId = '{{ schemaRegistriesId }}' --required
AND subjectsId = '{{ subjectsId }}' --required
AND permanent = '{{ permanent }}';

Lifecycle Methods

Lookup a schema under the specified subject.

EXEC google.managedkafka.subjects.lookup_version 
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@schemaRegistriesId='{{ schemaRegistriesId }}' --required,
@subjectsId='{{ subjectsId }}' --required
@@json=
'{
"schemaType": "{{ schemaType }}",
"schema": "{{ schema }}",
"references": "{{ references }}",
"normalize": {{ normalize }},
"deleted": {{ deleted }}
}';