Obtient les options de système d’exploitation prises en charge dans l’abonnement spécifié.
GET https://management.azure.com/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/osOptions/default?api-version=2024-02-01
With optional parameters:
GET https://management.azure.com/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/osOptions/default?api-version=2024-02-01&resource-type={resource-type}
Paramètres URI
Nom |
Dans |
Obligatoire |
Type |
Description |
location
|
path |
True
|
string
|
Nom de la région Azure.
|
subscriptionId
|
path |
True
|
string
uuid
|
ID de l’abonnement cible. La valeur doit être un UUID.
|
api-version
|
query |
True
|
string
|
Version de l’API à utiliser pour cette opération.
|
resource-type
|
query |
|
string
|
Type de ressource pour lequel les options du système d’exploitation doivent être retournées
|
Réponses
Nom |
Type |
Description |
200 OK
|
OSOptionProfile
|
Ok
|
Other Status Codes
|
CloudError
|
Réponse d’erreur décrivant le motif de l’échec de l’opération
|
Sécurité
azure_auth
Flux OAuth2 Azure Active Directory
Type:
oauth2
Flow:
implicit
Authorization URL:
https://login.microsoftonline.com/common/oauth2/authorize
Scopes
Nom |
Description |
user_impersonation
|
Emprunter l’identité de votre compte d’utilisateur
|
Exemples
Get Container Service OS Options
Sample Request
GET https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/location1/osOptions/default?api-version=2024-02-01
/**
* Samples for ManagedClusters GetOSOptions.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-02-01/examples/
* ContainerServiceGetOSOptions.json
*/
/**
* Sample code: Get Container Service OS Options.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void getContainerServiceOSOptions(com.azure.resourcemanager.AzureResourceManager azure) {
azure.kubernetesClusters().manager().serviceClient().getManagedClusters().getOSOptionsWithResponse("location1",
null, com.azure.core.util.Context.NONE);
}
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
from azure.identity import DefaultAzureCredential
from azure.mgmt.containerservice import ContainerServiceClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-containerservice
# USAGE
python container_service_get_os_options.py
Before run the sample, please set the values of the client ID, tenant ID and client secret
of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_CLIENT_SECRET. For more info about how to get the value, please see:
https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal
"""
def main():
client = ContainerServiceClient(
credential=DefaultAzureCredential(),
subscription_id="00000000-0000-0000-0000-000000000000",
)
response = client.managed_clusters.get_os_options(
location="location1",
)
print(response)
# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-02-01/examples/ContainerServiceGetOSOptions.json
if __name__ == "__main__":
main()
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
package armcontainerservice_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerservice/armcontainerservice/v5"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/92de53a5f1e0e03c94b40475d2135d97148ed014/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-02-01/examples/ContainerServiceGetOSOptions.json
func ExampleManagedClustersClient_GetOSOptions() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcontainerservice.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewManagedClustersClient().GetOSOptions(ctx, "location1", &armcontainerservice.ManagedClustersClientGetOSOptionsOptions{ResourceType: nil})
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
// You could use response here. We use blank identifier for just demo purposes.
_ = res
// If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes.
// res.OSOptionProfile = armcontainerservice.OSOptionProfile{
// Name: to.Ptr("default"),
// Type: to.Ptr("Microsoft.ContainerService/locations/osOptions"),
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/location1/osOptions/default"),
// Properties: &armcontainerservice.OSOptionPropertyList{
// OSOptionPropertyList: []*armcontainerservice.OSOptionProperty{
// {
// EnableFipsImage: to.Ptr(false),
// OSType: to.Ptr("Linux"),
// },
// {
// EnableFipsImage: to.Ptr(false),
// OSType: to.Ptr("Windows"),
// }},
// },
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { ContainerServiceClient } = require("@azure/arm-containerservice");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Gets supported OS options in the specified subscription.
*
* @summary Gets supported OS options in the specified subscription.
* x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-02-01/examples/ContainerServiceGetOSOptions.json
*/
async function getContainerServiceOSOptions() {
const subscriptionId =
process.env["CONTAINERSERVICE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000";
const location = "location1";
const credential = new DefaultAzureCredential();
const client = new ContainerServiceClient(credential, subscriptionId);
const result = await client.managedClusters.getOSOptions(location);
console.log(result);
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
Sample Response
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/location1/osOptions/default",
"name": "default",
"type": "Microsoft.ContainerService/locations/osOptions",
"properties": {
"osOptionPropertyList": [
{
"os-type": "Linux",
"enable-fips-image": false
},
{
"os-type": "Windows",
"enable-fips-image": false
}
]
}
}
Définitions
CloudError
Réponse d’erreur du service conteneur.
CloudErrorBody
Réponse d’erreur du service conteneur.
Nom |
Type |
Description |
code
|
string
|
Identificateur de l'erreur. Les codes sont invariants et sont destinés à être consommés par programmation.
|
details
|
CloudErrorBody[]
|
Liste de détails supplémentaires sur l’erreur.
|
message
|
string
|
Message décrivant l’erreur, destiné à être adapté à l’affichage dans une interface utilisateur.
|
target
|
string
|
Cible de l’erreur particulière. Par exemple, le nom de la propriété en erreur.
|
OSOptionProfile
Profil d’option du système d’exploitation.
Nom |
Type |
Description |
id
|
string
|
ID de la ressource d’option de système d’exploitation.
|
name
|
string
|
Nom de la ressource d’option de système d’exploitation.
|
properties.osOptionPropertyList
|
OSOptionProperty[]
|
Liste des options du système d’exploitation.
|
type
|
string
|
Type de la ressource d’option de système d’exploitation.
|
OSOptionProperty
Propriété d’option du système d’exploitation.
Nom |
Type |
Description |
enable-fips-image
|
boolean
|
Indique si l’image est activée pour FIPS.
|
os-type
|
string
|
Type de système d’exploitation.
|