示例#1
0
 /// <summary>
 /// Initializes a new instance of the AzureStackClient class.
 /// </summary>
 /// <param name='httpClient'>
 /// The Http client
 /// </param>
 public AzureStackClient(HttpClient httpClient)
     : base(httpClient)
 {
     this._clouds          = new CloudOperations(this);
     this._curation        = new CurationOperations(this);
     this._delegatedOffers = new DelegatedOfferOperations(this);
     this._delegatedProviderConfiguration = new DelegatedProviderConfigurationOperations(this);
     this._eventTypes            = new EventTypesOperations(this);
     this._extensionsMetadata    = new ExtensionMetadataOperations(this);
     this._galleryItem           = new GalleryItemOperations(this);
     this._importedSubscriptions = new ImportedSubscriptionOperations(this);
     this._managedLocations      = new ManagedLocationOperations(this);
     this._managedOffers         = new ManagedOfferOperations(this);
     this._managedPlans          = new ManagedPlanOperations(this);
     this._managedSubscriptions  = new ManagedSubscriptionOperations(this);
     this._offers  = new OfferOperations(this);
     this._package = new PackageOperations(this);
     this._plans   = new PlanOperations(this);
     this._providerRegistrations = new ProviderRegistrationOperations(this);
     this._publicGalleryItem     = new PublicGalleryItemOperations(this);
     this._resourceGroups        = new ResourceGroupOperations(this);
     this._resources             = new ResourceOperations(this);
     this._resourceProviders     = new ResourceProviderOperations(this);
     this._shallowResources      = new ShallowResourceOperations(this);
     this._subscriptions         = new SubscriptionOperations(this);
     this.HttpClient.Timeout     = TimeSpan.FromSeconds(300);
 }
 /// <summary>
 /// Gets locations with the next link.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.AzureStack.Management.IManagedLocationOperations.
 /// </param>
 /// <param name='nextLink'>
 /// Required. The url to get the next set of results.
 /// </param>
 /// <returns>
 /// The location list result.
 /// </returns>
 public static ManagedLocationListResult ListNext(this IManagedLocationOperations operations, string nextLink)
 {
     return(Task.Factory.StartNew((object s) =>
     {
         return ((IManagedLocationOperations)s).ListNextAsync(nextLink);
     }
                                  , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
 /// <summary>
 /// Delete a location.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.AzureStack.Management.IManagedLocationOperations.
 /// </param>
 /// <param name='locationName'>
 /// Required. Name of location to delete.
 /// </param>
 /// <returns>
 /// A standard service response including an HTTP status code and
 /// request ID.
 /// </returns>
 public static AzureOperationResponse Delete(this IManagedLocationOperations operations, string locationName)
 {
     return(Task.Factory.StartNew((object s) =>
     {
         return ((IManagedLocationOperations)s).DeleteAsync(locationName);
     }
                                  , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
 /// <summary>
 /// Create / Update the location.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.AzureStack.Management.IManagedLocationOperations.
 /// </param>
 /// <param name='parameters'>
 /// Required. Location properties
 /// </param>
 /// <returns>
 /// The location update result.
 /// </returns>
 public static ManagedLocationCreateOrUpdateResult CreateOrUpdate(this IManagedLocationOperations operations, ManagedLocationCreateOrUpdateParameters parameters)
 {
     return(Task.Factory.StartNew((object s) =>
     {
         return ((IManagedLocationOperations)s).CreateOrUpdateAsync(parameters);
     }
                                  , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
示例#5
0
 /// <summary>
 /// Initializes a new instance of the AzureStackClient class.
 /// </summary>
 /// <param name='httpClient'>
 /// The Http client
 /// </param>
 public AzureStackClient(HttpClient httpClient)
     : base(httpClient)
 {
     this._curation             = new CurationOperations(this);
     this._extensionsMetadata   = new ExtensionMetadataOperations(this);
     this._galleryItem          = new GalleryItemOperations(this);
     this._managedLocations     = new ManagedLocationOperations(this);
     this._managedOffers        = new ManagedOfferOperations(this);
     this._managedPlans         = new ManagedPlanOperations(this);
     this._managedSubscriptions = new ManagedSubscriptionOperations(this);
     this._offers = new OfferOperations(this);
     this._plans  = new PlanOperations(this);
     this._providerRegistrations = new ProviderRegistrationOperations(this);
     this._publicGalleryItem     = new PublicGalleryItemOperations(this);
     this._resourceGroups        = new ResourceGroupOperations(this);
     this._subscriptions         = new SubscriptionOperations(this);
     this._usageConnections      = new UsageConnectionsOperations(this);
     this.HttpClient.Timeout     = TimeSpan.FromSeconds(300);
 }
 /// <summary>
 /// Create / Update the location.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.AzureStack.Management.IManagedLocationOperations.
 /// </param>
 /// <param name='parameters'>
 /// Required. Location properties
 /// </param>
 /// <returns>
 /// The location update result.
 /// </returns>
 public static Task <ManagedLocationCreateOrUpdateResult> CreateOrUpdateAsync(this IManagedLocationOperations operations, ManagedLocationCreateOrUpdateParameters parameters)
 {
     return(operations.CreateOrUpdateAsync(parameters, CancellationToken.None));
 }
 /// <summary>
 /// Gets locations with the next link.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.AzureStack.Management.IManagedLocationOperations.
 /// </param>
 /// <param name='nextLink'>
 /// Required. The url to get the next set of results.
 /// </param>
 /// <returns>
 /// The location list result.
 /// </returns>
 public static Task <ManagedLocationListResult> ListNextAsync(this IManagedLocationOperations operations, string nextLink)
 {
     return(operations.ListNextAsync(nextLink, CancellationToken.None));
 }
 /// <summary>
 /// Get locations under subscription.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.AzureStack.Management.IManagedLocationOperations.
 /// </param>
 /// <returns>
 /// The location list result.
 /// </returns>
 public static Task <ManagedLocationListResult> ListAsync(this IManagedLocationOperations operations)
 {
     return(operations.ListAsync(CancellationToken.None));
 }
 /// <summary>
 /// Get the location.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.AzureStack.Management.IManagedLocationOperations.
 /// </param>
 /// <param name='locationName'>
 /// Required. The location name.
 /// </param>
 /// <returns>
 /// Location get result.
 /// </returns>
 public static Task <ManagedLocationGetResult> GetAsync(this IManagedLocationOperations operations, string locationName)
 {
     return(operations.GetAsync(locationName, CancellationToken.None));
 }
 /// <summary>
 /// Delete a location.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.AzureStack.Management.IManagedLocationOperations.
 /// </param>
 /// <param name='locationName'>
 /// Required. Name of location to delete.
 /// </param>
 /// <returns>
 /// A standard service response including an HTTP status code and
 /// request ID.
 /// </returns>
 public static Task <AzureOperationResponse> DeleteAsync(this IManagedLocationOperations operations, string locationName)
 {
     return(operations.DeleteAsync(locationName, CancellationToken.None));
 }