Skip to content

Commit

Permalink
Merge pull request #509 from joal42/feature/joal/upgrade-spot-placeme…
Browse files Browse the repository at this point in the history
…nt-cli-2024-06-01

Upgrade az compute-recommender spot-placement-recommender  to 2024-06-01-preview version
  • Loading branch information
kairu-ms authored Jun 27, 2024
2 parents 41f60c3 + bbaadf3 commit 84b8bba
Show file tree
Hide file tree
Showing 4 changed files with 132 additions and 0 deletions.
11 changes: 11 additions & 0 deletions Commands/compute-recommender/_spot-placement-recommender.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,14 @@ Generate placement scores for Spot VM skus.
```bash
compute-recommender spot-placement-recommender -l eastus --subscription ffffffff-ffff-ffff-ffff-ffffffffffff --availability-zones true --desired-locations '["eastus", "eastus2"]' --desired-count 1 --desired-sizes '[{"sku": "Standard_D2_v2"}]'
```

### [2024-06-01-preview](/Resources/mgmt-plane/L3N1YnNjcmlwdGlvbnMve30vcHJvdmlkZXJzL21pY3Jvc29mdC5jb21wdXRlL2xvY2F0aW9ucy97fS9wbGFjZW1lbnRzY29yZXMvc3BvdC9nZW5lcmF0ZQ==/2024-06-01-preview.xml) **Stable**

<!-- mgmt-plane /subscriptions/{}/providers/microsoft.compute/locations/{}/placementscores/spot/generate 2024-06-01-preview -->

#### examples

