Skip to main content

workload_mappings

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

Overview​

Nameworkload_mappings
TypeResource
Idoci.container_engine.workload_mappings

Fields​

The following fields are returned by SELECT queries:

WorkloadMapping details.

NameDatatypeDescription
idstringThe ocid of the workloadMapping. (example: ocid1.workloadmapping.ocX.us-ashburn-1.xtrdsa56sjasa72321)
clusterIdstringThe OCID of the cluster. (example: ocid1.cluster.oc1.iad.aaaaaaaaga3tombrmq3wgyrvmi3gcn3bmfsdizjwgy4wgyldmy3dcmtcmmyw)
definedTagsobjectDefined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags](/Content/General/Concepts/resourcetags.htm). Example: {"Operations": {"CostCenter": "42"}}
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](/Content/General/Concepts/resourcetags.htm). Example: {"Department": "Finance"}
lifecycleStatestringThe state of the workloadMapping. (CREATING, ACTIVE, FAILED, DELETING, DELETED, UPDATING) (example: UPDATING, x-obmcs-top-level-enum: #/definitions/WorkloadMappingLifecycleState)
mappedCompartmentIdstringThe OCID of the mapped customer compartment. (example: ocid1.compartment.oc1..aaaaaaaafqm2df7ckwmmbtdsl2bgxsw4fcpvkoojytxrqst24yww2tdmtqcq)
mappedTenancyIdstringThe OCID of the mapped customer tenancy. (example: ocid1.tenancy.oc1..aaaaaaaafqm2df7ckwmmbtdsl2bgxsw4fcpvkoojytxrqst24yww2tdmtqcq)
namespacestringThe namespace of the workloadMapping. (example: kube-proxy)
systemTagsobjectUsage of system tag keys. These predefined keys are scoped to namespaces. Example: {"orcl-cloud": {"free-tier-retained": "true"}}
timeCreatedstring (date-time)The time the cluster was created. (example: 2017-07-21T16:11:29Z)

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectclusterId, workloadMappingId, regionopc-request-idGet the specified workloadMapping for a cluster.
listselectclusterId, regionopc-request-id, limit, page, sortOrder, sortByList workloadMappings for a provisioned cluster.
createinsertclusterId, region, namespace, mappedCompartmentIdopc-retry-token, opc-request-idCreate the specified workloadMapping for a cluster.
updateupdateclusterId, workloadMappingId, regionif-match, opc-request-idUpdate workloadMapping details for a cluster.
deletedeleteclusterId, workloadMappingId, regionif-match, opc-request-idDelete workloadMapping for a provisioned cluster.

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
clusterIdstringThe OCID of the cluster.
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)
workloadMappingIdstringThe OCID of the workloadMapping.
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. 1 is the minimum, 1000 is the maximum. For important details about how pagination works, see [List Pagination](/iaas/Content/API/Concepts/usingapi.htm#nine).
opc-request-idstringUnique Oracle-assigned identifier for the request. If you need to contact Oracle about a particular request, please provide the request ID.
opc-retry-tokenstringA token you supply to uniquely identify the request and provide idempotency if the request is retried. Idempotency tokens expire after 24 hours.
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).
sortBystringThe optional field to sort the results by.
sortOrderstringThe optional order in which to sort the results.

SELECT examples​

Get the specified workloadMapping for a cluster.

SELECT
id,
clusterId,
definedTags,
freeformTags,
lifecycleState,
mappedCompartmentId,
mappedTenancyId,
namespace,
systemTags,
timeCreated
FROM oci.container_engine.workload_mappings
WHERE clusterId = '{{ clusterId }}' -- required
AND workloadMappingId = '{{ workloadMappingId }}' -- required
AND region = '{{ region }}' -- required
AND opc-request-id = '{{ opc-request-id }}'
;

INSERT examples​

Create the specified workloadMapping for a cluster.

INSERT INTO oci.container_engine.workload_mappings (
definedTags,
freeformTags,
mappedCompartmentId,
namespace,
clusterId,
region,
opc-retry-token,
opc-request-id
)
SELECT
'{{ definedTags }}',
'{{ freeformTags }}',
'{{ mappedCompartmentId }}' /* required */,
'{{ namespace }}' /* required */,
'{{ clusterId }}',
'{{ region }}',
'{{ opc-retry-token }}',
'{{ opc-request-id }}'
RETURNING
id,
clusterId,
definedTags,
freeformTags,
lifecycleState,
mappedCompartmentId,
mappedTenancyId,
namespace,
systemTags,
timeCreated
;

UPDATE examples​

Update workloadMapping details for a cluster.

UPDATE oci.container_engine.workload_mappings
SET
definedTags = '{{ definedTags }}',
freeformTags = '{{ freeformTags }}',
mappedCompartmentId = '{{ mappedCompartmentId }}'
WHERE
clusterId = '{{ clusterId }}' --required
AND workloadMappingId = '{{ workloadMappingId }}' --required
AND region = '{{ region }}' --required
AND if-match = '{{ if-match}}'
AND opc-request-id = '{{ opc-request-id}}'
RETURNING
id,
clusterId,
definedTags,
freeformTags,
lifecycleState,
mappedCompartmentId,
mappedTenancyId,
namespace,
systemTags,
timeCreated;

DELETE examples​

Delete workloadMapping for a provisioned cluster.

DELETE FROM oci.container_engine.workload_mappings
WHERE clusterId = '{{ clusterId }}' --required
AND workloadMappingId = '{{ workloadMappingId }}' --required
AND region = '{{ region }}' --required
AND if-match = '{{ if-match }}'
AND opc-request-id = '{{ opc-request-id }}'
;