How to use Cloudlets
Handles Cloudlet API requests.
Source code in akapy/cloudlets/cloudlet.py
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 |
|
__init__(auth=None)
Initialize Cloudlet API client.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
auth |
Auth object for handling credentials. Will use default if not provided. |
None
|
Source code in akapy/cloudlets/cloudlet.py
by_type(cloudlet_id)
Get cloudlet type information.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
cloudlet_id |
Union[int, str]
|
The cloudlet type identifier, either as an integer or a name/abbreviation string. Cloudlet type options: 0: "Edge Redirector" (ER) 1: "Visitor Prioritization" (VP) 3: "Forward Rewrite" (FR) 4: "Request Control" (RC) 5: "API Prioritization" (AP) 6: "Audience Segmentation" (AS) 7: "Phased Release" (PR) 9: "Application Load Balancer" (ALB) |
required |
Returns:
Type | Description |
---|---|
List[Dict]
|
List[Dict]: List of dictionaries containing the cloudlet type information. |
This function handles looking up the cloudlet type integer ID from the name or abbreviation string if provided. It constructs the API endpoint using this integer ID and makes the request.
Source code in akapy/cloudlets/cloudlet.py
get_all()
Gets information on all cloudlets.
Makes a GET request to the /cloudlet-info endpoint to retrieve a list of dictionaries containing information on all available cloudlets.
Returns:
Type | Description |
---|---|
List[Dict]
|
List[Dict]: A list of dictionaries containing information on all cloudlets. |
Source code in akapy/cloudlets/cloudlet.py
list_groups()
List all groups available to the user.
Makes a GET request to the groups endpoint to retrieve a list containing information about the groups.
Returns:
Type | Description |
---|---|
List[Dict]
|
List[Dict]: List containing the group information dicts. |
Source code in akapy/cloudlets/cloudlet.py
list_policies(is_deleted=False, cloudlet_id=None)
List policies filtered by deleted status and cloudlet ID.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
is_deleted |
bool
|
Whether to include deleted policies. |
False
|
cloudlet_id |
Union[int, str, None]
|
Optional cloudlet ID to filter by. Can pass: - Integer cloudlet ID - String abbreviation (e.g. "ER") - Full cloudlet name (e.g. "Edge Redirector") |
None
|
Returns:
Type | Description |
---|---|
List[Dict]
|
List of dictionaries containing policy information. |
Source code in akapy/cloudlets/cloudlet.py
Example Code
Return
[
{
"serviceVersion": null,
"apiVersion": "2.0",
"location": "/cloudlets/api/v2/cloudlet-info/3",
"cloudletId": 3,
"cloudletCode": "FR",
"cloudletName": "FORWARDREWRITE"
},
{
"serviceVersion": null,
"apiVersion": "2.0",
"location": "/cloudlets/api/v2/cloudlet-info/0",
"cloudletId": 0,
"cloudletCode": "ER",
"cloudletName": "EDGEREDIRECTOR"
}
]