/// <summary> /// Modify properties of policies. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group. /// </param> /// <param name='labName'> /// The name of the lab. /// </param> /// <param name='policySetName'> /// The name of the policy set. /// </param> /// <param name='name'> /// The name of the policy. /// </param> /// <param name='policy'> /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <Policy> PatchResourceAsync(this IPolicyOperations operations, string resourceGroupName, string labName, string policySetName, string name, Policy policy, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.PatchResourceWithHttpMessagesAsync(resourceGroupName, labName, policySetName, name, policy, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Initializes a new instance of the SiteRecoveryManagementClient /// class. /// </summary> /// <param name='httpClient'> /// The Http client /// </param> public SiteRecoveryManagementClient(HttpClient httpClient) : base(httpClient) { this._alertSettings = new AlertSettingsOperations(this); this._events = new EventOperations(this); this._fabrics = new FabricOperations(this); this._jobs = new JobOperations(this); this._logicalNetwork = new LogicalNetworkOperations(this); this._networkMapping = new NetworkMappingOperations(this); this._network = new NetworkOperations(this); this._policies = new PolicyOperations(this); this._protectableItem = new ProtectableItemOperations(this); this._protectionContainerMapping = new ProtectionContainerMappingOperations(this); this._protectionContainer = new ProtectionContainerOperations(this); this._recoveryPlan = new RecoveryPlanOperations(this); this._recoveryPoint = new RecoveryPointOperations(this); this._recoveryServicesProvider = new RecoveryServicesProviderOperations(this); this._replicationProtectedItem = new ReplicationProtectedItemOperations(this); this._storageClassificationMapping = new StorageClassificationMappingOperations(this); this._storageClassification = new StorageClassificationOperations(this); this._vCenters = new VCenterOperations(this); this._apiVersion = "2015-01-01"; this._longRunningOperationInitialTimeout = -1; this._longRunningOperationRetryTimeout = -1; this.HttpClient.Timeout = TimeSpan.FromSeconds(300); }
/// <summary> /// Get the Global policy definition of the Api Management service. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group. /// </param> /// <param name='serviceName'> /// The name of the API Management service. /// </param> /// <param name='format'> /// Policy Export Format. Possible values include: 'xml', 'rawxml' /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <PolicyContract> GetAsync(this IPolicyOperations operations, string resourceGroupName, string serviceName, string format = default(string), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, serviceName, format, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Gets the entity state (Etag) version of the Global policy definition in the /// Api Management service. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group. /// </param> /// <param name='serviceName'> /// The name of the API Management service. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <PolicyGetEntityTagHeaders> GetEntityTagAsync(this IPolicyOperations operations, string resourceGroupName, string serviceName, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.GetEntityTagWithHttpMessagesAsync(resourceGroupName, serviceName, null, cancellationToken).ConfigureAwait(false)) { return(_result.Headers); } }
/// <summary> /// Accepts a new policy document and returns a JWT which expresses used in /// preparation to set attestation policy. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='tenantBaseUrl'> /// The tenant name, for example https://mytenant.attest.azure.net. /// </param> /// <param name='tee'> /// Specifies the trusted execution environment to be used to validate the /// evidence. Possible values include: 'SgxEnclave', 'OpenEnclave', /// 'CyResComponent', 'AzureGuest' /// </param> /// <param name='policyJws'> /// JSON Web Signature (See RFC7515) expressing the new policy /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <object> PrepareToSetAsync(this IPolicyOperations operations, string tenantBaseUrl, string tee, string policyJws, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.PrepareToSetWithHttpMessagesAsync(tenantBaseUrl, tee, policyJws, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Creates or updates the global policy configuration of the Api Management /// service. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group. /// </param> /// <param name='serviceName'> /// The name of the API Management service. /// </param> /// <param name='parameters'> /// The policy contents to apply. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <PolicyContract> CreateOrUpdateAsync(this IPolicyOperations operations, string resourceGroupName, string serviceName, PolicyContract parameters, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, serviceName, parameters, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// List policies in a given policy set. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group. /// </param> /// <param name='labName'> /// The name of the lab. /// </param> /// <param name='policySetName'> /// The name of the policy set. /// </param> /// <param name='odataQuery'> /// OData parameters to apply to the operation. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <IPage <Policy> > ListAsync(this IPolicyOperations operations, string resourceGroupName, string labName, string policySetName, ODataQuery <Policy> odataQuery = default(ODataQuery <Policy>), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, labName, policySetName, odataQuery, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// List policies in a given policy set. /// </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 <Policy> > ListNextAsync(this IPolicyOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Lists all the Global Policy definitions of the Api Management service. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group. /// </param> /// <param name='serviceName'> /// The name of the API Management service. /// </param> /// <param name='scope'> /// Policy scope. Possible values include: 'Tenant', 'Product', 'Api', /// 'Operation', 'All' /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <PolicyCollection> ListByServiceAsync(this IPolicyOperations operations, string resourceGroupName, string serviceName, PolicyScopeContract?scope = default(PolicyScopeContract?), CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListByServiceWithHttpMessagesAsync(resourceGroupName, serviceName, scope, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// The policy for a given billingAccountName and billingProfileName. /// <see href="https://docs.microsoft.com/en-us/rest/api/consumption/" /> /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='billingAccountName'> /// billing Account Id. /// </param> /// <param name='billingProfileName'> /// Billing Profile Id. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <Policy> GetByBillingProfileAsync(this IPolicyOperations operations, string billingAccountName, string billingProfileName, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.GetByBillingProfileWithHttpMessagesAsync(billingAccountName, billingProfileName, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }
/// <summary> /// Update Policy. /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.Azure.Management.SiteRecovery.IPolicyOperations. /// </param> /// <param name='input'> /// Required. input. /// </param> /// <param name='policyName'> /// Required. Policy name. /// </param> /// <param name='customRequestHeaders'> /// Optional. Request header parameters. /// </param> /// <returns> /// A standard service response for long running operations. /// </returns> public static LongRunningOperationResponse Update(this IPolicyOperations operations, UpdatePolicyInput input, string policyName, CustomRequestHeaders customRequestHeaders) { return(Task.Factory.StartNew((object s) => { return ((IPolicyOperations)s).UpdateAsync(input, policyName, customRequestHeaders); } , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult()); }
/// <summary> /// Get the list of all ProtectionContainers for the given server. /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.Azure.Management.SiteRecovery.IPolicyOperations. /// </param> /// <param name='customRequestHeaders'> /// Optional. Request header parameters. /// </param> /// <returns> /// The response model for the list policies operation. /// </returns> public static PolicyListResponse List(this IPolicyOperations operations, CustomRequestHeaders customRequestHeaders) { return(Task.Factory.StartNew((object s) => { return ((IPolicyOperations)s).ListAsync(customRequestHeaders); } , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult()); }
/// <summary> /// The Get Operation Status operation returns the status of the /// specified operation. After calling an asynchronous operation, you /// can call Get Operation Status to determine whether the operation /// has succeeded, failed, or is still in progress. /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.Azure.Management.SiteRecovery.IPolicyOperations. /// </param> /// <param name='operationStatusLink'> /// Required. Location value returned by the Begin operation. /// </param> /// <returns> /// A standard service response for long running operations. /// </returns> public static UpdatePolicyOperationResponse GetUpdateStatus(this IPolicyOperations operations, string operationStatusLink) { return(Task.Factory.StartNew((object s) => { return ((IPolicyOperations)s).GetUpdateStatusAsync(operationStatusLink); } , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult()); }
/// <summary> /// Deletes a Policy /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.Azure.Management.SiteRecovery.IPolicyOperations. /// </param> /// <param name='name'> /// Required. Policy name. /// </param> /// <param name='customRequestHeaders'> /// Optional. Request header parameters. /// </param> /// <returns> /// A standard service response for long running operations. /// </returns> public static LongRunningOperationResponse BeginDeleting(this IPolicyOperations operations, string name, CustomRequestHeaders customRequestHeaders) { return(Task.Factory.StartNew((object s) => { return ((IPolicyOperations)s).BeginDeletingAsync(name, customRequestHeaders); } , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult()); }
/// <summary> /// Initializes a new instance of the SiteRecoveryManagementClient /// class. /// </summary> public SiteRecoveryManagementClient() : base() { this._fabrics = new FabricOperations(this); this._jobs = new JobOperations(this); this._logicalNetwork = new LogicalNetworkOperations(this); this._networkMapping = new NetworkMappingOperations(this); this._network = new NetworkOperations(this); this._policies = new PolicyOperations(this); this._protectableItem = new ProtectableItemOperations(this); this._protectionContainerMapping = new ProtectionContainerMappingOperations(this); this._protectionContainer = new ProtectionContainerOperations(this); this._recoveryServicesProvider = new RecoveryServicesProviderOperations(this); this._replicationProtectedItem = new ReplicationProtectedItemOperations(this); this._vCenters = new VCenterOperations(this); this._apiVersion = "2015-01-01"; this._longRunningOperationInitialTimeout = -1; this._longRunningOperationRetryTimeout = -1; this.HttpClient.Timeout = TimeSpan.FromSeconds(300); }
/// <summary> /// Deletes the global policy configuration of the Api Management Service. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group. /// </param> /// <param name='serviceName'> /// The name of the API Management service. /// </param> /// <param name='ifMatch'> /// ETag of the Entity. ETag should match the current entity state from the /// header response of the GET request or it should be * for unconditional /// update. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task DeleteAsync(this IPolicyOperations operations, string resourceGroupName, string serviceName, string ifMatch, CancellationToken cancellationToken = default(CancellationToken)) { (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, serviceName, ifMatch, null, cancellationToken).ConfigureAwait(false)).Dispose(); }
/// <summary> /// Lists all the Global Policy definitions of the Api Management service. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group. /// </param> /// <param name='serviceName'> /// The name of the API Management service. /// </param> /// <param name='scope'> /// Policy scope. Possible values include: 'Tenant', 'Product', 'Api', /// 'Operation', 'All' /// </param> public static PolicyCollection ListByService(this IPolicyOperations operations, string resourceGroupName, string serviceName, PolicyScopeContract?scope = default(PolicyScopeContract?)) { return(operations.ListByServiceAsync(resourceGroupName, serviceName, scope).GetAwaiter().GetResult()); }
/// <summary> /// Get the list of all ProtectionContainers for the given server. /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.Azure.Management.SiteRecovery.IPolicyOperations. /// </param> /// <param name='customRequestHeaders'> /// Optional. Request header parameters. /// </param> /// <returns> /// The response model for the list policies operation. /// </returns> public static Task <PolicyListResponse> ListAsync(this IPolicyOperations operations, CustomRequestHeaders customRequestHeaders) { return(operations.ListAsync(customRequestHeaders, CancellationToken.None)); }
/// <summary> /// Deletes the global policy configuration of the Api Management Service. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group. /// </param> /// <param name='serviceName'> /// The name of the API Management service. /// </param> /// <param name='ifMatch'> /// ETag of the Entity. ETag should match the current entity state from the /// header response of the GET request or it should be * for unconditional /// update. /// </param> public static void Delete(this IPolicyOperations operations, string resourceGroupName, string serviceName, string ifMatch) { operations.DeleteAsync(resourceGroupName, serviceName, ifMatch).GetAwaiter().GetResult(); }
/// <summary> /// Get the Global policy definition of the Api Management service. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group. /// </param> /// <param name='serviceName'> /// The name of the API Management service. /// </param> public static PolicyContract Get(this IPolicyOperations operations, string resourceGroupName, string serviceName) { return(operations.GetAsync(resourceGroupName, serviceName).GetAwaiter().GetResult()); }
/// <summary> /// Creates or updates the global policy configuration of the Api Management /// service. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group. /// </param> /// <param name='serviceName'> /// The name of the API Management service. /// </param> /// <param name='parameters'> /// The policy contents to apply. /// </param> public static PolicyContract CreateOrUpdate(this IPolicyOperations operations, string resourceGroupName, string serviceName, PolicyContract parameters) { return(operations.CreateOrUpdateAsync(resourceGroupName, serviceName, parameters).GetAwaiter().GetResult()); }
/// <summary> /// Retrieves the current policy for a given kind of TEE. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='tenantBaseUrl'> /// The tenant name, for example https://mytenant.attest.azure.net. /// </param> /// <param name='tee'> /// Specifies the trusted execution environment to be used to validate the /// evidence. Possible values include: 'SgxEnclave', 'OpenEnclave', /// 'CyResComponent', 'AzureGuest' /// </param> public static object Get(this IPolicyOperations operations, string tenantBaseUrl, string tee) { return(operations.GetAsync(tenantBaseUrl, tee).GetAwaiter().GetResult()); }
/// <summary> /// Update Policy. /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.Azure.Management.SiteRecovery.IPolicyOperations. /// </param> /// <param name='input'> /// Required. input. /// </param> /// <param name='policyName'> /// Required. Policy name. /// </param> /// <param name='customRequestHeaders'> /// Optional. Request header parameters. /// </param> /// <returns> /// A standard service response for long running operations. /// </returns> public static Task <LongRunningOperationResponse> UpdateAsync(this IPolicyOperations operations, UpdatePolicyInput input, string policyName, CustomRequestHeaders customRequestHeaders) { return(operations.UpdateAsync(input, policyName, customRequestHeaders, CancellationToken.None)); }
/// <summary> /// Creates a profile /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.Azure.Management.SiteRecovery.IPolicyOperations. /// </param> /// <param name='policyName'> /// Required. Policy Name. /// </param> /// <param name='input'> /// Required. Input to create profile /// </param> /// <param name='customRequestHeaders'> /// Optional. Request header parameters. /// </param> /// <returns> /// A standard service response for long running operations. /// </returns> public static Task <LongRunningOperationResponse> BeginCreatingAsync(this IPolicyOperations operations, string policyName, CreatePolicyInput input, CustomRequestHeaders customRequestHeaders) { return(operations.BeginCreatingAsync(policyName, input, customRequestHeaders, CancellationToken.None)); }
/// <summary> /// Accepts a new policy document and returns a JWT which expresses used in /// preparation to set attestation policy. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='tenantBaseUrl'> /// The tenant name, for example https://mytenant.attest.azure.net. /// </param> /// <param name='tee'> /// Specifies the trusted execution environment to be used to validate the /// evidence. Possible values include: 'SgxEnclave', 'OpenEnclave', /// 'CyResComponent', 'AzureGuest' /// </param> /// <param name='policyJws'> /// JSON Web Signature (See RFC7515) expressing the new policy /// </param> public static object PrepareToSet(this IPolicyOperations operations, string tenantBaseUrl, string tee, string policyJws) { return(operations.PrepareToSetAsync(tenantBaseUrl, tee, policyJws).GetAwaiter().GetResult()); }
/// <summary> /// Sets the policy for a given kind of TEE. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='tenantBaseUrl'> /// The tenant name, for example https://mytenant.attest.azure.net. /// </param> /// <param name='tee'> /// Specifies the trusted execution environment to be used to validate the /// evidence. Possible values include: 'SgxEnclave', 'OpenEnclave', /// 'CyResComponent', 'AzureGuest' /// </param> /// <param name='newAttestationPolicy'> /// JWT Expressing the new policy /// </param> public static object Set(this IPolicyOperations operations, string tenantBaseUrl, string tee, string newAttestationPolicy) { return(operations.SetAsync(tenantBaseUrl, tee, newAttestationPolicy).GetAwaiter().GetResult()); }
/// <summary> /// Lists all the Global Policy definitions of the Api Management service. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group. /// </param> /// <param name='serviceName'> /// The name of the API Management service. /// </param> public static PolicyCollection ListByService(this IPolicyOperations operations, string resourceGroupName, string serviceName) { return(operations.ListByServiceAsync(resourceGroupName, serviceName).GetAwaiter().GetResult()); }
/// <summary> /// The policy for a given billingAccountName and billingProfileName. /// <see href="https://docs.microsoft.com/en-us/rest/api/consumption/" /> /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='billingAccountName'> /// billing Account Id. /// </param> /// <param name='billingProfileName'> /// Billing Profile Id. /// </param> public static Policy GetByBillingProfile(this IPolicyOperations operations, string billingAccountName, string billingProfileName) { return(operations.GetByBillingProfileAsync(billingAccountName, billingProfileName).GetAwaiter().GetResult()); }
/// <summary> /// Gets the entity state (Etag) version of the Global policy definition in the /// Api Management service. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group. /// </param> /// <param name='serviceName'> /// The name of the API Management service. /// </param> public static PolicyGetEntityTagHeaders GetEntityTag(this IPolicyOperations operations, string resourceGroupName, string serviceName) { return(operations.GetEntityTagAsync(resourceGroupName, serviceName).GetAwaiter().GetResult()); }
/// <summary> /// The operation to update a policy. /// </summary> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='billingAccountName'> /// billing Account Id. /// </param> /// <param name='billingProfileName'> /// Billing Profile Id. /// </param> /// <param name='parameters'> /// Parameters supplied to the update policy operation. /// </param> public static Policy Update(this IPolicyOperations operations, string billingAccountName, string billingProfileName, Policy parameters) { return(operations.UpdateAsync(billingAccountName, billingProfileName, parameters).GetAwaiter().GetResult()); }