지정된 컨테이너 레지스트리에 대한 로그인 자격 증명을 나열합니다.
POST https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/listCredentials?api-version=2023-01-01-preview
URI 매개 변수
Name |
In(다음 안에) |
필수 |
형식 |
Description |
registryName
|
path |
True
|
string
|
컨테이너 레지스트리의 이름입니다.
regex 패턴: ^[a-zA-Z0-9]*$
|
resourceGroupName
|
path |
True
|
string
|
리소스 그룹의 이름. 이름은 대소문자를 구분하지 않습니다.
|
subscriptionId
|
path |
True
|
string
uuid
|
대상 구독의 ID입니다. 값은 UUID여야 합니다.
|
api-version
|
query |
True
|
string
|
이 작업에 사용할 API 버전입니다.
|
응답
보안
azure_auth
Azure Active Directory OAuth2 Flow
형식:
oauth2
Flow:
implicit
권한 부여 URL:
https://login.microsoftonline.com/common/oauth2/authorize
범위
Name |
Description |
user_impersonation
|
사용자 계정 가장
|
예제
RegistryListCredentials
샘플 요청
POST https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.ContainerRegistry/registries/myRegistry/listCredentials?api-version=2023-01-01-preview
package armcontainerregistry_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/containerregistry/armcontainerregistry"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/969fd0c2634fbcc1975d7abe3749330a5145a97c/specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-01-01-preview/examples/RegistryListCredentials.json
func ExampleRegistriesClient_ListCredentials() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armcontainerregistry.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewRegistriesClient().ListCredentials(ctx, "myResourceGroup", "myRegistry", 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.RegistryListCredentialsResult = armcontainerregistry.RegistryListCredentialsResult{
// Passwords: []*armcontainerregistry.RegistryPassword{
// {
// Name: to.Ptr(armcontainerregistry.PasswordNamePassword),
// Value: to.Ptr("00000000000000000000000000000000"),
// },
// {
// Name: to.Ptr(armcontainerregistry.PasswordNamePassword2),
// Value: to.Ptr("00000000000000000000000000000000"),
// }},
// Username: to.Ptr("myRegistry"),
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { ContainerRegistryManagementClient } = require("@azure/arm-containerregistry");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to Lists the login credentials for the specified container registry.
*
* @summary Lists the login credentials for the specified container registry.
* x-ms-original-file: specification/containerregistry/resource-manager/Microsoft.ContainerRegistry/preview/2023-01-01-preview/examples/RegistryListCredentials.json
*/
async function registryListCredentials() {
const subscriptionId =
process.env["CONTAINERREGISTRY_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000";
const resourceGroupName = process.env["CONTAINERREGISTRY_RESOURCE_GROUP"] || "myResourceGroup";
const registryName = "myRegistry";
const credential = new DefaultAzureCredential();
const client = new ContainerRegistryManagementClient(credential, subscriptionId);
const result = await client.registries.listCredentials(resourceGroupName, registryName);
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
샘플 응답
{
"username": "myRegistry",
"passwords": [
{
"name": "password",
"value": "00000000000000000000000000000000"
},
{
"name": "password2",
"value": "00000000000000000000000000000000"
}
]
}
정의
PasswordName
암호 이름입니다.
Name |
형식 |
Description |
password
|
string
|
|
password2
|
string
|
|
RegistryListCredentialsResult
ListCredentials 작업의 응답입니다.
Name |
형식 |
Description |
passwords
|
RegistryPassword[]
|
컨테이너 레지스트리의 암호 목록입니다.
|
username
|
string
|
컨테이너 레지스트리의 사용자 이름입니다.
|
RegistryPassword
컨테이너 레지스트리의 로그인 암호입니다.
Name |
형식 |
Description |
name
|
PasswordName
|
암호 이름입니다.
|
value
|
string
|
암호 값입니다.
|