Skapa ett tillägg
PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AVS/privateClouds/{privateCloudName}/addons/{addonName}?api-version=2025-09-01
URI-parametrar
| Namn |
I |
Krävs |
Typ |
Beskrivning |
|
addonName
|
path |
True
|
string
pattern: ^[-\w\._]+$
|
Namnet på tillägget.
|
|
privateCloudName
|
path |
True
|
string
pattern: ^[-\w\._]+$
|
Namnet på det privata molnet
|
|
resourceGroupName
|
path |
True
|
string
minLength: 1 maxLength: 90
|
Namnet på resursgruppen. Namnet är skiftlägesokänsligt.
|
|
subscriptionId
|
path |
True
|
string
(uuid)
|
ID för målprenumerationen. Värdet måste vara ett UUID.
|
|
api-version
|
query |
True
|
string
minLength: 1
|
Den API-version som ska användas för den här åtgärden.
|
Begäranarorgan
| Namn |
Typ |
Beskrivning |
|
properties
|
AddonProperties:
|
Resursspecifika egenskaper för den här resursen.
|
Svaren
| Namn |
Typ |
Beskrivning |
|
200 OK
|
Addon
|
Resursens uppdateringsåtgärd "Addon" har slutförts
|
|
201 Created
|
Addon
|
Resursen Addon-skapandeåtgärden lyckades
Headers
Retry-After: integer
|
|
Other Status Codes
|
ErrorResponse
|
Ett oväntat felsvar.
|
Säkerhet
azure_auth
Azure Active Directory OAuth2-flöde.
Typ:
oauth2
Rinna:
implicit
Auktorisations-URL:
https://login.microsoftonline.com/common/oauth2/authorize
Scope
| Namn |
Beskrivning |
|
user_impersonation
|
personifiera ditt användarkonto
|
Exempel
Addons_CreateOrUpdate_ArcReg
Exempelförfrågan
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/addons/arc?api-version=2025-09-01
{
"properties": {
"addonType": "Arc",
"vCenter": "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg_test/providers/Microsoft.ConnectedVMwarevSphere/VCenters/test-vcenter"
}
}
import com.azure.resourcemanager.avs.models.AddonArcProperties;
/**
* Samples for Addons CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file: 2025-09-01/Addons_CreateOrUpdate_ArcReg.json
*/
/**
* Sample code: Addons_CreateOrUpdate_ArcReg.
*
* @param manager Entry point to AvsManager.
*/
public static void addonsCreateOrUpdateArcReg(com.azure.resourcemanager.avs.AvsManager manager) {
manager.addons().define("arc").withExistingPrivateCloud("group1", "cloud1")
.withProperties(new AddonArcProperties().withVCenter(
"subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg_test/providers/Microsoft.ConnectedVMwarevSphere/VCenters/test-vcenter"))
.create();
}
}
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 addons_create_or_update_arc_reg.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="SUBSCRIPTION_ID",
)
response = client.addons.begin_create_or_update(
resource_group_name="group1",
private_cloud_name="cloud1",
addon_name="arc",
addon={
"properties": {
"addonType": "Arc",
"vCenter": "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg_test/providers/Microsoft.ConnectedVMwarevSphere/VCenters/test-vcenter",
}
},
).result()
print(response)
# x-ms-original-file: 2025-09-01/Addons_CreateOrUpdate_ArcReg.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/azcore/to"
"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: 2025-09-01/Addons_CreateOrUpdate_ArcReg.json
func ExampleAddonsClient_BeginCreateOrUpdate_addonsCreateOrUpdateArcReg() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armavs.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewAddonsClient().BeginCreateOrUpdate(ctx, "group1", "cloud1", "arc", armavs.Addon{
Properties: &armavs.AddonArcProperties{
AddonType: to.Ptr(armavs.AddonTypeArc),
VCenter: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg_test/providers/Microsoft.ConnectedVMwarevSphere/VCenters/test-vcenter"),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %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 = armavs.AddonsClientCreateOrUpdateResponse{
// Addon: &armavs.Addon{
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/addons/arc"),
// Name: to.Ptr("arc"),
// Properties: &armavs.AddonArcProperties{
// AddonType: to.Ptr(armavs.AddonTypeArc),
// VCenter: to.Ptr("subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg_test/providers/Microsoft.ConnectedVMwarevSphere/VCenters/test-vcenter"),
// ProvisioningState: to.Ptr(armavs.AddonProvisioningStateSucceeded),
// },
// Type: to.Ptr("Microsoft.AVS/privateClouds/addons"),
// },
// }
}
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 create a Addon
*
* @summary create a Addon
* x-ms-original-file: 2025-09-01/Addons_CreateOrUpdate_ArcReg.json
*/
async function addonsCreateOrUpdateArcReg() {
const credential = new DefaultAzureCredential();
const subscriptionId = "00000000-0000-0000-0000-000000000000";
const client = new AzureVMwareSolutionAPI(credential, subscriptionId);
const result = await client.addons.createOrUpdate("group1", "cloud1", "arc", {
properties: {
addonType: "Arc",
vCenter:
"subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg_test/providers/Microsoft.ConnectedVMwarevSphere/VCenters/test-vcenter",
},
});
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
Exempelsvar
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/addons/arc",
"name": "arc",
"properties": {
"addonType": "Arc",
"vCenter": "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg_test/providers/Microsoft.ConnectedVMwarevSphere/VCenters/test-vcenter",
"provisioningState": "Succeeded"
},
"type": "Microsoft.AVS/privateClouds/addons"
}
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/addons/arc",
"name": "arc",
"properties": {
"addonType": "Arc",
"vCenter": "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg_test/providers/Microsoft.ConnectedVMwarevSphere/VCenters/test-vcenter",
"provisioningState": "Succeeded"
},
"type": "Microsoft.AVS/privateClouds/addons"
}
Addons_CreateOrUpdate_HCX
Exempelförfrågan
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/addons/hcx?api-version=2025-09-01
{
"properties": {
"addonType": "HCX",
"offer": "VMware MaaS Cloud Provider (Enterprise)"
}
}
import com.azure.resourcemanager.avs.models.AddonHcxProperties;
/**
* Samples for Addons CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file: 2025-09-01/Addons_CreateOrUpdate_HCX.json
*/
/**
* Sample code: Addons_CreateOrUpdate_HCX.
*
* @param manager Entry point to AvsManager.
*/
public static void addonsCreateOrUpdateHCX(com.azure.resourcemanager.avs.AvsManager manager) {
manager.addons().define("hcx").withExistingPrivateCloud("group1", "cloud1")
.withProperties(new AddonHcxProperties().withOffer("VMware MaaS Cloud Provider (Enterprise)")).create();
}
}
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 addons_create_or_update_hcx.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="SUBSCRIPTION_ID",
)
response = client.addons.begin_create_or_update(
resource_group_name="group1",
private_cloud_name="cloud1",
addon_name="hcx",
addon={"properties": {"addonType": "HCX", "offer": "VMware MaaS Cloud Provider (Enterprise)"}},
).result()
print(response)
# x-ms-original-file: 2025-09-01/Addons_CreateOrUpdate_HCX.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/azcore/to"
"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: 2025-09-01/Addons_CreateOrUpdate_HCX.json
func ExampleAddonsClient_BeginCreateOrUpdate_addonsCreateOrUpdateHcx() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armavs.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewAddonsClient().BeginCreateOrUpdate(ctx, "group1", "cloud1", "hcx", armavs.Addon{
Properties: &armavs.AddonHcxProperties{
AddonType: to.Ptr(armavs.AddonTypeHCX),
Offer: to.Ptr("VMware MaaS Cloud Provider (Enterprise)"),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %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 = armavs.AddonsClientCreateOrUpdateResponse{
// Addon: &armavs.Addon{
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/addons/hcx"),
// Name: to.Ptr("hcx"),
// Properties: &armavs.AddonHcxProperties{
// AddonType: to.Ptr(armavs.AddonTypeHCX),
// Offer: to.Ptr("VMware MaaS Cloud Provider (Enterprise)"),
// ProvisioningState: to.Ptr(armavs.AddonProvisioningStateSucceeded),
// },
// Type: to.Ptr("Microsoft.AVS/privateClouds/addons"),
// },
// }
}
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 create a Addon
*
* @summary create a Addon
* x-ms-original-file: 2025-09-01/Addons_CreateOrUpdate_HCX.json
*/
async function addonsCreateOrUpdateHCX() {
const credential = new DefaultAzureCredential();
const subscriptionId = "00000000-0000-0000-0000-000000000000";
const client = new AzureVMwareSolutionAPI(credential, subscriptionId);
const result = await client.addons.createOrUpdate("group1", "cloud1", "hcx", {
properties: { addonType: "HCX", offer: "VMware MaaS Cloud Provider (Enterprise)" },
});
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
Exempelsvar
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/addons/hcx",
"name": "hcx",
"properties": {
"addonType": "HCX",
"offer": "VMware MaaS Cloud Provider (Enterprise)",
"provisioningState": "Succeeded"
},
"type": "Microsoft.AVS/privateClouds/addons"
}
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/addons/hcx",
"name": "hcx",
"properties": {
"addonType": "HCX",
"offer": "VMware MaaS Cloud Provider (Enterprise)",
"provisioningState": "Updating"
},
"type": "Microsoft.AVS/privateClouds/addons"
}
Addons_CreateOrUpdate_HCX_With_Networks
Exempelförfrågan
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/addons/hcx?api-version=2025-09-01
{
"properties": {
"addonType": "HCX",
"offer": "VMware MaaS Cloud Provider (Enterprise)",
"managementNetwork": "10.3.1.0/24",
"uplinkNetwork": "10.3.2.0/24"
}
}
import com.azure.resourcemanager.avs.models.AddonHcxProperties;
/**
* Samples for Addons CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file: 2025-09-01/Addons_CreateOrUpdate_HCX_With_Networks.json
*/
/**
* Sample code: Addons_CreateOrUpdate_HCX_With_Networks.
*
* @param manager Entry point to AvsManager.
*/
public static void addonsCreateOrUpdateHCXWithNetworks(com.azure.resourcemanager.avs.AvsManager manager) {
manager.addons().define("hcx").withExistingPrivateCloud("group1", "cloud1")
.withProperties(new AddonHcxProperties().withOffer("VMware MaaS Cloud Provider (Enterprise)")
.withManagementNetwork("10.3.1.0/24").withUplinkNetwork("10.3.2.0/24"))
.create();
}
}
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 addons_create_or_update_hcx_with_networks.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="SUBSCRIPTION_ID",
)
response = client.addons.begin_create_or_update(
resource_group_name="group1",
private_cloud_name="cloud1",
addon_name="hcx",
addon={
"properties": {
"addonType": "HCX",
"managementNetwork": "10.3.1.0/24",
"offer": "VMware MaaS Cloud Provider (Enterprise)",
"uplinkNetwork": "10.3.2.0/24",
}
},
).result()
print(response)
# x-ms-original-file: 2025-09-01/Addons_CreateOrUpdate_HCX_With_Networks.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/azcore/to"
"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: 2025-09-01/Addons_CreateOrUpdate_HCX_With_Networks.json
func ExampleAddonsClient_BeginCreateOrUpdate_addonsCreateOrUpdateHcxWithNetworks() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armavs.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewAddonsClient().BeginCreateOrUpdate(ctx, "group1", "cloud1", "hcx", armavs.Addon{
Properties: &armavs.AddonHcxProperties{
AddonType: to.Ptr(armavs.AddonTypeHCX),
Offer: to.Ptr("VMware MaaS Cloud Provider (Enterprise)"),
ManagementNetwork: to.Ptr("10.3.1.0/24"),
UplinkNetwork: to.Ptr("10.3.2.0/24"),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %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 = armavs.AddonsClientCreateOrUpdateResponse{
// Addon: &armavs.Addon{
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/addons/hcx"),
// Name: to.Ptr("hcx"),
// Properties: &armavs.AddonHcxProperties{
// AddonType: to.Ptr(armavs.AddonTypeHCX),
// Offer: to.Ptr("VMware MaaS Cloud Provider (Enterprise)"),
// ManagementNetwork: to.Ptr("10.3.1.0/24"),
// UplinkNetwork: to.Ptr("10.3.2.0/24"),
// ProvisioningState: to.Ptr(armavs.AddonProvisioningStateSucceeded),
// },
// Type: to.Ptr("Microsoft.AVS/privateClouds/addons"),
// },
// }
}
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 create a Addon
*
* @summary create a Addon
* x-ms-original-file: 2025-09-01/Addons_CreateOrUpdate_HCX_With_Networks.json
*/
async function addonsCreateOrUpdateHCXWithNetworks() {
const credential = new DefaultAzureCredential();
const subscriptionId = "00000000-0000-0000-0000-000000000000";
const client = new AzureVMwareSolutionAPI(credential, subscriptionId);
const result = await client.addons.createOrUpdate("group1", "cloud1", "hcx", {
properties: {
addonType: "HCX",
offer: "VMware MaaS Cloud Provider (Enterprise)",
managementNetwork: "10.3.1.0/24",
uplinkNetwork: "10.3.2.0/24",
},
});
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
Exempelsvar
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/addons/hcx",
"name": "hcx",
"properties": {
"addonType": "HCX",
"offer": "VMware MaaS Cloud Provider (Enterprise)",
"managementNetwork": "10.3.1.0/24",
"uplinkNetwork": "10.3.2.0/24",
"provisioningState": "Succeeded"
},
"type": "Microsoft.AVS/privateClouds/addons"
}
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/addons/hcx",
"name": "hcx",
"properties": {
"addonType": "HCX",
"offer": "VMware MaaS Cloud Provider (Enterprise)",
"managementNetwork": "10.3.1.0/24",
"uplinkNetwork": "10.3.2.0/24",
"provisioningState": "Updating"
},
"type": "Microsoft.AVS/privateClouds/addons"
}
Addons_CreateOrUpdate_SRM
Exempelförfrågan
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/addons/srm?api-version=2025-09-01
{
"properties": {
"addonType": "SRM",
"licenseKey": "41915178-A8FF-4A4D-B683-6D735AF5E3F5"
}
}
import com.azure.resourcemanager.avs.models.AddonSrmProperties;
/**
* Samples for Addons CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file: 2025-09-01/Addons_CreateOrUpdate_SRM.json
*/
/**
* Sample code: Addons_CreateOrUpdate_SRM.
*
* @param manager Entry point to AvsManager.
*/
public static void addonsCreateOrUpdateSRM(com.azure.resourcemanager.avs.AvsManager manager) {
manager.addons().define("srm").withExistingPrivateCloud("group1", "cloud1")
.withProperties(new AddonSrmProperties().withLicenseKey("fakeTokenPlaceholder")).create();
}
}
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 addons_create_or_update_srm.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="SUBSCRIPTION_ID",
)
response = client.addons.begin_create_or_update(
resource_group_name="group1",
private_cloud_name="cloud1",
addon_name="srm",
addon={"properties": {"addonType": "SRM", "licenseKey": "41915178-A8FF-4A4D-B683-6D735AF5E3F5"}},
).result()
print(response)
# x-ms-original-file: 2025-09-01/Addons_CreateOrUpdate_SRM.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/azcore/to"
"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: 2025-09-01/Addons_CreateOrUpdate_SRM.json
func ExampleAddonsClient_BeginCreateOrUpdate_addonsCreateOrUpdateSrm() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armavs.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewAddonsClient().BeginCreateOrUpdate(ctx, "group1", "cloud1", "srm", armavs.Addon{
Properties: &armavs.AddonSrmProperties{
AddonType: to.Ptr(armavs.AddonTypeSRM),
LicenseKey: to.Ptr("41915178-A8FF-4A4D-B683-6D735AF5E3F5"),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %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 = armavs.AddonsClientCreateOrUpdateResponse{
// Addon: &armavs.Addon{
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/addons/srm"),
// Name: to.Ptr("srm"),
// Properties: &armavs.AddonSrmProperties{
// AddonType: to.Ptr(armavs.AddonTypeSRM),
// LicenseKey: to.Ptr("41915178-A8FF-4A4D-B683-6D735AF5E3F5"),
// ProvisioningState: to.Ptr(armavs.AddonProvisioningStateSucceeded),
// },
// Type: to.Ptr("Microsoft.AVS/privateClouds/addons"),
// },
// }
}
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 create a Addon
*
* @summary create a Addon
* x-ms-original-file: 2025-09-01/Addons_CreateOrUpdate_SRM.json
*/
async function addonsCreateOrUpdateSRM() {
const credential = new DefaultAzureCredential();
const subscriptionId = "00000000-0000-0000-0000-000000000000";
const client = new AzureVMwareSolutionAPI(credential, subscriptionId);
const result = await client.addons.createOrUpdate("group1", "cloud1", "srm", {
properties: { addonType: "SRM", licenseKey: "41915178-A8FF-4A4D-B683-6D735AF5E3F5" },
});
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
Exempelsvar
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/addons/srm",
"name": "srm",
"properties": {
"addonType": "SRM",
"licenseKey": "41915178-A8FF-4A4D-B683-6D735AF5E3F5",
"provisioningState": "Succeeded"
},
"type": "Microsoft.AVS/privateClouds/addons"
}
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/addons/srm",
"name": "srm",
"properties": {
"addonType": "SRM",
"licenseKey": "41915178-A8FF-4A4D-B683-6D735AF5E3F5",
"provisioningState": "Updating"
},
"type": "Microsoft.AVS/privateClouds/addons"
}
Addons_CreateOrUpdate_VR
Exempelförfrågan
PUT https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/addons/vr?api-version=2025-09-01
{
"properties": {
"addonType": "VR",
"vrsCount": 1
}
}
import com.azure.resourcemanager.avs.models.AddonVrProperties;
/**
* Samples for Addons CreateOrUpdate.
*/
public final class Main {
/*
* x-ms-original-file: 2025-09-01/Addons_CreateOrUpdate_VR.json
*/
/**
* Sample code: Addons_CreateOrUpdate_VR.
*
* @param manager Entry point to AvsManager.
*/
public static void addonsCreateOrUpdateVR(com.azure.resourcemanager.avs.AvsManager manager) {
manager.addons().define("vr").withExistingPrivateCloud("group1", "cloud1")
.withProperties(new AddonVrProperties().withVrsCount(1)).create();
}
}
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 addons_create_or_update_vr.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="SUBSCRIPTION_ID",
)
response = client.addons.begin_create_or_update(
resource_group_name="group1",
private_cloud_name="cloud1",
addon_name="vr",
addon={"properties": {"addonType": "VR", "vrsCount": 1}},
).result()
print(response)
# x-ms-original-file: 2025-09-01/Addons_CreateOrUpdate_VR.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/azcore/to"
"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: 2025-09-01/Addons_CreateOrUpdate_VR.json
func ExampleAddonsClient_BeginCreateOrUpdate_addonsCreateOrUpdateVr() {
cred, err := azidentity.NewDefaultAzureCredential(nil)
if err != nil {
log.Fatalf("failed to obtain a credential: %v", err)
}
ctx := context.Background()
clientFactory, err := armavs.NewClientFactory("00000000-0000-0000-0000-000000000000", cred, nil)
if err != nil {
log.Fatalf("failed to create client: %v", err)
}
poller, err := clientFactory.NewAddonsClient().BeginCreateOrUpdate(ctx, "group1", "cloud1", "vr", armavs.Addon{
Properties: &armavs.AddonVrProperties{
AddonType: to.Ptr(armavs.AddonTypeVR),
VrsCount: to.Ptr[int32](1),
},
}, nil)
if err != nil {
log.Fatalf("failed to finish the request: %v", err)
}
res, err := poller.PollUntilDone(ctx, nil)
if err != nil {
log.Fatalf("failed to pull the result: %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 = armavs.AddonsClientCreateOrUpdateResponse{
// Addon: &armavs.Addon{
// ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/addons/vr"),
// Name: to.Ptr("vr"),
// Properties: &armavs.AddonVrProperties{
// AddonType: to.Ptr(armavs.AddonTypeVR),
// VrsCount: to.Ptr[int32](1),
// ProvisioningState: to.Ptr(armavs.AddonProvisioningStateSucceeded),
// },
// Type: to.Ptr("Microsoft.AVS/privateClouds/addons"),
// },
// }
}
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 create a Addon
*
* @summary create a Addon
* x-ms-original-file: 2025-09-01/Addons_CreateOrUpdate_VR.json
*/
async function addonsCreateOrUpdateVR() {
const credential = new DefaultAzureCredential();
const subscriptionId = "00000000-0000-0000-0000-000000000000";
const client = new AzureVMwareSolutionAPI(credential, subscriptionId);
const result = await client.addons.createOrUpdate("group1", "cloud1", "vr", {
properties: { addonType: "VR", vrsCount: 1 },
});
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
Exempelsvar
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/addons/vr",
"name": "vr",
"properties": {
"addonType": "VR",
"vrsCount": 1,
"provisioningState": "Succeeded"
},
"type": "Microsoft.AVS/privateClouds/addons"
}
{
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.AVS/privateClouds/cloud1/addons/vr",
"name": "vr",
"properties": {
"addonType": "VR",
"vrsCount": 1,
"provisioningState": "Updating"
},
"type": "Microsoft.AVS/privateClouds/addons"
}
Definitioner
Addon
Objekt
En tilläggsresurs
| Namn |
Typ |
Beskrivning |
|
id
|
string
(arm-id)
|
Fullständigt kvalificerat resurs-ID för resursen. Till exempel "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}"
|
|
name
|
string
|
Namnet på resursen
|
|
properties
|
AddonProperties:
|
Resursspecifika egenskaper för den här resursen.
|
|
systemData
|
systemData
|
Azure Resource Manager-metadata som innehåller createdBy och modifiedBy information.
|
|
type
|
string
|
Resurstypen. Till exempel "Microsoft.Compute/virtualMachines" eller "Microsoft.Storage/storageAccounts"
|
AddonArcProperties
Objekt
Egenskaperna hos ett Arc-tillägg
| Namn |
Typ |
Beskrivning |
|
addonType
|
string:
Arc
|
Tilläggstyp
|
|
provisioningState
|
AddonProvisioningState
|
Status för tilläggsetablering
|
|
vCenter
|
string
|
Resurs-ID:t för VMware vCenter
|
AddonHcxProperties
Objekt
Egenskaperna hos ett HCX-tillägg
| Namn |
Typ |
Beskrivning |
|
addonType
|
string:
HCX
|
Tilläggstyp
|
|
managementNetwork
|
string
|
HCX-hanteringsnätverk.
|
|
offer
|
string
|
HCX-erbjudandet, till exempel VMware MaaS Cloud Provider (Enterprise)
|
|
provisioningState
|
AddonProvisioningState
|
Status för tilläggsetablering
|
|
uplinkNetwork
|
string
|
HCX-nätverk för upplänk
|
AddonProvisioningState
Uppräkning
Etableringstillstånd för tillägg
| Värde |
Beskrivning |
|
Succeeded
|
Resursen har skapats.
|
|
Failed
|
Det gick inte att skapa resurser.
|
|
Canceled
|
Resursskapandet avbröts.
|
|
Cancelled
|
avbryts
|
|
Building
|
håller på att byggas
|
|
Deleting
|
tar bort
|
|
Updating
|
uppdateras
|
AddonSrmProperties
Objekt
Egenskaperna för ett SRM-tillägg (Site Recovery Manager)
| Namn |
Typ |
Beskrivning |
|
addonType
|
string:
SRM
|
Tilläggstyp
|
|
licenseKey
|
string
|
Site Recovery Manager-licensen (SRM)
|
|
provisioningState
|
AddonProvisioningState
|
Status för tilläggsetablering
|
AddonType
Uppräkning
Tilläggstyp
| Värde |
Beskrivning |
|
SRM
|
|
|
VR
|
|
|
HCX
|
|
|
Arc
|
|
AddonVrProperties
Objekt
Egenskaperna för ett vSphere Replication-tillägg (VR)
| Namn |
Typ |
Beskrivning |
|
addonType
|
string:
VR
|
Tilläggstyp
|
|
provisioningState
|
AddonProvisioningState
|
Status för tilläggsetablering
|
|
vrsCount
|
integer
(int32)
|
Antalet vSphere Replication Server (VRS)
|
createdByType
Uppräkning
Den typ av identitet som skapade resursen.
| Värde |
Beskrivning |
|
User
|
|
|
Application
|
|
|
ManagedIdentity
|
|
|
Key
|
|
ErrorAdditionalInfo
Objekt
Ytterligare information om resurshanteringsfelet.
| Namn |
Typ |
Beskrivning |
|
info
|
object
|
Den ytterligare informationen.
|
|
type
|
string
|
Typen av ytterligare information.
|
ErrorDetail
Objekt
Felinformationen.
| Namn |
Typ |
Beskrivning |
|
additionalInfo
|
ErrorAdditionalInfo[]
|
Felet ytterligare information.
|
|
code
|
string
|
Felkoden.
|
|
details
|
ErrorDetail[]
|
Felinformationen.
|
|
message
|
string
|
Felmeddelandet.
|
|
target
|
string
|
Felet riktas.
|
ErrorResponse
Objekt
Felsvar
systemData
Objekt
Metadata som rör skapande och senaste ändring av resursen.
| Namn |
Typ |
Beskrivning |
|
createdAt
|
string
(date-time)
|
Tidsstämpeln för resursskapande (UTC).
|
|
createdBy
|
string
|
Identiteten som skapade resursen.
|
|
createdByType
|
createdByType
|
Den typ av identitet som skapade resursen.
|
|
lastModifiedAt
|
string
(date-time)
|
Tidsstämpeln för senaste ändring av resurs (UTC)
|
|
lastModifiedBy
|
string
|
Identiteten som senast ändrade resursen.
|
|
lastModifiedByType
|
createdByType
|
Den typ av identitet som senast ändrade resursen.
|