Skip to main content

compute_host_groups

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

Overview​

Namecompute_host_groups
TypeResource
Idoci.compute.compute_host_groups

Fields​

The following fields are returned by SELECT queries:

The information host details for the specific host group was retrieved.

NameDatatypeDescription
idstringThe [OCID](/iaas/Content/General/Concepts/identifiers.htm) for the Customer-unique host group
availabilityDomainstringThe availability domain of a host group. Example: Uocm:PHX-AD-1
compartmentIdstringThe OCID of the compartment that contains host group.
configurationsarrayA list of HostGroupConfiguration objects
definedTagsobjectDefined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags](/iaas/Content/General/Concepts/resourcetags.htm). Example: {"Operations": {"CostCenter": "42"}}
displayNamestringA user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
freeformTagsobjectFree-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see [Resource Tags](/iaas/Content/General/Concepts/resourcetags.htm). Example: {"Department": "Finance"}
isTargetedPlacementRequiredbooleanA flag that allows customers to restrict placement for hosts attached to the group. If true, the only way to place on hosts is to target the specific host group.
lifecycleStatestringThe lifecycle state of the host group (ACTIVE, DELETED)
systemTagsobjectDefined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags](/iaas/Content/General/Concepts/resourcetags.htm). Example: {"Operations": {"CostCenter": "42"}}
timeCreatedstring (date-time)The date and time the host group was created, in the format defined by [RFC3339](https:​//tools.ietf.org/html/rfc3339). Example: 2016-08-25T21:10:29.600Z
timeUpdatedstring (date-time)The date and time the host group was updated, in the format defined by [RFC3339](https:​//tools.ietf.org/html/rfc3339). Example: 2016-08-25T21:10:29.600Z

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectcomputeHostGroupId, regionopc-request-idGets information about the specified compute host group
listselectcompartmentId, regionopc-request-id, page, limitLists the compute host groups that match the specified criteria and compartment.
createinsertregion, availabilityDomain, displayName, compartmentId, isTargetedPlacementRequiredopc-request-id, opc-retry-tokenCreates a new compute host group in the specified compartment and availability domain.
updateupdatecomputeHostGroupId, regionif-match, opc-request-id, opc-retry-tokenUpdates the specified compute host group details.
deletedeletecomputeHostGroupId, regionopc-request-id, if-matchDeletes the specified compute host group
change_compartmentexeccomputeHostGroupId, region, compartmentIdif-match, opc-request-id, opc-retry-tokenMoves a compute host group into a different compartment. For information about moving resources between<br />compartments, see [Moving Resources to a Different Compartment](/iaas/Content/Identity/Tasks/managingcompartments.htm#moveRes).<br />

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
compartmentIdstringThe [OCID](/iaas/Content/General/Concepts/identifiers.htm) of the compartment.
computeHostGroupIdstringThe [OCID](/iaas/Content/General/Concepts/identifiers.htm) of the compute host group.
regionstringOCI region identifier (e.g. us-ashburn-1, ap-sydney-1); resolves from OCI_REGION when not supplied in the query. (default: us-ashburn-1, x-stackQL-envVar: OCI_REGION)
if-matchstringFor optimistic concurrency control. In the PUT or DELETE call for a resource, set the if-match parameter to the value of the etag from a previous GET or POST response for that resource. The resource will be updated or deleted only if the etag you provide matches the resource's current etag value.
limitintegerFor list pagination. The maximum number of results per page, or items to return in a paginated "List" call. For important details about how pagination works, see [List Pagination](/iaas/Content/API/Concepts/usingapi.htm#nine). Example: 50
opc-request-idstringUnique identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.
opc-retry-tokenstringA token that uniquely identifies a request so it can be retried in case of a timeout or server error without risk of executing that same action again. Retry tokens expire after 24 hours, but can be invalidated before then due to conflicting operations (for example, if a resource has been deleted and purged from the system, then a retry of the original creation request may be rejected).
pagestringFor list pagination. The value of the opc-next-page response header from the previous "List" call. For important details about how pagination works, see [List Pagination](/iaas/Content/API/Concepts/usingapi.htm#nine).

SELECT examples​

Gets information about the specified compute host group

SELECT
id,
availabilityDomain,
compartmentId,
configurations,
definedTags,
displayName,
freeformTags,
isTargetedPlacementRequired,
lifecycleState,
systemTags,
timeCreated,
timeUpdated
FROM oci.compute.compute_host_groups
WHERE computeHostGroupId = '{{ computeHostGroupId }}' -- required
AND region = '{{ region }}' -- required
AND opc-request-id = '{{ opc-request-id }}'
;

INSERT examples​

Creates a new compute host group in the specified compartment and availability domain.

INSERT INTO oci.compute.compute_host_groups (
availabilityDomain,
compartmentId,
configurations,
definedTags,
displayName,
freeformTags,
isTargetedPlacementRequired,
region,
opc-request-id,
opc-retry-token
)
SELECT
'{{ availabilityDomain }}' /* required */,
'{{ compartmentId }}' /* required */,
'{{ configurations }}',
'{{ definedTags }}',
'{{ displayName }}' /* required */,
'{{ freeformTags }}',
{{ isTargetedPlacementRequired }} /* required */,
'{{ region }}',
'{{ opc-request-id }}',
'{{ opc-retry-token }}'
RETURNING
id,
availabilityDomain,
compartmentId,
configurations,
definedTags,
displayName,
freeformTags,
isTargetedPlacementRequired,
lifecycleState,
systemTags,
timeCreated,
timeUpdated
;

UPDATE examples​

Updates the specified compute host group details.

UPDATE oci.compute.compute_host_groups
SET
configurations = '{{ configurations }}',
definedTags = '{{ definedTags }}',
displayName = '{{ displayName }}',
freeformTags = '{{ freeformTags }}',
isTargetedPlacementRequired = {{ isTargetedPlacementRequired }}
WHERE
computeHostGroupId = '{{ computeHostGroupId }}' --required
AND region = '{{ region }}' --required
AND if-match = '{{ if-match}}'
AND opc-request-id = '{{ opc-request-id}}'
AND opc-retry-token = '{{ opc-retry-token}}'
RETURNING
id,
availabilityDomain,
compartmentId,
configurations,
definedTags,
displayName,
freeformTags,
isTargetedPlacementRequired,
lifecycleState,
systemTags,
timeCreated,
timeUpdated;

DELETE examples​

Deletes the specified compute host group

DELETE FROM oci.compute.compute_host_groups
WHERE computeHostGroupId = '{{ computeHostGroupId }}' --required
AND region = '{{ region }}' --required
AND opc-request-id = '{{ opc-request-id }}'
AND if-match = '{{ if-match }}'
;

Lifecycle Methods​

Moves a compute host group into a different compartment. For information about moving resources between<br />compartments, see [Moving Resources to a Different Compartment](/iaas/Content/Identity/Tasks/managingcompartments.htm#moveRes).<br />

EXEC oci.compute.compute_host_groups.change_compartment
@computeHostGroupId='{{ computeHostGroupId }}' --required,
@region='{{ region }}' --required,
@if-match='{{ if-match }}',
@opc-request-id='{{ opc-request-id }}',
@opc-retry-token='{{ opc-retry-token }}'
@@json=
'{
"compartmentId": "{{ compartmentId }}"
}'
;