Skip to main content

observation_jobs

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

Overview

Nameobservation_jobs
TypeResource
Idgoogle.apim.observation_jobs

Fields

The following fields are returned by SELECT queries:

Successful response

NameDatatypeDescription
namestringIdentifier. name of resource Format: projects/{project}/locations/{location}/observationJobs/{observation_job}
createTimestring (google-datetime)Output only. [Output only] Create time stamp
sourcesarrayOptional. These should be of the same kind of source.
statestringOutput only. The observation job state
updateTimestring (google-datetime)Output only. [Output only] Update time stamp

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectprojectsId, locationsId, observationJobsIdGetObservationJob retrieves a single ObservationJob by name.
listselectprojectsId, locationsIdpageSize, pageTokenListObservationJobs gets all ObservationJobs for a given project and location.
createinsertprojectsId, locationsIdobservationJobId, requestIdCreateObservationJob 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.
deletedeleteprojectsId, locationsId, observationJobsIdDeleteObservationJob deletes an ObservationJob. This method will fail if the observation job is currently being used by any ObservationSource, even if not enabled.
enableexecprojectsId, locationsId, observationJobsIdEnables the given ObservationJob.
disableexecprojectsId, locationsId, observationJobsIdDisables 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.

NameDatatypeDescription
locationsIdstring
observationJobsIdstring
projectsIdstring
observationJobIdstring
pageSizeinteger (int32)
pageTokenstring
requestIdstring

SELECT examples

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;

INSERT examples

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
;

DELETE examples

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

Enables the given ObservationJob.

EXEC google.apim.observation_jobs.enable 
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@observationJobsId='{{ observationJobsId }}' --required;