List the admin credentials for the private cloud
POST https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/listAdminCredentials?api-version=2023-09-01
URI Parameters
Name |
In |
Required |
Type |
Description |
privateCloudName
|
path |
True
|
string
|
Name of the private cloud
Regex pattern: ^[-\w\._]+$
|
resourceGroupName
|
path |
True
|
string
|
The name of the resource group. The name is case insensitive.
|
subscriptionId
|
path |
True
|
string
uuid
|
The ID of the target subscription. The value must be an UUID.
|
api-version
|
query |
True
|
string
|
The API version to use for this operation.
|
Responses
Name |
Type |
Description |
200 OK
|
AdminCredentials
|
Azure operation completed successfully.
|
Other Status Codes
|
ErrorResponse
|
An unexpected error response.
|
Security
azure_auth
Azure Active Directory OAuth2 Flow.
Type:
oauth2
Flow:
implicit
Authorization URL:
https://login.microsoftonline.com/common/oauth2/authorize
Scopes
Name |
Description |
user_impersonation
|
impersonate your user account
|
Examples
PrivateClouds_ListAdminCredentials
Sample request
POST https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/listAdminCredentials?api-version=2023-09-01
/**
* Samples for PrivateClouds ListAdminCredentials.
*/
public final class Main {
/*
* x-ms-original-file:
* specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/PrivateClouds_ListAdminCredentials
* .json
*/
/**
* Sample code: PrivateClouds_ListAdminCredentials.
*
* @param manager Entry point to AvsManager.
*/
public static void privateCloudsListAdminCredentials(com.azure.resourcemanager.avs.AvsManager manager) {
manager.privateClouds().listAdminCredentialsWithResponse("group1", "cloud1", 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.avs import AVSClient
"""
# PREREQUISITES
pip install azure-identity
pip install azure-mgmt-avs
# USAGE
python private_clouds_list_admin_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 = AVSClient(
credential=DefaultAzureCredential(),
subscription_id="00000000-0000-0000-0000-000000000000",
)
response = client.private_clouds.list_admin_credentials(
resource_group_name="group1",
private_cloud_name="cloud1",
)
print(response)
# x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/PrivateClouds_ListAdminCredentials.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 armavs_test
import (
"context"
"log"
"github.com/Azure/azure-sdk-for-go/sdk/azidentity"
"github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/avs/armavs/v2"
)
// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/9f9d14b5db982b1d554651348adc9bef4b098bdb/specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/PrivateClouds_ListAdminCredentials.json
func ExamplePrivateCloudsClient_ListAdminCredentials() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armavs.NewClientFactory("<subscription-id>", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
res, err := clientFactory.NewPrivateCloudsClient().ListAdminCredentials(ctx, "group1", "cloud1", 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.AdminCredentials = armavs.AdminCredentials{
// NsxtPassword: to.Ptr("$(1X4Dkk"),
// NsxtUsername: to.Ptr("admin"),
// VcenterPassword: to.Ptr("<vcenterPassword>"),
// VcenterUsername: to.Ptr("cloudadmin@vsphere.local"),
// }
}
To use the Azure SDK library in your project, see this documentation. To provide feedback on this code sample, open a GitHub issue
const { AzureVMwareSolutionAPI } = require("@azure/arm-avs");
const { DefaultAzureCredential } = require("@azure/identity");
/**
* This sample demonstrates how to List the admin credentials for the private cloud
*
* @summary List the admin credentials for the private cloud
* x-ms-original-file: specification/vmware/resource-manager/Microsoft.AVS/stable/2023-09-01/examples/PrivateClouds_ListAdminCredentials.json
*/
async function privateCloudsListAdminCredentials() {
const subscriptionId =
process.env["AVS_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000";
const resourceGroupName = process.env["AVS_RESOURCE_GROUP"] || "group1";
const privateCloudName = "cloud1";
const credential = new DefaultAzureCredential();
const client = new AzureVMwareSolutionAPI(credential, subscriptionId);
const result = await client.privateClouds.listAdminCredentials(
resourceGroupName,
privateCloudName,
);
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
{
"nsxtPassword": "$(1X4Dkk",
"nsxtUsername": "admin",
"vcenterPassword": "<vcenterPassword>",
"vcenterUsername": "cloudadmin@vsphere.local"
}
Definitions
AdminCredentials
Administrative credentials for accessing vCenter and NSX-T
Name |
Type |
Description |
nsxtPassword
|
string
|
NSX-T Manager password
|
nsxtUsername
|
string
|
NSX-T Manager username
|
vcenterPassword
|
string
|
vCenter admin password
|
vcenterUsername
|
string
|
vCenter admin username
|
ErrorAdditionalInfo
The resource management error additional info.
Name |
Type |
Description |
info
|
object
|
The additional info.
|
type
|
string
|
The additional info type.
|
ErrorDetail
The error detail.
Name |
Type |
Description |
additionalInfo
|
ErrorAdditionalInfo[]
|
The error additional info.
|
code
|
string
|
The error code.
|
details
|
ErrorDetail[]
|
The error details.
|
message
|
string
|
The error message.
|
target
|
string
|
The error target.
|
ErrorResponse
Error response
Name |
Type |
Description |
error
|
ErrorDetail
|
The error object.
|