/// <summary> /// Updates a resource. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group for the resource. The name is case /// insensitive. /// </param> /// <param name='resourceProviderNamespace'> /// The namespace of the resource provider. /// </param> /// <param name='parentResourcePath'> /// The parent resource identity. /// </param> /// <param name='resourceType'> /// The resource type of the resource to update. /// </param> /// <param name='resourceName'> /// The name of the resource to update. /// </param> /// <param name='apiVersion'> /// The API version to use for the operation. /// </param> /// <param name='parameters'> /// Parameters for updating the resource. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <GenericResourceInner> BeginUpdateAsync(this IResourcesOperations operations, string resourceGroupName, string resourceProviderNamespace, string parentResourcePath, string resourceType, string resourceName, string apiVersion, GenericResourceInner parameters, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion, parameters, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Updates a resource by ID. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceId'> /// The fully qualified ID of the resource, including the resource name and /// resource type. Use the format, /// /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} /// </param> /// <param name='apiVersion'> /// The API version to use for the operation. /// </param> /// <param name='parameters'> /// Update resource parameters. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <GenericResourceInner> BeginUpdateByIdAsync(this IResourcesOperations operations, string resourceId, string apiVersion, GenericResourceInner parameters, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.BeginUpdateByIdWithHttpMessagesAsync(resourceId, apiVersion, parameters, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Checks by ID whether a resource exists. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceId'> /// The fully qualified ID of the resource, including the resource name and /// resource type. Use the format, /// /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} /// </param> /// <param name='apiVersion'> /// The API version to use for the operation. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <bool> CheckExistenceByIdAsync(this IResourcesOperations operations, string resourceId, string apiVersion, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.CheckExistenceByIdWithHttpMessagesAsync(resourceId, apiVersion, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Get all the resources in a subscription. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='nextPageLink'> /// The NextLink from the previous successful call to List operation. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <IPage <GenericResourceInner> > ListNextAsync(this IResourcesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Get all the resources in a subscription. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='odataQuery'> /// OData parameters to apply to the operation. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <IPage <GenericResourceInner> > ListAsync(this IResourcesOperations operations, ODataQuery <GenericResourceFilterInner> odataQuery = default(ODataQuery <GenericResourceFilterInner>), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListWithHttpMessagesAsync(odataQuery, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Checks whether a resource exists. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group containing the resource to check. The name /// is case insensitive. /// </param> /// <param name='resourceProviderNamespace'> /// The resource provider of the resource to check. /// </param> /// <param name='parentResourcePath'> /// The parent resource identity. /// </param> /// <param name='resourceType'> /// The resource type. /// </param> /// <param name='resourceName'> /// The name of the resource to check whether it exists. /// </param> /// <param name='apiVersion'> /// The API version to use for the operation. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <bool> CheckExistenceAsync(this IResourcesOperations operations, string resourceGroupName, string resourceProviderNamespace, string parentResourcePath, string resourceType, string resourceName, string apiVersion, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.CheckExistenceWithHttpMessagesAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Deletes a resource by ID. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceId'> /// The fully qualified ID of the resource, including the resource name and /// resource type. Use the format, /// /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} /// </param> /// <param name='apiVersion'> /// The API version to use for the operation. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task BeginDeleteByIdAsync(this IResourcesOperations operations, string resourceId, string apiVersion, CancellationToken cancellationToken = default(CancellationToken)) { (await operations.BeginDeleteByIdWithHttpMessagesAsync(resourceId, apiVersion, null, cancellationToken).ConfigureAwait(false)).Dispose(); }
/// <summary> /// Move resources from one resource group to another. The resources being /// moved should all be in the same resource group. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='sourceResourceGroupName'> /// Source resource group name. /// </param> /// <param name='parameters'> /// move resources' parameters. /// </param> public static void BeginMoveResources(this IResourcesOperations operations, string sourceResourceGroupName, ResourcesMoveInfo parameters) { Task.Factory.StartNew(s => ((IResourcesOperations)s).BeginMoveResourcesAsync(sourceResourceGroupName, parameters), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult(); }
/// <summary> /// Move resources from one resource group to another. The resources being /// moved should all be in the same resource group. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='sourceResourceGroupName'> /// Source resource group name. /// </param> /// <param name='parameters'> /// move resources' parameters. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task BeginMoveResourcesAsync(this IResourcesOperations operations, string sourceResourceGroupName, ResourcesMoveInfo parameters, CancellationToken cancellationToken = default(CancellationToken)) { await operations.BeginMoveResourcesWithHttpMessagesAsync(sourceResourceGroupName, parameters, null, cancellationToken).ConfigureAwait(false); }
/// <summary> /// Gets a resource. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group containing the resource to get. The name is /// case insensitive. /// </param> /// <param name='resourceProviderNamespace'> /// The namespace of the resource provider. /// </param> /// <param name='parentResourcePath'> /// The parent resource identity. /// </param> /// <param name='resourceType'> /// The resource type of the resource. /// </param> /// <param name='resourceName'> /// The name of the resource to get. /// </param> /// <param name='apiVersion'> /// The API version to use for the operation. /// </param> public static GenericResource Get(this IResourcesOperations operations, string resourceGroupName, string resourceProviderNamespace, string parentResourcePath, string resourceType, string resourceName, string apiVersion) { return(operations.GetAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion).GetAwaiter().GetResult()); }
/// <summary> /// Get all of the resources under a subscription. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='nextPageLink'> /// The NextLink from the previous successful call to List operation. /// </param> public static IPage <GenericResource> ListNext(this IResourcesOperations operations, string nextPageLink) { return(Task.Factory.StartNew(s => ((IResourcesOperations)s).ListNextAsync(nextPageLink), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult()); }
/// <summary> /// Deletes a resource. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group that contains the resource to delete. The /// name is case insensitive. /// </param> /// <param name='resourceProviderNamespace'> /// The namespace of the resource provider. /// </param> /// <param name='parentResourcePath'> /// The parent resource identity. /// </param> /// <param name='resourceType'> /// The resource type. /// </param> /// <param name='resourceName'> /// The name of the resource to delete. /// </param> /// <param name='apiVersion'> /// The API version to use for the operation. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task BeginDeleteAsync(this IResourcesOperations operations, string resourceGroupName, string resourceProviderNamespace, string parentResourcePath, string resourceType, string resourceName, string apiVersion, CancellationToken cancellationToken = default(CancellationToken)) { (await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion, null, cancellationToken).ConfigureAwait(false)).Dispose(); }
/// <summary> /// Gets a resource by ID. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceId'> /// The fully qualified ID of the resource, including the resource name and /// resource type. Use the format, /// /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} /// </param> /// <param name='apiVersion'> /// The API version to use for the operation. /// </param> public static GenericResource GetById(this IResourcesOperations operations, string resourceId, string apiVersion) { return(operations.GetByIdAsync(resourceId, apiVersion).GetAwaiter().GetResult()); }
/// <summary> /// Get all the resources in a subscription. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='nextPageLink'> /// The NextLink from the previous successful call to List operation. /// </param> public static IPage <GenericResource> ListNext(this IResourcesOperations operations, string nextPageLink) { return(operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult()); }
/// <summary> /// Get all the resources in a subscription. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='odataQuery'> /// OData parameters to apply to the operation. /// </param> public static IPage <GenericResource> List(this IResourcesOperations operations, ODataQuery <GenericResourceFilter> odataQuery = default(ODataQuery <GenericResourceFilter>)) { return(operations.ListAsync(odataQuery).GetAwaiter().GetResult()); }
/// <summary> /// Create a resource by ID. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceId'> /// The fully qualified ID of the resource, including the resource name and /// resource type. Use the format, /// /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} /// </param> /// <param name='apiVersion'> /// The API version to use for the operation. /// </param> /// <param name='parameters'> /// Create or update resource parameters. /// </param> public static GenericResource BeginCreateOrUpdateById(this IResourcesOperations operations, string resourceId, string apiVersion, GenericResource parameters) { return(operations.BeginCreateOrUpdateByIdAsync(resourceId, apiVersion, parameters).GetAwaiter().GetResult()); }
/// <summary> /// Deletes a resource by ID. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceId'> /// The fully qualified ID of the resource, including the resource name and /// resource type. Use the format, /// /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} /// </param> /// <param name='apiVersion'> /// The API version to use for the operation. /// </param> public static void BeginDeleteById(this IResourcesOperations operations, string resourceId, string apiVersion) { operations.BeginDeleteByIdAsync(resourceId, apiVersion).GetAwaiter().GetResult(); }
/// <summary> /// Creates a resource. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group for the resource. The name is case /// insensitive. /// </param> /// <param name='resourceProviderNamespace'> /// The namespace of the resource provider. /// </param> /// <param name='parentResourcePath'> /// The parent resource identity. /// </param> /// <param name='resourceType'> /// The resource type of the resource to create. /// </param> /// <param name='resourceName'> /// The name of the resource to create. /// </param> /// <param name='apiVersion'> /// The API version to use for the operation. /// </param> /// <param name='parameters'> /// Parameters for creating or updating the resource. /// </param> public static GenericResource BeginCreateOrUpdate(this IResourcesOperations operations, string resourceGroupName, string resourceProviderNamespace, string parentResourcePath, string resourceType, string resourceName, string apiVersion, GenericResource parameters) { return(operations.BeginCreateOrUpdateAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion, parameters).GetAwaiter().GetResult()); }
/// <summary> /// Deletes a resource. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group that contains the resource to delete. The /// name is case insensitive. /// </param> /// <param name='resourceProviderNamespace'> /// The namespace of the resource provider. /// </param> /// <param name='parentResourcePath'> /// The parent resource identity. /// </param> /// <param name='resourceType'> /// The resource type. /// </param> /// <param name='resourceName'> /// The name of the resource to delete. /// </param> /// <param name='apiVersion'> /// The API version to use for the operation. /// </param> public static void BeginDelete(this IResourcesOperations operations, string resourceGroupName, string resourceProviderNamespace, string parentResourcePath, string resourceType, string resourceName, string apiVersion) { operations.BeginDeleteAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion).GetAwaiter().GetResult(); }
/// <summary> /// Moves resources from one resource group to another resource group. /// </summary> /// <remarks> /// The resources to move must be in the same source resource group. The target /// resource group may be in a different subscription. When moving resources, /// both the source group and the target group are locked for the duration of /// the operation. Write and delete operations are blocked on the groups until /// the move completes. /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='sourceResourceGroupName'> /// The name of the resource group containing the rsources to move. /// </param> /// <param name='parameters'> /// Parameters for moving resources. /// </param> public static void BeginMoveResources(this IResourcesOperations operations, string sourceResourceGroupName, ResourcesMoveInfo parameters) { operations.BeginMoveResourcesAsync(sourceResourceGroupName, parameters).GetAwaiter().GetResult(); }
/// <summary> /// Get all the resources for a resource group. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The resource group with the resources to get. /// </param> /// <param name='odataQuery'> /// OData parameters to apply to the operation. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <IPage <GenericResourceExpanded> > ListByResourceGroupAsync(this IResourcesOperations operations, string resourceGroupName, ODataQuery <GenericResourceFilter> odataQuery = default(ODataQuery <GenericResourceFilter>), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, odataQuery, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Checks by ID whether a resource exists. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceId'> /// The fully qualified ID of the resource, including the resource name and /// resource type. Use the format, /// /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name} /// </param> /// <param name='apiVersion'> /// The API version to use for the operation. /// </param> public static bool CheckExistenceById(this IResourcesOperations operations, string resourceId, string apiVersion) { return(operations.CheckExistenceByIdAsync(resourceId, apiVersion).GetAwaiter().GetResult()); }
/// <summary> /// Get all of the resources under a subscription. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='odataQuery'> /// OData parameters to apply to the operation. /// </param> public static IPage <GenericResource> List(this IResourcesOperations operations, ODataQuery <GenericResourceFilter> odataQuery = default(ODataQuery <GenericResourceFilter>)) { return(Task.Factory.StartNew(s => ((IResourcesOperations)s).ListAsync(odataQuery), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult()); }
/// <summary> /// Returns a resource belonging to a resource group. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group. The name is case insensitive. /// </param> /// <param name='resourceProviderNamespace'> /// Resource identity. /// </param> /// <param name='parentResourcePath'> /// Resource identity. /// </param> /// <param name='resourceType'> /// Resource identity. /// </param> /// <param name='resourceName'> /// Resource identity. /// </param> /// <param name='apiVersion'> /// Api version to use. /// </param> public static GenericResource Get(this IResourcesOperations operations, string resourceGroupName, string resourceProviderNamespace, string parentResourcePath, string resourceType, string resourceName, string apiVersion) { return(Task.Factory.StartNew(s => ((IResourcesOperations)s).GetAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult()); }
/// <summary> /// Validates whether resources can be moved from one resource group to another /// resource group. /// </summary> /// <remarks> /// This operation checks whether the specified resources can be moved to the /// target. The resources to move must be in the same source resource group. /// The target resource group may be in a different subscription. If validation /// succeeds, it returns HTTP response code 204 (no content). If validation /// fails, it returns HTTP response code 409 (Conflict) with an error message. /// Retrieve the URL in the Location header value to check the result of the /// long-running operation. /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='sourceResourceGroupName'> /// The name of the resource group containing the resources to validate for /// move. /// </param> /// <param name='parameters'> /// Parameters for moving resources. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task ValidateMoveResourcesAsync(this IResourcesOperations operations, string sourceResourceGroupName, ResourcesMoveInfoInner parameters, CancellationToken cancellationToken = default(CancellationToken)) { (await operations.ValidateMoveResourcesWithHttpMessagesAsync(sourceResourceGroupName, parameters, null, cancellationToken).ConfigureAwait(false)).Dispose(); }
/// <summary> /// Checks whether a resource exists. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group containing the resource to check. The name /// is case insensitive. /// </param> /// <param name='resourceProviderNamespace'> /// The resource provider of the resource to check. /// </param> /// <param name='parentResourcePath'> /// The parent resource identity. /// </param> /// <param name='resourceType'> /// The resource type. /// </param> /// <param name='resourceName'> /// The name of the resource to check whether it exists. /// </param> /// <param name='apiVersion'> /// The API version to use for the operation. /// </param> public static bool CheckExistence(this IResourcesOperations operations, string resourceGroupName, string resourceProviderNamespace, string parentResourcePath, string resourceType, string resourceName, string apiVersion) { return(operations.CheckExistenceAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, apiVersion).GetAwaiter().GetResult()); }