observation_jobs
Creates, updates, deletes, gets or lists an observation_jobs
resource.
Overview
Name | observation_jobs |
Type | Resource |
Id | google.apim.observation_jobs |
Fields
The following fields are returned by SELECT
queries:
- get
- list
Successful response
Name | Datatype | Description |
---|---|---|
name | string | Identifier. name of resource Format: projects/{project}/locations/{location}/observationJobs/{observation_job} |
createTime | string (google-datetime) | Output only. [Output only] Create time stamp |
sources | array | Optional. These should be of the same kind of source. |
state | string | Output only. The observation job state |
updateTime | string (google-datetime) | Output only. [Output only] Update time stamp |
Successful response
Name | Datatype | Description |
---|---|---|
name | string | Identifier. name of resource Format: projects/{project}/locations/{location}/observationJobs/{observation_job} |
createTime | string (google-datetime) | Output only. [Output only] Create time stamp |
sources | array | Optional. These should be of the same kind of source. |
state | string | Output only. The observation job state |
updateTime | string (google-datetime) | Output only. [Output only] Update time stamp |
Methods
The following methods are available for this resource:
Name | Accessible by | Required Params | Optional Params | Description |
---|---|---|---|---|
get | select | projectsId , locationsId , observationJobsId | GetObservationJob retrieves a single ObservationJob by name. | |
list | select | projectsId , locationsId | pageSize , pageToken | ListObservationJobs gets all ObservationJobs for a given project and location. |
create | insert | projectsId , locationsId | observationJobId , requestId | CreateObservationJob creates a new ObservationJob but does not have any effecton its own. It is a configuration that can be used in an Observation Job to collect data about existing APIs. |
delete | delete | projectsId , locationsId , observationJobsId | DeleteObservationJob deletes an ObservationJob. This method will fail if the observation job is currently being used by any ObservationSource, even if not enabled. | |
enable | exec | projectsId , locationsId , observationJobsId | Enables the given ObservationJob. | |
disable | exec | projectsId , locationsId , observationJobsId | Disables the given ObservationJob. |
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.
Name | Datatype | Description |
---|---|---|
locationsId | string | |
observationJobsId | string | |
projectsId | string | |
observationJobId | string | |
pageSize | integer (int32) | |
pageToken | string | |
requestId | string |
SELECT
examples
- get
- list
GetObservationJob retrieves a single ObservationJob by name.
SELECT
name,
createTime,
sources,
state,
updateTime
FROM google.apim.observation_jobs
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND observationJobsId = '{{ observationJobsId }}' -- required;
ListObservationJobs gets all ObservationJobs for a given project and location.
SELECT
name,
createTime,
sources,
state,
updateTime
FROM google.apim.observation_jobs
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND pageSize = '{{ pageSize }}'
AND pageToken = '{{ pageToken }}';
INSERT
examples
- create
- Manifest
CreateObservationJob creates a new ObservationJob but does not have any effecton its own. It is a configuration that can be used in an Observation Job to collect data about existing APIs.
INSERT INTO google.apim.observation_jobs (
data__name,
data__sources,
projectsId,
locationsId,
observationJobId,
requestId
)
SELECT
'{{ name }}',
'{{ sources }}',
'{{ projectsId }}',
'{{ locationsId }}',
'{{ observationJobId }}',
'{{ requestId }}'
RETURNING
name,
done,
error,
metadata,
response
;
# Description fields are for documentation purposes
- name: observation_jobs
props:
- name: projectsId
value: string
description: Required parameter for the observation_jobs resource.
- name: locationsId
value: string
description: Required parameter for the observation_jobs resource.
- name: name
value: string
description: >
Identifier. name of resource Format: projects/{project}/locations/{location}/observationJobs/{observation_job}
- name: sources
value: array
description: >
Optional. These should be of the same kind of source.
- name: observationJobId
value: string
- name: requestId
value: string
DELETE
examples
- delete
DeleteObservationJob deletes an ObservationJob. This method will fail if the observation job is currently being used by any ObservationSource, even if not enabled.
DELETE FROM google.apim.observation_jobs
WHERE projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND observationJobsId = '{{ observationJobsId }}' --required;
Lifecycle Methods
- enable
- disable
Enables the given ObservationJob.
EXEC google.apim.observation_jobs.enable
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@observationJobsId='{{ observationJobsId }}' --required;
Disables the given ObservationJob.
EXEC google.apim.observation_jobs.disable
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@observationJobsId='{{ observationJobsId }}' --required;