Ejemplo n.º 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);
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Gets the public offers under the zero day (root) provider
 /// </summary>
 /// <param name='operations'>
 /// Reference to the Microsoft.AzureStack.Management.IOfferOperations.
 /// </param>
 /// <returns>
 /// Result of the offer
 /// </returns>
 public static OfferListResult ListUnderRootProvider(this IOfferOperations operations)
 {
     return(Task.Factory.StartNew((object s) =>
     {
         return ((IOfferOperations)s).ListUnderRootProviderAsync();
     }
                                  , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Lists the offer with the next link
 /// </summary>
 /// <param name='operations'>
 /// Reference to the Microsoft.AzureStack.Management.IOfferOperations.
 /// </param>
 /// <param name='nextLink'>
 /// Required. The URL to get the next set of offers
 /// </param>
 /// <returns>
 /// Result of the offer
 /// </returns>
 public static OfferListResult ListNext(this IOfferOperations operations, string nextLink)
 {
     return(Task.Factory.StartNew((object s) =>
     {
         return ((IOfferOperations)s).ListNextAsync(nextLink);
     }
                                  , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Gets the price of the offer.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the Microsoft.AzureStack.Management.IOfferOperations.
 /// </param>
 /// <param name='offerId'>
 /// Required. the full offer ID
 /// /delegatedProviders/{providerId}/offers/{offerId}.
 /// </param>
 /// <returns>
 /// Offer price result.
 /// </returns>
 public static OfferGetPriceResult GetPrice(this IOfferOperations operations, string offerId)
 {
     return(Task.Factory.StartNew((object s) =>
     {
         return ((IOfferOperations)s).GetPriceAsync(offerId);
     }
                                  , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult());
 }
Ejemplo n.º 5
0
        public override void Execute(IOfferOperations dsl, ConDepSettings settings)
        {
            dsl.Local.HttpGet("http://www.con-dep.net");
            dsl.Remote(server =>
            {
                server
                .Configure.IIS();

                server
                .Execute.PowerShell("ipconfig");
            });
            dsl.Local.HttpGet("http://blog.torresdal.net");
        }
Ejemplo n.º 6
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);
 }
Ejemplo n.º 7
0
 /// <summary>
 /// Gets an offer given its Id.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the Microsoft.AzureStack.Management.IOfferOperations.
 /// </param>
 /// <param name='offerId'>
 /// Required. The full offer Id in format
 /// /delegatedProviders/{providerId}/offers/{offerName}
 /// </param>
 /// <returns>
 /// The offer get result.
 /// </returns>
 public static Task <OfferGetResult> GetAsync(this IOfferOperations operations, string offerId)
 {
     return(operations.GetAsync(offerId, CancellationToken.None));
 }
Ejemplo n.º 8
0
 /// <summary>
 /// Gets the public offers under the zero day (root) provider
 /// </summary>
 /// <param name='operations'>
 /// Reference to the Microsoft.AzureStack.Management.IOfferOperations.
 /// </param>
 /// <returns>
 /// Result of the offer
 /// </returns>
 public static Task <OfferListResult> ListUnderRootProviderAsync(this IOfferOperations operations)
 {
     return(operations.ListUnderRootProviderAsync(CancellationToken.None));
 }
Ejemplo n.º 9
0
 /// <summary>
 /// Lists the offer with the next link
 /// </summary>
 /// <param name='operations'>
 /// Reference to the Microsoft.AzureStack.Management.IOfferOperations.
 /// </param>
 /// <param name='nextLink'>
 /// Required. The URL to get the next set of offers
 /// </param>
 /// <returns>
 /// Result of the offer
 /// </returns>
 public static Task <OfferListResult> ListNextAsync(this IOfferOperations operations, string nextLink)
 {
     return(operations.ListNextAsync(nextLink, CancellationToken.None));
 }
Ejemplo n.º 10
0
 /// <summary>
 /// Gets the public offers under the provider which has the given
 /// provider identifier
 /// </summary>
 /// <param name='operations'>
 /// Reference to the Microsoft.AzureStack.Management.IOfferOperations.
 /// </param>
 /// <param name='providerIdentifier'>
 /// Required. The provider identifier, we get the public offers under
 /// that provider.
 /// </param>
 /// <returns>
 /// Result of the offer
 /// </returns>
 public static Task <OfferListResult> ListAsync(this IOfferOperations operations, string providerIdentifier)
 {
     return(operations.ListAsync(providerIdentifier, CancellationToken.None));
 }
Ejemplo n.º 11
0
 public override void Execute(IOfferOperations dsl, ConDepSettings settings)
 {
     //OnlyIf is removed from the newwst ConDep.Dsl
     throw new System.NotImplementedException();
 }
Ejemplo n.º 12
0
        /// <summary>
        /// Will execute a Runbook of given type T. Use this if you want to execute a Runbook from another Runbook.
        /// </summary>
        /// <typeparam name="T">Runbook type</typeparam>
        /// <param name="dsl">The ConDep DSL</param>
        /// <param name="settings">The ConDep settings</param>
        public static void Execute <T>(IOfferOperations dsl, ConDepSettings settings) where T : Runbook, new()
        {
            var runbook = new T();

            runbook.Execute(dsl, settings);
        }
Ejemplo n.º 13
0
 public override void Execute(IOfferOperations dsl, ConDepSettings settings)
 {
 }
Ejemplo n.º 14
0
        public override void Execute(IOfferOperations dsl, ConDepSettings settings)
        {
            const string location = "West Europe";

            dsl.Local.Azure(azure => azure.ResourceGroup.CreateResourceGroup("resourcegroup-name", location));
        }
Ejemplo n.º 15
0
 public override void Execute(IOfferOperations dsl, ConDepSettings settings)
 {
     dsl.Remote(x => x.Execute.PowerShell("asdlfkj"));
 }
Ejemplo n.º 16
0
 public abstract void Execute(IOfferOperations dsl, ConDepSettings settings);
Ejemplo n.º 17
0
 public override void Execute(IOfferOperations dsl, ConDepSettings settings)
 {
     const string location = "West Europe";
     dsl.Local.Azure(azure => azure.ResourceGroup.CreateResourceGroup("resourcegroup-name", location));
 }
Ejemplo n.º 18
0
 public override void Execute(IOfferOperations dsl, ConDepSettings settings)
 {
 }