public void CreateAppendProviderAndChild() { var id = new ResourceIdentifier("/subscriptions/0c2f6471-1bf0-4dda-aec3-cb9272f09575/resourceGroups/myRg"); id = id.AppendProviderResource("Microsoft.Compute", "virtualMachines", "myVm"); id = id.AppendChildResource("children", "myChild"); }
public void TestAppendResourceGroupProviderResource(string resourceId, string providerNamespace, string resourceTypeName, string resourceName) { ResourceIdentifier resource = resourceId; if (providerNamespace is null || resourceTypeName is null || resourceName is null) { Assert.Throws(typeof(ArgumentNullException), () => resource.AppendProviderResource(providerNamespace, resourceTypeName, resourceName)); }
protected async Task <ArmOperation <GenericResource> > StartCreateGenericAvailabilitySetAsync(ResourceIdentifier rgId) { var genericResources = Client.GetGenericResources(); GenericResourceData data = ConstructGenericAvailabilitySet(); var asetId = rgId.AppendProviderResource("Microsoft.Compute", "availabilitySets", Recording.GenerateAssetName("test-aset")); return(await genericResources.CreateOrUpdateAsync(WaitUntil.Started, asetId, data)); }
protected async Task <ResourceCreateOrUpdateByIdOperation> StartCreateGenericAvailabilitySetAsync(ResourceIdentifier rgId) { var genericResources = (await Client.GetDefaultSubscriptionAsync().ConfigureAwait(false)).GetGenericResources(); GenericResourceData data = ConstructGenericAvailabilitySet(); var asetId = rgId.AppendProviderResource("Microsoft.Compute", "availabilitySets", Recording.GenerateAssetName("test-aset")); return(await genericResources.CreateOrUpdateAsync(asetId, data, false)); }
protected async Task <GenericResource> CreateGenericAvailabilitySetAsync(ResourceIdentifier rgId) { var genericResources = Client.GetGenericResources(); GenericResourceData data = ConstructGenericAvailabilitySet(); var asetId = rgId.AppendProviderResource("Microsoft.Compute", "availabilitySets", Recording.GenerateAssetName("test-aset")); var op = await genericResources.CreateOrUpdateAsync(true, asetId, data); return(op.Value); }