The following is the workflow you need to follow when creating a new Cloudlet policy that uses Conditional Origins.
-
Using the Property Manager API (PAPI), set up the rules for any Cloudlets Origins that will support the Cloudlets policy.
-
Run a GET request on the
/cloudlets/api/v2/cloudlet-info
endpoint to retrieve the ID (cloudletId
) for the Cloudlet you are working with. You need thecloudletId
when creating a new policy. -
Run a GET request on the
/cloudlets/api/v2/group-info
endpoint to retrieve information about which Cloudlets are associated with the groups you have edit privileges for. You will need the group IDs (groupId
) returned when creating a Cloudlet policy. -
Using the
/cloudlets/api/v2/policies
endpoint, run a POST to create a Cloudlet policy using thecloudletId
andgroupId
you retrieved from the previous steps. The policy created is version 1. However, this new version does not have a description and does not include match rules (matchRules
) attributes.
You have the option of using query parameters to clone an existing policy.
-
Update the new policy version 1 by running a PUT request on the
/cloudlets/api/v2/policies/{policyId}/versions/{version}
endpoint that includes a version description and match rules. ThepolicyId
is returned in the response when the Cloudlet policy is created. -
If you are setting up a load balancing configuration for Application Load Balancer complete the following tasks:
-
Make a POST request to
/cloudlets/api/v2/origins
. -
Make a POST request to
/cloudlets/api/v2/origins/{originId}/versions
.
-
-
If you need to review the current property associations for the policy version before activating, run a GET request on the
/cloudlets/api/v2/policies/{policyId}/properties
endpoint.
This operation also returns information about any Conditional Origins configured on an associated property.
-
Using the Property Manager API (PAPI), set up the behavior for each Cloudlet you are configuring:
-
Using PAPI, activate the property version that includes your Cloudlets behavior changes.
-
If you are setting up a load balancing configuration for Application Load Balancer, make a POST request to
/cloudlets/api/v2/origins/{originId}/activations
to activate the load balancing version. -
Activate the policy by executing a POST request to the
/cloudlets/api/v2/policies/{policyId}/versions/{version}/activations
endpoint.