contexts
Creates, updates, deletes, gets or lists a contexts
resource.
Overview
Name | contexts |
Type | Resource |
Id | google.aiplatform.contexts |
Fields
Name | Datatype | Description |
---|---|---|
name | string | Immutable. The resource name of the Context. |
description | string | Description of the Context |
createTime | string | Output only. Timestamp when this Context was created. |
displayName | string | User provided display name of the Context. May be up to 128 Unicode characters. |
etag | string | An eTag used to perform consistent read-modify-write updates. If not set, a blind "overwrite" update happens. |
labels | object | The labels with user-defined metadata to organize your Contexts. 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 Context (System labels are excluded). |
metadata | object | Properties of the Context. Top level metadata keys' heading and trailing spaces will be trimmed. The size of this field should not exceed 200KB. |
parentContexts | array | Output only. A list of resource names of Contexts that are parents of this Context. A Context may have at most 10 parent_contexts. |
schemaTitle | string | The title of the schema describing the metadata. Schema title and version is expected to be registered in earlier Create Schema calls. And both are used together as unique identifiers to identify schemas within the local metadata store. |
schemaVersion | string | The version of the schema in schema_name to use. Schema title and version is expected to be registered in earlier Create Schema calls. And both are used together as unique identifiers to identify schemas within the local metadata store. |
updateTime | string | Output only. Timestamp when this Context was last updated. |
Methods
Name | Accessible by | Required Params | Description |
---|---|---|---|
get | SELECT | contextsId, locationsId, metadataStoresId, projectsId | Retrieves a specific Context. |
list | SELECT | locationsId, metadataStoresId, projectsId | Lists Contexts on the MetadataStore. |
query_context_lineage_subgraph | SELECT | contextsId, locationsId, metadataStoresId, projectsId | Retrieves Artifacts and Executions within the specified Context, connected by Event edges and returned as a LineageSubgraph. |
create | INSERT | locationsId, metadataStoresId, projectsId | Creates a Context associated with a MetadataStore. |
delete | DELETE | contextsId, locationsId, metadataStoresId, projectsId | Deletes a stored Context. |
patch | UPDATE | contextsId, locationsId, metadataStoresId, projectsId | Updates a stored Context. |
purge | EXEC | locationsId, metadataStoresId, projectsId | Purges Contexts. |
SELECT
examples
Lists Contexts on the MetadataStore.
SELECT
name,
description,
createTime,
displayName,
etag,
labels,
metadata,
parentContexts,
schemaTitle,
schemaVersion,
updateTime
FROM google.aiplatform.contexts
WHERE locationsId = '{{ locationsId }}'
AND metadataStoresId = '{{ metadataStoresId }}'
AND projectsId = '{{ projectsId }}';
INSERT
example
Use the following StackQL query and manifest file to create a new contexts
resource.
- All Properties
- Manifest
/*+ create */
INSERT INTO google.aiplatform.contexts (
locationsId,
metadataStoresId,
projectsId,
schemaVersion,
etag,
schemaTitle,
description,
name,
labels,
displayName,
metadata
)
SELECT
'{{ locationsId }}',
'{{ metadataStoresId }}',
'{{ projectsId }}',
'{{ schemaVersion }}',
'{{ etag }}',
'{{ schemaTitle }}',
'{{ description }}',
'{{ name }}',
'{{ labels }}',
'{{ displayName }}',
'{{ metadata }}'
;
- name: your_resource_model_name
props:
- name: parentContexts
value:
- string
- name: schemaVersion
value: string
- name: etag
value: string
- name: schemaTitle
value: string
- name: description
value: string
- name: updateTime
value: string
- name: name
value: string
- name: labels
value: object
- name: displayName
value: string
- name: metadata
value: object
- name: createTime
value: string
UPDATE
example
Updates a contexts
resource.
/*+ update */
UPDATE google.aiplatform.contexts
SET
schemaVersion = '{{ schemaVersion }}',
etag = '{{ etag }}',
schemaTitle = '{{ schemaTitle }}',
description = '{{ description }}',
name = '{{ name }}',
labels = '{{ labels }}',
displayName = '{{ displayName }}',
metadata = '{{ metadata }}'
WHERE
contextsId = '{{ contextsId }}'
AND locationsId = '{{ locationsId }}'
AND metadataStoresId = '{{ metadataStoresId }}'
AND projectsId = '{{ projectsId }}';
DELETE
example
Deletes the specified contexts
resource.
/*+ delete */
DELETE FROM google.aiplatform.contexts
WHERE contextsId = '{{ contextsId }}'
AND locationsId = '{{ locationsId }}'
AND metadataStoresId = '{{ metadataStoresId }}'
AND projectsId = '{{ projectsId }}';