Skip to main content

instances

Creates, updates, deletes, gets or lists an instances resource.

Overview

Nameinstances
TypeResource
Idgoogle.apihub.instances

Fields

The following fields are returned by SELECT queries:

Successful response

NameDatatypeDescription
namestringIdentifier. The unique name of the plugin instance resource. Format: projects/{project}/locations/{location}/plugins/{plugin}/instances/{instance}
actionsarrayRequired. The action status for the plugin instance.
additionalConfigobjectOptional. The additional information for this plugin instance corresponding to the additional config template of the plugin. This information will be sent to plugin hosting service on each call to plugin hosted service. The key will be the config_variable_template.display_name to uniquely identify the config variable.
authConfigobjectOptional. The authentication information for this plugin instance. (id: GoogleCloudApihubV1AuthConfig)
createTimestring (google-datetime)Output only. Timestamp indicating when the plugin instance was created.
displayNamestringRequired. The display name for this plugin instance. Max length is 255 characters.
errorMessagestringOutput only. Error message describing the failure, if any, during Create, Delete or ApplyConfig operation corresponding to the plugin instance.This field will only be populated if the plugin instance is in the ERROR or FAILED state.
sourceProjectIdstringOptional. The source project id of the plugin instance. This will be the id of runtime project in case of gcp based plugins and org id in case of non gcp based plugins. This field will be a required field for Google provided on-ramp plugins.
statestringOutput only. The current state of the plugin instance (e.g., enabled, disabled, provisioning).
updateTimestring (google-datetime)Output only. Timestamp indicating when the plugin instance was last updated.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectprojectsId, locationsId, pluginsId, instancesIdGet an API Hub plugin instance.
listselectprojectsId, locationsId, pluginsIdfilter, pageSize, pageTokenList all the plugins in a given project and location. - can be used as wildcard value for {plugin_id}
createinsertprojectsId, locationsId, pluginsIdpluginInstanceIdCreates a Plugin instance in the API hub.
patchupdateprojectsId, locationsId, pluginsId, instancesIdupdateMaskUpdates a plugin instance in the API hub. The following fields in the plugin_instance can be updated currently: * display_name * schedule_cron_expression The update_mask should be used to specify the fields being updated. To update the auth_config and additional_config of the plugin instance, use the ApplyPluginInstanceConfig method.
deletedeleteprojectsId, locationsId, pluginsId, instancesIdDeletes a plugin instance in the API hub.
execute_actionexecprojectsId, locationsId, pluginsId, instancesIdExecutes a plugin instance in the API hub.
enable_actionexecprojectsId, locationsId, pluginsId, instancesIdEnables a plugin instance in the API hub.
disable_actionexecprojectsId, locationsId, pluginsId, instancesIdDisables a plugin instance in the API hub.

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
instancesIdstring
locationsIdstring
pluginsIdstring
projectsIdstring
filterstring
pageSizeinteger (int32)
pageTokenstring
pluginInstanceIdstring
updateMaskstring (google-fieldmask)

SELECT examples

Get an API Hub plugin instance.

SELECT
name,
actions,
additionalConfig,
authConfig,
createTime,
displayName,
errorMessage,
sourceProjectId,
state,
updateTime
FROM google.apihub.instances
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND pluginsId = '{{ pluginsId }}' -- required
AND instancesId = '{{ instancesId }}' -- required;

INSERT examples

Creates a Plugin instance in the API hub.

INSERT INTO google.apihub.instances (
data__name,
data__displayName,
data__authConfig,
data__additionalConfig,
data__actions,
data__sourceProjectId,
projectsId,
locationsId,
pluginsId,
pluginInstanceId
)
SELECT
'{{ name }}',
'{{ displayName }}',
'{{ authConfig }}',
'{{ additionalConfig }}',
'{{ actions }}',
'{{ sourceProjectId }}',
'{{ projectsId }}',
'{{ locationsId }}',
'{{ pluginsId }}',
'{{ pluginInstanceId }}'
RETURNING
name,
done,
error,
metadata,
response
;

UPDATE examples

Updates a plugin instance in the API hub. The following fields in the plugin_instance can be updated currently: * display_name * schedule_cron_expression The update_mask should be used to specify the fields being updated. To update the auth_config and additional_config of the plugin instance, use the ApplyPluginInstanceConfig method.

UPDATE google.apihub.instances
SET
data__name = '{{ name }}',
data__displayName = '{{ displayName }}',
data__authConfig = '{{ authConfig }}',
data__additionalConfig = '{{ additionalConfig }}',
data__actions = '{{ actions }}',
data__sourceProjectId = '{{ sourceProjectId }}'
WHERE
projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND pluginsId = '{{ pluginsId }}' --required
AND instancesId = '{{ instancesId }}' --required
AND updateMask = '{{ updateMask}}'
RETURNING
name,
actions,
additionalConfig,
authConfig,
createTime,
displayName,
errorMessage,
sourceProjectId,
state,
updateTime;

DELETE examples

Deletes a plugin instance in the API hub.

DELETE FROM google.apihub.instances
WHERE projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND pluginsId = '{{ pluginsId }}' --required
AND instancesId = '{{ instancesId }}' --required;

Lifecycle Methods

Executes a plugin instance in the API hub.

EXEC google.apihub.instances.execute_action 
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@pluginsId='{{ pluginsId }}' --required,
@instancesId='{{ instancesId }}' --required
@@json=
'{
"actionExecutionDetail": "{{ actionExecutionDetail }}"
}';