/// <summary>
 /// Create a new Azure ML web service or update an existing one.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='createOrUpdatePayload'>
 /// The payload to create or update the Azure ML web service.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Name of the resource group.
 /// </param>
 /// <param name='webServiceName'>
 /// The Azure ML web service name which you want to reach.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 /// <remarks>
 /// In case of an error, the thrown CloudException contains the proper request id to monitor the reasons for the failure
 /// </remarks>
 public static async Task <WebService> CreateOrUpdateWithRequestIdAsync(this IWebServicesOperations operations, WebService createOrUpdatePayload, string resourceGroupName, string webServiceName, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.CreateOrUpdateWebServiceWithProperRequestIdAsync(createOrUpdatePayload, resourceGroupName, webServiceName, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <summary>
 /// Gets the web services in the specified 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 <WebService> > ListBySubscriptionIdNextAsync(this IWebServicesOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.ListBySubscriptionIdNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <summary>
 /// Retrieve all Azure ML web services in the current Azure subscription.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='skiptoken'>
 /// Continuation token for pagination.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <PaginatedWebServicesList> ListAsync(this IWebServicesOperations operations, string skiptoken = default(string), CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.ListWithHttpMessagesAsync(skiptoken, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
Beispiel #4
0
 /// <summary>
 /// Gets the web services in the specified resource group.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Name of the resource group in which the web service is located.
 /// </param>
 /// <param name='skiptoken'>
 /// Continuation token for pagination.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <IPage <WebServiceInner> > ListByResourceGroupAsync(this IWebServicesOperations operations, string resourceGroupName, string skiptoken = default(string), CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.ListByResourceGroupWithHttpMessagesAsync(resourceGroupName, skiptoken, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
Beispiel #5
0
 /// <summary>
 /// Create or update a web service. This call will overwrite an existing web
 /// service. Note that there is no warning or confirmation. This is a
 /// nonrecoverable operation. If your intent is to create a new web service,
 /// call the Get operation first to verify that it does not exist.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Name of the resource group in which the web service is located.
 /// </param>
 /// <param name='webServiceName'>
 /// The name of the web service.
 /// </param>
 /// <param name='createOrUpdatePayload'>
 /// The payload that is used to create or update the web service.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <WebServiceInner> CreateOrUpdateAsync(this IWebServicesOperations operations, string resourceGroupName, string webServiceName, WebServiceInner createOrUpdatePayload, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, webServiceName, createOrUpdatePayload, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <summary>
 /// Modifies an existing web service resource. The PATCH API call is an
 /// asynchronous operation. To determine whether it has completed successfully,
 /// you must perform a Get operation.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Name of the resource group in which the web service is located.
 /// </param>
 /// <param name='webServiceName'>
 /// The name of the web service.
 /// </param>
 /// <param name='patchPayload'>
 /// The payload to use to patch the web service.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <WebService> BeginPatchAsync(this IWebServicesOperations operations, string resourceGroupName, string webServiceName, WebService patchPayload, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.BeginPatchWithHttpMessagesAsync(resourceGroupName, webServiceName, patchPayload, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
Beispiel #7
0
 /// <summary>
 /// Gets the Web Service Definition as specified by a subscription, resource
 /// group, and name. Note that the storage credentials and web service keys are
 /// not returned by this call. To get the web service access keys, call List
 /// Keys.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Name of the resource group in which the web service is located.
 /// </param>
 /// <param name='webServiceName'>
 /// The name of the web service.
 /// </param>
 /// <param name='region'>
 /// The region for which encrypted credential parameters are valid.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <WebServiceInner> GetAsync(this IWebServicesOperations operations, string resourceGroupName, string webServiceName, string region = default(string), CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, webServiceName, region, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
Beispiel #8
0
 /// <summary>
 /// Initializes client properties.
 /// </summary>
 private void Initialize()
 {
     WebServices    = new WebServicesOperations(this);
     BaseUri        = new System.Uri("https://management.azure.com");
     ApiVersion     = "2017-01-01";
     AcceptLanguage = "en-US";
     LongRunningOperationRetryTimeout = 30;
     GenerateClientRequestId          = true;
     SerializationSettings            = new JsonSerializerSettings
     {
         Formatting            = Newtonsoft.Json.Formatting.Indented,
         DateFormatHandling    = Newtonsoft.Json.DateFormatHandling.IsoDateFormat,
         DateTimeZoneHandling  = Newtonsoft.Json.DateTimeZoneHandling.Utc,
         NullValueHandling     = Newtonsoft.Json.NullValueHandling.Ignore,
         ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize,
         ContractResolver      = new ReadOnlyJsonContractResolver(),
         Converters            = new List <JsonConverter>
         {
             new Iso8601TimeSpanConverter()
         }
     };
     DeserializationSettings = new JsonSerializerSettings
     {
         DateFormatHandling    = Newtonsoft.Json.DateFormatHandling.IsoDateFormat,
         DateTimeZoneHandling  = Newtonsoft.Json.DateTimeZoneHandling.Utc,
         NullValueHandling     = Newtonsoft.Json.NullValueHandling.Ignore,
         ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize,
         ContractResolver      = new ReadOnlyJsonContractResolver(),
         Converters            = new List <JsonConverter>
         {
             new Iso8601TimeSpanConverter()
         }
     };
     SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter <WebServiceProperties>("packageType"));
     DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter <WebServiceProperties>("packageType"));
     CustomInitialize();
     DeserializationSettings.Converters.Add(new CloudErrorJsonConverter());
 }
 /// <summary>
 /// Patch an existing Azure ML web service resource.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='patchPayload'>
 /// The payload to patch the Azure ML web service with.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Name of the resource group.
 /// </param>
 /// <param name='webServiceName'>
 /// The Azure ML web service name which you want to reach.
 /// </param>
 public static WebService PatchWithRequestId(this IWebServicesOperations operations, WebService patchPayload, string resourceGroupName, string webServiceName)
 {
     return(Task.Factory.StartNew(s => ((IWebServicesOperations)s).PatchWithRequestIdAsync(patchPayload, resourceGroupName, webServiceName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
 /// <summary>
 /// Retrieve all Azure ML web services in the current Azure subscription.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='skiptoken'>
 /// Continuation token for pagination.
 /// </param>
 public static PaginatedWebServicesList List(this IWebServicesOperations operations, string skiptoken = default(string))
 {
     return(Task.Factory.StartNew(s => ((IWebServicesOperations)s).ListAsync(skiptoken), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
 /// <summary>
 /// Create web service properties for a specific region.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Name of the resource group.
 /// </param>
 /// <param name='webServiceName'>
 /// The Azure ML web service name which you want to reach.
 /// </param>
 /// <param name='region'>
 /// The new region of Azure ML web service properties.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task CreateRegionalPropertiesWithRequestIdAsync(this IWebServicesOperations operations, string resourceGroupName, string webServiceName, string region, CancellationToken cancellationToken = default(CancellationToken))
 {
     await operations.CreateRegionalPropertiesWithProperRequestIdAsync(resourceGroupName, webServiceName, region, null, cancellationToken).ConfigureAwait(false);
 }
 /// <summary>
 /// Creates or updates a new Azure ML web service or update an existing one.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='createOrUpdatePayload'>
 /// The payload to create or update the Azure ML web service.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Name of the resource group.
 /// </param>
 /// <param name='webServiceName'>
 /// The Azure ML web service name which you want to reach.
 /// </param>
 public static WebService BeginCreateOrUpdate(this IWebServicesOperations operations, WebService createOrUpdatePayload, string resourceGroupName, string webServiceName)
 {
     return(Task.Factory.StartNew(s => ((IWebServicesOperations)s).BeginCreateOrUpdateAsync(createOrUpdatePayload, resourceGroupName, webServiceName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
 /// <summary>
 /// Create or update a web service. This call will overwrite an existing web
 /// service. Note that there is no warning or confirmation. This is a
 /// nonrecoverable operation. If your intent is to create a new web service,
 /// call the Get operation first to verify that it does not exist.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Name of the resource group in which the web service is located.
 /// </param>
 /// <param name='webServiceName'>
 /// The name of the web service.
 /// </param>
 /// <param name='createOrUpdatePayload'>
 /// The payload that is used to create or update the web service.
 /// </param>
 public static WebService BeginCreateOrUpdate(this IWebServicesOperations operations, string resourceGroupName, string webServiceName, WebService createOrUpdatePayload)
 {
     return(operations.BeginCreateOrUpdateAsync(resourceGroupName, webServiceName, createOrUpdatePayload).GetAwaiter().GetResult());
 }
 /// <summary>
 /// Create web service properties for a specific region.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Name of the resource group.
 /// </param>
 /// <param name='webServiceName'>
 /// The Azure ML web service name which you want to reach.
 /// </param>
 /// <param name='region'>
 /// The new region of Azure ML web service properties.
 /// </param>
 public static void CreateRegionalPropertiesWithRequestId(this IWebServicesOperations operations, string resourceGroupName, string webServiceName, string region)
 {
     Task.Factory.StartNew(s => ((IWebServicesOperations)s).CreateRegionalPropertiesWithRequestIdAsync(resourceGroupName, webServiceName, region), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult();
 }
 /// <summary>
 /// Gets the access keys for the specified web service.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Name of the resource group in which the web service is located.
 /// </param>
 /// <param name='webServiceName'>
 /// The name of the web service.
 /// </param>
 public static WebServiceKeys ListKeys(this IWebServicesOperations operations, string resourceGroupName, string webServiceName)
 {
     return(operations.ListKeysAsync(resourceGroupName, webServiceName).GetAwaiter().GetResult());
 }
 /// <summary>
 /// Get the access keys of a particular Azure ML web service
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Name of the resource group.
 /// </param>
 /// <param name='webServiceName'>
 /// The Azure ML web service name which you want to reach.
 /// </param>
 public static WebServiceKeys ListKeys(this IWebServicesOperations operations, string resourceGroupName, string webServiceName)
 {
     return(Task.Factory.StartNew(s => ((IWebServicesOperations)s).ListKeysAsync(resourceGroupName, webServiceName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
 /// <summary>
 /// Remove an existing Azure ML web service.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Name of the resource group.
 /// </param>
 /// <param name='webServiceName'>
 /// The Azure ML web service name which you want to reach.
 /// </param>
 public static void BeginRemove(this IWebServicesOperations operations, string resourceGroupName, string webServiceName)
 {
     Task.Factory.StartNew(s => ((IWebServicesOperations)s).BeginRemoveAsync(resourceGroupName, webServiceName), operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult();
 }
 /// <summary>
 /// Gets the web services in the specified 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 <WebService> ListBySubscriptionIdNext(this IWebServicesOperations operations, string nextPageLink)
 {
     return(operations.ListBySubscriptionIdNextAsync(nextPageLink).GetAwaiter().GetResult());
 }
 /// <summary>
 /// Deletes the specified web service.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Name of the resource group in which the web service is located.
 /// </param>
 /// <param name='webServiceName'>
 /// The name of the web service.
 /// </param>
 public static void BeginRemove(this IWebServicesOperations operations, string resourceGroupName, string webServiceName)
 {
     operations.BeginRemoveAsync(resourceGroupName, webServiceName).GetAwaiter().GetResult();
 }
 /// <summary>
 /// Gets the web services in the specified resource group.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Name of the resource group in which the web service is located.
 /// </param>
 /// <param name='skiptoken'>
 /// Continuation token for pagination.
 /// </param>
 public static IPage <WebService> ListByResourceGroup(this IWebServicesOperations operations, string resourceGroupName, string skiptoken = default(string))
 {
     return(operations.ListByResourceGroupAsync(resourceGroupName, skiptoken).GetAwaiter().GetResult());
 }
 /// <summary>
 /// Modifies an existing web service resource. The PATCH API call is an
 /// asynchronous operation. To determine whether it has completed successfully,
 /// you must perform a Get operation.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Name of the resource group in which the web service is located.
 /// </param>
 /// <param name='webServiceName'>
 /// The name of the web service.
 /// </param>
 /// <param name='patchPayload'>
 /// The payload to use to patch the web service.
 /// </param>
 public static WebService BeginPatch(this IWebServicesOperations operations, string resourceGroupName, string webServiceName, WebService patchPayload)
 {
     return(operations.BeginPatchAsync(resourceGroupName, webServiceName, patchPayload).GetAwaiter().GetResult());
 }
Beispiel #22
0
 /// <summary>
 /// Deletes the specified web service.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Name of the resource group in which the web service is located.
 /// </param>
 /// <param name='webServiceName'>
 /// The name of the web service.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task BeginRemoveAsync(this IWebServicesOperations operations, string resourceGroupName, string webServiceName, CancellationToken cancellationToken = default(CancellationToken))
 {
     (await operations.BeginRemoveWithHttpMessagesAsync(resourceGroupName, webServiceName, null, cancellationToken).ConfigureAwait(false)).Dispose();
 }
 /// <summary>
 /// Gets the Web Service Definition as specified by a subscription, resource
 /// group, and name. Note that the storage credentials and web service keys are
 /// not returned by this call. To get the web service access keys, call List
 /// Keys.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Name of the resource group in which the web service is located.
 /// </param>
 /// <param name='webServiceName'>
 /// The name of the web service.
 /// </param>
 /// <param name='region'>
 /// The region for which encrypted credential parameters are valid.
 /// </param>
 public static WebService Get(this IWebServicesOperations operations, string resourceGroupName, string webServiceName, string region = default(string))
 {
     return(operations.GetAsync(resourceGroupName, webServiceName, region).GetAwaiter().GetResult());
 }
Beispiel #24
0
 /// <summary>
 /// Creates an encrypted credentials parameter blob for the specified region.
 /// To get the web service from a region other than the region in which it has
 /// been created, you must first call Create Regional Web Services Properties
 /// to create a copy of the encrypted credential parameter blob in that region.
 /// You only need to do this before the first time that you get the web service
 /// in the new region.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Name of the resource group in which the web service is located.
 /// </param>
 /// <param name='webServiceName'>
 /// The name of the web service.
 /// </param>
 /// <param name='region'>
 /// The region for which encrypted credential parameters are created.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task <AsyncOperationStatusInner> BeginCreateRegionalPropertiesAsync(this IWebServicesOperations operations, string resourceGroupName, string webServiceName, string region, CancellationToken cancellationToken = default(CancellationToken))
 {
     using (var _result = await operations.BeginCreateRegionalPropertiesWithHttpMessagesAsync(resourceGroupName, webServiceName, region, null, cancellationToken).ConfigureAwait(false))
     {
         return(_result.Body);
     }
 }
 /// <summary>
 /// Remove an existing Azure ML web service.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Name of the resource group.
 /// </param>
 /// <param name='webServiceName'>
 /// The Azure ML web service name which you want to reach.
 /// </param>
 /// <param name='cancellationToken'>
 /// The cancellation token.
 /// </param>
 public static async Task RemoveWithRequestIdAsync(this IWebServicesOperations operations, string resourceGroupName, string webServiceName, CancellationToken cancellationToken = default(CancellationToken))
 {
     await operations.RemoveWebServiceWitProperRequestIdAsync(resourceGroupName, webServiceName, null, cancellationToken).ConfigureAwait(false);
 }
 /// <summary>
 /// Creates an encrypted credentials parameter blob for the specified region.
 /// To get the web service from a region other than the region in which it has
 /// been created, you must first call Create Regional Web Services Properties
 /// to create a copy of the encrypted credential parameter blob in that region.
 /// You only need to do this before the first time that you get the web service
 /// in the new region.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Name of the resource group in which the web service is located.
 /// </param>
 /// <param name='webServiceName'>
 /// The name of the web service.
 /// </param>
 /// <param name='region'>
 /// The region for which encrypted credential parameters are created.
 /// </param>
 public static AsyncOperationStatus BeginCreateRegionalProperties(this IWebServicesOperations operations, string resourceGroupName, string webServiceName, string region)
 {
     return(operations.BeginCreateRegionalPropertiesAsync(resourceGroupName, webServiceName, region).GetAwaiter().GetResult());
 }
 /// <summary>
 /// Gets the web services in the specified subscription.
 /// </summary>
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='skiptoken'>
 /// Continuation token for pagination.
 /// </param>
 public static IPage <WebService> ListBySubscriptionId(this IWebServicesOperations operations, string skiptoken = default(string))
 {
     return(operations.ListBySubscriptionIdAsync(skiptoken).GetAwaiter().GetResult());
 }