- generate spot vm placement score example
```bash
compute-recommender spot-placement-recommender -l eastus --subscription ffffffff-ffff-ffff-ffff-ffffffffffff --availability-zones true --desired-locations '["eastus", "eastus2"]' --desired-count 1 --desired-sizes '[{"sku": "Standard_D2_v2"}]'
```
18 changes: 18 additions & 0 deletions Commands/tree.json
Original file line number Diff line number Diff line change
Expand Up @@ -16219,6 +16219,24 @@
"version": "2024-03-01-preview"
}
]
},
{
"examples": [
{
"commands": [
"compute-recommender spot-placement-recommender -l eastus --subscription ffffffff-ffff-ffff-ffff-ffffffffffff --availability-zones true --desired-locations '[\"eastus\", \"eastus2\"]' --desired-count 1 --desired-sizes '[{\"sku\": \"Standard_D2_v2\"}]'"
],
"name": "generate spot vm placement score example"
}
],
"name": "2024-06-01-preview",
"resources": [
{
"id": "/subscriptions/{}/providers/microsoft.compute/locations/{}/placementscores/spot/generate",
"plane": "mgmt-plane",
"version": "2024-06-01-preview"
}
]
}
]
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"plane": "mgmt-plane", "resources": [{"id": "/subscriptions/{}/providers/microsoft.compute/locations/{}/placementscores/spot/generate", "version": "2024-06-01-preview", "swagger": "mgmt-plane/compute/ResourceProviders/Microsoft.Compute/Paths/L3N1YnNjcmlwdGlvbnMve3N1YnNjcmlwdGlvbklkfS9wcm92aWRlcnMvTWljcm9zb2Z0LkNvbXB1dGUvbG9jYXRpb25zL3tsb2NhdGlvbn0vcGxhY2VtZW50U2NvcmVzL3Nwb3QvZ2VuZXJhdGU=/V/MjAyNC0wNi0wMS1wcmV2aWV3"}], "commandGroups": [{"name": "compute-recommender", "commands": [{"name": "spot-placement-recommender", "version": "2024-06-01-preview", "resources": [{"id": "/subscriptions/{}/providers/microsoft.compute/locations/{}/placementscores/spot/generate", "version": "2024-06-01-preview", "swagger": "mgmt-plane/compute/ResourceProviders/Microsoft.Compute/Paths/L3N1YnNjcmlwdGlvbnMve3N1YnNjcmlwdGlvbklkfS9wcm92aWRlcnMvTWljcm9zb2Z0LkNvbXB1dGUvbG9jYXRpb25zL3tsb2NhdGlvbn0vcGxhY2VtZW50U2NvcmVzL3Nwb3QvZ2VuZXJhdGU=/V/MjAyNC0wNi0wMS1wcmV2aWV3"}], "argGroups": [{"name": "", "args": [{"type": "ResourceLocation", "var": "$Path.location", "options": ["l", "location"], "required": true, "idPart": "name"}, {"type": "SubscriptionId", "var": "$Path.subscriptionId", "options": ["subscription"], "required": true, "idPart": "subscription"}]}, {"name": "SpotPlacementScoresInput", "args": [{"type": "boolean", "var": "$spotPlacementScoresInput.availabilityZones", "options": ["availability-zones"], "group": "SpotPlacementScoresInput", "help": {"short": "Defines if the scope is zonal or regional."}}, {"type": "integer32", "var": "$spotPlacementScoresInput.desiredCount", "options": ["desired-count"], "group": "SpotPlacementScoresInput", "help": {"short": "Desired instance count per region/zone based on the scope."}}, {"type": "array<string>", "var": "$spotPlacementScoresInput.desiredLocations", "options": ["desired-locations"], "group": "SpotPlacementScoresInput", "help": {"short": "The desired regions"}, "item": {"type": "string"}}, {"type": "array<object>", "var": "$spotPlacementScoresInput.desiredSizes", "options": ["desired-sizes"], "group": "SpotPlacementScoresInput", "help": {"short": "The desired resource SKUs."}, "item": {"type": "object", "args": [{"type": "string", "var": "$spotPlacementScoresInput.desiredSizes[].sku", "options": ["sku"], "help": {"short": "The resource's CRP virtual machine SKU size."}}]}}]}], "operations": [{"operationId": "SpotPlacementScores_Post", "http": {"path": "/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/placementScores/spot/generate", "request": {"method": "post", "path": {"params": [{"type": "string", "name": "location", "arg": "$Path.location", "required": true, "format": {"minLength": 1}}, {"type": "uuid", "name": "subscriptionId", "arg": "$Path.subscriptionId", "required": true}]}, "query": {"consts": [{"readOnly": true, "const": true, "default": {"value": "2024-06-01-preview"}, "type": "string", "name": "api-version", "required": true, "format": {"minLength": 1}}]}, "body": {"json": {"schema": {"type": "object", "name": "spotPlacementScoresInput", "required": true, "props": [{"type": "boolean", "name": "availabilityZones", "arg": "$spotPlacementScoresInput.availabilityZones"}, {"type": "integer32", "name": "desiredCount", "arg": "$spotPlacementScoresInput.desiredCount"}, {"type": "array<string>", "name": "desiredLocations", "arg": "$spotPlacementScoresInput.desiredLocations", "item": {"type": "string"}}, {"type": "array<object>", "name": "desiredSizes", "arg": "$spotPlacementScoresInput.desiredSizes", "item": {"type": "object", "props": [{"type": "string", "name": "sku", "arg": "$spotPlacementScoresInput.desiredSizes[].sku"}]}}], "clientFlatten": true}}}}, "responses": [{"statusCode": [200], "body": {"json": {"var": "$Instance", "schema": {"type": "object", "props": [{"type": "boolean", "name": "availabilityZones"}, {"type": "integer32", "name": "desiredCount"}, {"type": "array<string>", "name": "desiredLocations", "item": {"type": "string"}}, {"type": "array<object>", "name": "desiredSizes", "item": {"type": "object", "props": [{"type": "string", "name": "sku"}]}}, {"type": "array<object>", "name": "placementScores", "item": {"type": "object", "props": [{"type": "string", "name": "availabilityZone"}, {"type": "boolean", "name": "isQuotaAvailable"}, {"type": "string", "name": "region"}, {"type": "string", "name": "score"}, {"type": "string", "name": "sku"}]}}]}}}}, {"isError": true, "body": {"json": {"schema": {"type": "@MgmtErrorFormat"}}}}]}}], "outputs": [{"type": "object", "ref": "$Instance", "clientFlatten": true}], "confirmation": ""}]}]}
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
<?xml version='1.0' encoding='utf-8'?>
<CodeGen plane="mgmt-plane">
<resource id="/subscriptions/{}/providers/microsoft.compute/locations/{}/placementscores/spot/generate" version="2024-06-01-preview" swagger="mgmt-plane/compute/ResourceProviders/Microsoft.Compute/Paths/L3N1YnNjcmlwdGlvbnMve3N1YnNjcmlwdGlvbklkfS9wcm92aWRlcnMvTWljcm9zb2Z0LkNvbXB1dGUvbG9jYXRpb25zL3tsb2NhdGlvbn0vcGxhY2VtZW50U2NvcmVzL3Nwb3QvZ2VuZXJhdGU=/V/MjAyNC0wNi0wMS1wcmV2aWV3"/>
<commandGroup name="compute-recommender">
<command name="spot-placement-recommender" version="2024-06-01-preview" confirmation="">
<resource id="/subscriptions/{}/providers/microsoft.compute/locations/{}/placementscores/spot/generate" version="2024-06-01-preview" swagger="mgmt-plane/compute/ResourceProviders/Microsoft.Compute/Paths/L3N1YnNjcmlwdGlvbnMve3N1YnNjcmlwdGlvbklkfS9wcm92aWRlcnMvTWljcm9zb2Z0LkNvbXB1dGUvbG9jYXRpb25zL3tsb2NhdGlvbn0vcGxhY2VtZW50U2NvcmVzL3Nwb3QvZ2VuZXJhdGU=/V/MjAyNC0wNi0wMS1wcmV2aWV3"/>
<argGroup name="">
<arg type="ResourceLocation" var="$Path.location" options="location l" required="True" idPart="name"/>
<arg type="SubscriptionId" var="$Path.subscriptionId" options="subscription" required="True" idPart="subscription"/>
</argGroup>
<argGroup name="SpotPlacementScoresInput">
<arg type="boolean" var="$spotPlacementScoresInput.availabilityZones" options="availability-zones" group="SpotPlacementScoresInput">
<help short="Defines if the scope is zonal or regional."/>
</arg>
<arg type="integer32" var="$spotPlacementScoresInput.desiredCount" options="desired-count" group="SpotPlacementScoresInput">
<help short="Desired instance count per region/zone based on the scope."/>
</arg>
<arg type="array<string>" var="$spotPlacementScoresInput.desiredLocations" options="desired-locations" group="SpotPlacementScoresInput">
<help short="The desired regions"/>
<item type="string"/>
</arg>
<arg type="array<object>" var="$spotPlacementScoresInput.desiredSizes" options="desired-sizes" group="SpotPlacementScoresInput">
<help short="The desired resource SKUs."/>
<item type="object">
<arg type="string" var="$spotPlacementScoresInput.desiredSizes[].sku" options="sku">
<help short="The resource's CRP virtual machine SKU size."/>
</arg>
</item>
</arg>
</argGroup>
<operation operationId="SpotPlacementScores_Post">
<http path="/subscriptions/{subscriptionId}/providers/Microsoft.Compute/locations/{location}/placementScores/spot/generate">
<request method="post">
<path>
<param type="string" name="location" arg="$Path.location" required="True">
<format minLength="1"/>
</param>
<param type="uuid" name="subscriptionId" arg="$Path.subscriptionId" required="True"/>
</path>
<query>
<const readOnly="True" const="True" type="string" name="api-version" required="True">
<default value="&quot;2024-06-01-preview&quot;"/>
<format minLength="1"/>
</const>
</query>
<body>
<json>
<schema type="object" name="spotPlacementScoresInput" required="True" clientFlatten="True">
<prop type="boolean" name="availabilityZones" arg="$spotPlacementScoresInput.availabilityZones"/>
<prop type="integer32" name="desiredCount" arg="$spotPlacementScoresInput.desiredCount"/>
<prop type="array<string>" name="desiredLocations" arg="$spotPlacementScoresInput.desiredLocations">
<item type="string"/>
</prop>
<prop type="array<object>" name="desiredSizes" arg="$spotPlacementScoresInput.desiredSizes">
<item type="object">
<prop type="string" name="sku" arg="$spotPlacementScoresInput.desiredSizes[].sku"/>
</item>
</prop>
</schema>
</json>
</body>
</request>
<response statusCode="200">
<body>
<json var="$Instance">
<schema type="object">
<prop type="boolean" name="availabilityZones"/>
<prop type="integer32" name="desiredCount"/>
<prop type="array<string>" name="desiredLocations">
<item type="string"/>
</prop>
<prop type="array<object>" name="desiredSizes">
<item type="object">
<prop type="string" name="sku"/>
</item>
</prop>
<prop type="array<object>" name="placementScores">
<item type="object">
<prop type="string" name="availabilityZone"/>
<prop type="boolean" name="isQuotaAvailable"/>
<prop type="string" name="region"/>
<prop type="string" name="score"/>
<prop type="string" name="sku"/>
</item>
</prop>
</schema>
</json>
</body>
</response>
<response isError="True">
<body>
<json>
<schema type="@MgmtErrorFormat"/>
</json>
</body>
</response>
</http>
</operation>
<output type="object" ref="$Instance" clientFlatten="True"/>
</command>
</commandGroup>
</CodeGen>

0 comments on commit 84b8bba

Please sign in to comment.