예제 #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>
 /// Your documentation here.  (see
 /// http://msdn.microsoft.com/en-us/library/windowsazure/XXXXX.aspx
 /// for more information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the Microsoft.AzureStack.Management.IPackageOperations.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Required. Your documentation here.
 /// </param>
 /// <param name='packageId'>
 /// Required. Your documentation here.
 /// </param>
 /// <param name='azpkg'>
 /// Required. Your documentation here.
 /// </param>
 /// <returns>
 /// Your documentation here.
 /// </returns>
 public static PackageCreateOrUpdateResult CreateOrUpdate(this IPackageOperations operations, string resourceGroupName, string packageId, Stream azpkg)
 {
     return(Task.Factory.StartNew((object s) =>
     {
         return ((IPackageOperations)s).CreateOrUpdateAsync(resourceGroupName, packageId, azpkg);
     }
                                  , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
예제 #3
0
 /// <summary>
 /// Creates a new ServerFlex API client with an optional custom base URI.
 /// </summary>
 /// <param name="baseApiUri">The base URI to use for the API, or null for default.</param>
 public ApiClient(Uri baseApiUri = null)
     : base(baseApiUri)
 {
     _accountOperations       = ConstructAccountOpertaions();
     _regionOperations        = ConstructRegionOpertaions();
     _serverOperations        = ConstructServerOpertaions();
     _packageOperations       = ConstructPackageOpertaions();
     _serverSharingOperations = ConstructServerSharingOperations();
     _serverStatistics        = ConstructServerStatisticsOperations();
 }
 /// <summary>
 /// Your documentation here.  (see
 /// http://msdn.microsoft.com/en-us/library/windowsazure/XXXXX.aspx
 /// for more information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the Microsoft.AzureStack.Management.IPackageOperations.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Required. Your documentation here.
 /// </param>
 /// <param name='packageId'>
 /// Required. Your documentation here.
 /// </param>
 /// <param name='azpkg'>
 /// Required. Your documentation here.
 /// </param>
 /// <returns>
 /// Your documentation here.
 /// </returns>
 public static Task <PackageCreateOrUpdateResult> CreateOrUpdateAsync(this IPackageOperations operations, string resourceGroupName, string packageId, Stream azpkg)
 {
     return(operations.CreateOrUpdateAsync(resourceGroupName, packageId, azpkg, CancellationToken.None));
 }