Lists kredensial pengguna pemantauan kluster dari kluster terkelola.
POST https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterMonitoringUserCredential?api-version=2024-02-01
With optional parameters:
POST https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/listClusterMonitoringUserCredential?api-version=2024-02-01&server-fqdn={server-fqdn}
Parameter URI
Nama |
Dalam |
Diperlukan |
Jenis |
Deskripsi |
resourceGroupName
|
path |
True
|
string
|
Nama grup sumber daya. Nama tidak peka huruf besar/kecil.
|
resourceName
|
path |
True
|
string
|
Nama sumber daya kluster terkelola.
Regex pattern: ^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$
|
subscriptionId
|
path |
True
|
string
uuid
|
ID langganan target. Nilai harus UUID.
|
api-version
|
query |
True
|
string
|
Versi API yang digunakan untuk operasi ini.
|
server-fqdn
|
query |
|
string
|
jenis fqdn server untuk kredensial yang akan dikembalikan
|
Respons
Nama |
Jenis |
Deskripsi |
200 OK
|
CredentialResults
|
OK
|
Other Status Codes
|
CloudError
|
Respons kesalahan yang menjelaskan mengapa operasi gagal.
|
Keamanan
azure_auth
Alur OAuth2 Azure Active Directory
Type:
oauth2
Flow:
implicit
Authorization URL:
https://login.microsoftonline.com/common/oauth2/authorize
Scopes
Nama |
Deskripsi |
user_impersonation
|
meniru akun pengguna Anda
|
Contoh
Get Managed Cluster
Sample Request
POST https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg1/providers/Microsoft.ContainerService/managedClusters/clustername1/listClusterMonitoringUserCredential?api-version=2024-02-01
/**
* Samples for ManagedClusters ListClusterMonitoringUserCredentials.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-02-01/examples/
* ManagedClustersListClusterMonitoringUserCredentials.json
*/
/**
* Sample code: Get Managed Cluster.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/
public static void getManagedCluster(com.azure.resourcemanager.AzureResourceManager azure) {
azure.kubernetesClusters().manager().serviceClient().getManagedClusters()
.listClusterMonitoringUserCredentialsWithResponse("rg1", "clustername1", 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 managed_clusters_list_cluster_monitoring_user_credentials.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.list_cluster_monitoring_user_credentials(
resource_group_name="rg1",
resource_name="clustername1",
)
print(response)
# x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-02-01/examples/ManagedClustersListClusterMonitoringUserCredentials.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/ManagedClustersListClusterMonitoringUserCredentials.json
func ExampleManagedClustersClient_ListClusterMonitoringUserCredentials() {
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().ListClusterMonitoringUserCredentials(ctx, "rg1", "clustername1", &armcontainerservice.ManagedClustersClientListClusterMonitoringUserCredentialsOptions{ServerFqdn: 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.CredentialResults = armcontainerservice.CredentialResults{
// Kubeconfigs: []*armcontainerservice.CredentialResult{
// {
// Name: to.Ptr("credentialName1"),
// Value: []byte("Y3JlZGVudGlhbFZhbHVlMQ=="),
// }},
// }
}
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 Lists the cluster monitoring user credentials of a managed cluster.
*
* @summary Lists the cluster monitoring user credentials of a managed cluster.
* x-ms-original-file: specification/containerservice/resource-manager/Microsoft.ContainerService/aks/stable/2024-02-01/examples/ManagedClustersListClusterMonitoringUserCredentials.json
*/
async function getManagedCluster() {
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.listClusterMonitoringUserCredentials(
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
Sample Response
{
"kubeconfigs": [
{
"name": "credentialName1",
"value": "Y3JlZGVudGlhbFZhbHVlMQ=="
}
]
}
Definisi
CloudError
Respons kesalahan dari layanan Kontainer.
CloudErrorBody
Respons kesalahan dari layanan Kontainer.
Nama |
Jenis |
Deskripsi |
code
|
string
|
Pengidentifikasi untuk kesalahan. Kode tidak berubah dan dimaksudkan untuk dikonsumsi secara terprogram.
|
details
|
CloudErrorBody[]
|
Daftar detail tambahan tentang kesalahan.
|
message
|
string
|
Pesan yang menjelaskan kesalahan, dimaksudkan agar cocok untuk ditampilkan di antarmuka pengguna.
|
target
|
string
|
Target kesalahan tertentu. Misalnya, nama properti dalam kesalahan.
|
CredentialResult
Respons hasil kredensial.
Nama |
Jenis |
Deskripsi |
name
|
string
|
Nama kredensial.
|
value
|
string
|
File konfigurasi Kubernetes yang dikodekan Base64.
|
CredentialResults
Respons hasil kredensial daftar.
Nama |
Jenis |
Deskripsi |
kubeconfigs
|
CredentialResult[]
|
File konfigurasi Kubernetes yang dikodekan Base64.
|