Obraca certyfikaty klastra zarządzanego.
Zobacz rotacji certyfikatów, aby uzyskać więcej informacji na temat rotacji certyfikatów klastra zarządzanego.
POST https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates?api-version=2024-09-01
Parametry identyfikatora URI
Nazwa |
W |
Wymagane |
Typ |
Opis |
resourceGroupName
|
path |
True
|
string
|
Nazwa grupy zasobów. Nazwa jest niewrażliwa na wielkość liter.
|
resourceName
|
path |
True
|
string
|
Nazwa zasobu klastra zarządzanego.
Wzorzec wyrażenia regularnego: ^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$
|
subscriptionId
|
path |
True
|
string
uuid
|
Identyfikator subskrypcji docelowej. Wartość musi być identyfikatorem UUID.
|
api-version
|
query |
True
|
string
|
Wersja interfejsu API do użycia dla tej operacji.
|
Odpowiedzi
Nazwa |
Typ |
Opis |
202 Accepted
|
|
Akceptowane
Nagłówki
Location: string
|
204 No Content
|
|
NoContent
|
Other Status Codes
|
CloudError
|
Odpowiedź na błąd opisująca, dlaczego operacja nie powiodła się. Jeśli klaster nie istnieje, zostanie zwrócony błąd 404 (nie znaleziono).
|
Zabezpieczenia
azure_auth
Przepływ protokołu OAuth2 usługi Azure Active Directory
Typ:
oauth2
Flow:
implicit
Adres URL autoryzacji:
https://login.microsoftonline.com/common/oauth2/authorize
Zakresy
Nazwa |
Opis |
user_impersonation
|
personifikacja konta użytkownika
|
Przykłady
Rotate Cluster Certificates
Przykładowe żądanie
POST https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/rotateClusterCertificates?api-version=2024-09-01
/**
* Samples for ManagedClusters RotateClusterCertificates.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/
* ManagedClustersRotateClusterCertificates.json
*/
/**
* Sample code: Rotate Cluster Certificates.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void rotateClusterCertificates(com.azure.resourcemanager.AzureResourceManager azure) {
azure.kubernetesClusters().manager().serviceClient().getManagedClusters().rotateClusterCertificates("rg1",
"clustername1", 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 managed_clusters_rotate_cluster_certificates.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",
)
client.managed_clusters.begin_rotate_cluster_certificates(
resource_group_name="rg1",
resource_name="clustername1",
).result()
# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/ManagedClustersRotateClusterCertificates.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/v6"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/e838027e88cca634c1545e744630de9262a6e72a/specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/ManagedClustersRotateClusterCertificates.json
func ExampleManagedClustersClient_BeginRotateClusterCertificates() {
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)
}
poller, err := clientFactory.NewManagedClustersClient().BeginRotateClusterCertificates(ctx, "rg1", "clustername1", nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
_, err = poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %v", err)
}
}
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 See [Certificate rotation](https://docs.microsoft.com/azure/aks/certificate-rotation) for more details about rotating managed cluster certificates.
*
* @summary See [Certificate rotation](https://docs.microsoft.com/azure/aks/certificate-rotation) for more details about rotating managed cluster certificates.
* x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-09-01/examples/ManagedClustersRotateClusterCertificates.json
*/
async function rotateClusterCertificates() {
const subscriptionId =
process.env["CONTAINERSERVICE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000";
const resourceGroupName = process.env["CONTAINERSERVICE_RESOURCE_GROUP"] || "rg1";
const resourceName = "clustername1";
const credential = new DefaultAzureCredential();
const client = new ContainerServiceClient(credential, subscriptionId);
const result = await client.managedClusters.beginRotateClusterCertificatesAndWait(
resourceGroupName,
resourceName,
);
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
Przykładowa odpowiedź
location: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/eastus/operationresults/00000000-0000-0000-0000-000000000000?api-version=2017-08-31
Definicje
Nazwa |
Opis |
CloudError
|
Odpowiedź na błąd z usługi Container Service.
|
CloudErrorBody
|
Odpowiedź na błąd z usługi Container Service.
|
CloudError
Odpowiedź na błąd z usługi Container Service.
CloudErrorBody
Odpowiedź na błąd z usługi Container Service.
Nazwa |
Typ |
Opis |
code
|
string
|
Identyfikator błędu. Kody są niezmienne i mają być używane programowo.
|
details
|
CloudErrorBody[]
|
Lista dodatkowych szczegółów dotyczących błędu.
|
message
|
string
|
Komunikat opisujący błąd, który ma być odpowiedni do wyświetlania w interfejsie użytkownika.
|
target
|
string
|
Element docelowy określonego błędu. Na przykład nazwa właściwości w błędzie.
|