Skip to main content

preference_sets

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

Overview

Namepreference_sets
TypeResource
Idgoogle.migrationcenter.preference_sets

Fields

The following fields are returned by SELECT queries:

Successful response

NameDatatypeDescription
namestringOutput only. Name of the preference set.
createTimestring (google-datetime)Output only. The timestamp when the preference set was created.
descriptionstringA description of the preference set.
displayNamestringUser-friendly display name. Maximum length is 63 characters.
updateTimestring (google-datetime)Output only. The timestamp when the preference set was last updated.
virtualMachinePreferencesobjectOptional. A set of preferences that applies to all virtual machines in the context. (id: VirtualMachinePreferences)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectprojectsId, locationsId, preferenceSetsIdGets the details of a preference set.
listselectprojectsId, locationsIdpageSize, pageToken, orderByLists all the preference sets in a given project and location.
createinsertprojectsId, locationsIdpreferenceSetId, requestIdCreates a new preference set in a given project and location.
patchupdateprojectsId, locationsId, preferenceSetsIdupdateMask, requestIdUpdates the parameters of a preference set.
deletedeleteprojectsId, locationsId, preferenceSetsIdrequestIdDeletes a preference set.

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
preferenceSetsIdstring
projectsIdstring
orderBystring
pageSizeinteger (int32)
pageTokenstring
preferenceSetIdstring
requestIdstring
updateMaskstring (google-fieldmask)

SELECT examples

Gets the details of a preference set.

SELECT
name,
createTime,
description,
displayName,
updateTime,
virtualMachinePreferences
FROM google.migrationcenter.preference_sets
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND preferenceSetsId = '{{ preferenceSetsId }}' -- required;

INSERT examples

Creates a new preference set in a given project and location.

INSERT INTO google.migrationcenter.preference_sets (
data__displayName,
data__description,
data__virtualMachinePreferences,
projectsId,
locationsId,
preferenceSetId,
requestId
)
SELECT
'{{ displayName }}',
'{{ description }}',
'{{ virtualMachinePreferences }}',
'{{ projectsId }}',
'{{ locationsId }}',
'{{ preferenceSetId }}',
'{{ requestId }}'
RETURNING
name,
done,
error,
metadata,
response
;

UPDATE examples

Updates the parameters of a preference set.

UPDATE google.migrationcenter.preference_sets
SET
data__displayName = '{{ displayName }}',
data__description = '{{ description }}',
data__virtualMachinePreferences = '{{ virtualMachinePreferences }}'
WHERE
projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND preferenceSetsId = '{{ preferenceSetsId }}' --required
AND updateMask = '{{ updateMask}}'
AND requestId = '{{ requestId}}'
RETURNING
name,
done,
error,
metadata,
response;

DELETE examples

Deletes a preference set.

DELETE FROM google.migrationcenter.preference_sets
WHERE projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND preferenceSetsId = '{{ preferenceSetsId }}' --required
AND requestId = '{{ requestId }}';