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

The following fields are returned by SELECT queries:

Successful response

NameDatatypeDescription
namestringOutput only. The report unique name.
createTimestring (google-datetime)Output 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.
errorobjectOutput only. Provides details on the state of the report in case of an error. (id: Status)
frameEndTimestring (google-datetime)Output 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.
stateTimestring (google-datetime)Output only. The time the state was last set.
timeFramestringTime frame of the report.
vmCountinteger (int32)Output 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

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectprojectsId, locationsId, sourcesId, utilizationReportsIdviewGets a single Utilization Report.
listselectprojectsId, locationsId, sourcesIdview, pageSize, pageToken, filter, orderByLists Utilization Reports of the given Source.
createinsertprojectsId, locationsId, sourcesIdutilizationReportId, requestIdCreates a new UtilizationReport.
deletedeleteprojectsId, locationsId, sourcesId, utilizationReportsIdrequestIdDeletes a single Utilization Report.

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
projectsIdstring
sourcesIdstring
utilizationReportsIdstring
filterstring
orderBystring
pageSizeinteger (int32)
pageTokenstring
requestIdstring
utilizationReportIdstring
viewstring

SELECT examples

Gets a single Utilization Report.

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

INSERT examples

Creates a new UtilizationReport.

INSERT INTO google.vmmigration.utilization_reports (
data__displayName,
data__timeFrame,
data__vms,
projectsId,
locationsId,
sourcesId,
utilizationReportId,
requestId
)
SELECT
'{{ displayName }}',
'{{ timeFrame }}',
'{{ vms }}',
'{{ projectsId }}',
'{{ locationsId }}',
'{{ sourcesId }}',
'{{ utilizationReportId }}',
'{{ requestId }}'
RETURNING
name,
done,
error,
metadata,
response
;

DELETE examples

Deletes a single Utilization Report.

DELETE FROM google.vmmigration.utilization_reports
WHERE projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND sourcesId = '{{ sourcesId }}' --required
AND utilizationReportsId = '{{ utilizationReportsId }}' --required
AND requestId = '{{ requestId }}';