Skip to main content

utilization_reports

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

Overview

Nameutilization_reports
TypeResource
Idgoogle.vmmigration.utilization_reports

Fields

NameDatatypeDescription
namestringOutput only. The report unique name.
createTimestringOutput only. The time the report was created (this refers to the time of the request, not the time the report creation completed).
displayNamestringThe report display name, as assigned by the user.
errorobjectThe Status type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by gRPC. Each Status message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the API Design Guide.
frameEndTimestringOutput only. The point in time when the time frame ends. Notice that the time frame is counted backwards. For instance if the "frame_end_time" value is 2021/01/20 and the time frame is WEEK then the report covers the week between 2021/01/20 and 2021/01/14.
statestringOutput only. Current state of the report.
stateTimestringOutput only. The time the state was last set.
timeFramestringTime frame of the report.
vmCountintegerOutput only. Total number of VMs included in the report.
vmsarrayList of utilization information per VM. When sent as part of the request, the "vm_id" field is used in order to specify which VMs to include in the report. In that case all other fields are ignored.

Methods

NameAccessible byRequired ParamsDescription
getSELECTlocationsId, projectsId, sourcesId, utilizationReportsIdGets a single Utilization Report.
listSELECTlocationsId, projectsId, sourcesIdLists Utilization Reports of the given Source.
createINSERTlocationsId, projectsId, sourcesIdCreates a new UtilizationReport.
deleteDELETElocationsId, projectsId, sourcesId, utilizationReportsIdDeletes a single Utilization Report.

SELECT examples

Lists Utilization Reports of the given Source.

SELECT
name,
createTime,
displayName,
error,
frameEndTime,
state,
stateTime,
timeFrame,
vmCount,
vms
FROM google.vmmigration.utilization_reports
WHERE locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}'
AND sourcesId = '{{ sourcesId }}';

INSERT example

Use the following StackQL query and manifest file to create a new utilization_reports resource.

/*+ create */
INSERT INTO google.vmmigration.utilization_reports (
locationsId,
projectsId,
sourcesId,
displayName,
timeFrame,
vms
)
SELECT
'{{ locationsId }}',
'{{ projectsId }}',
'{{ sourcesId }}',
'{{ displayName }}',
'{{ timeFrame }}',
'{{ vms }}'
;

DELETE example

Deletes the specified utilization_reports resource.

/*+ delete */
DELETE FROM google.vmmigration.utilization_reports
WHERE locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}'
AND sourcesId = '{{ sourcesId }}'
AND utilizationReportsId = '{{ utilizationReportsId }}';