/// <summary> /// Creates a new definition for a specified profile. (see /// http://msdn.microsoft.com/en-us/library/hh758257.aspx for more /// information) /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.WindowsAzure.Management.TrafficManager.IDefinitionOperations. /// </param> /// <param name='profileName'> /// Required. The name of the profile to create a new definition for. /// </param> /// <param name='parameters'> /// Required. Parameters supplied to the Create Definition operation. /// </param> /// <returns> /// A standard service response including an HTTP status code and /// request ID. /// </returns> public static OperationResponse Create(this IDefinitionOperations operations, string profileName, DefinitionCreateParameters parameters) { return(Task.Factory.StartNew((object s) => { return ((IDefinitionOperations)s).CreateAsync(profileName, parameters); } , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult()); }
/// <summary> /// Returns all definitions of a profile (see /// http://msdn.microsoft.com/en-us/library/hh758252.aspx for more /// information) /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.WindowsAzure.Management.TrafficManager.IDefinitionOperations. /// </param> /// <param name='profileName'> /// Required. The name of the profile to return all definitions /// </param> /// <returns> /// The List Definitions operation response. /// </returns> public static DefinitionsListResponse List(this IDefinitionOperations operations, string profileName) { return(Task.Factory.StartNew((object s) => { return ((IDefinitionOperations)s).ListAsync(profileName); } , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult()); }
/// <summary> /// Initializes a new instance of the TrafficManagerManagementClient /// class. /// </summary> /// <param name='httpClient'> /// The Http client /// </param> private TrafficManagerManagementClient(HttpClient httpClient) : base(httpClient) { this._definitions = new DefinitionOperations(this); this._profiles = new ProfileOperations(this); this._apiVersion = "2011-10-01"; this._longRunningOperationInitialTimeout = -1; this._longRunningOperationRetryTimeout = -1; this.HttpClient.Timeout = TimeSpan.FromSeconds(300); }
/// <summary> /// Creates a new definition for a specified profile. (see /// http://msdn.microsoft.com/en-us/library/hh758257.aspx for more /// information) /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.WindowsAzure.Management.TrafficManager.IDefinitionOperations. /// </param> /// <param name='profileName'> /// Required. The name of the profile to create a new definition for. /// </param> /// <param name='parameters'> /// Required. Parameters supplied to the Create Definition operation. /// </param> /// <returns> /// A standard service response including an HTTP status code and /// request ID. /// </returns> public static Task <OperationResponse> CreateAsync(this IDefinitionOperations operations, string profileName, DefinitionCreateParameters parameters) { return(operations.CreateAsync(profileName, parameters, CancellationToken.None)); }
/// <summary> /// Returns all definitions of a profile (see /// http://msdn.microsoft.com/en-us/library/hh758252.aspx for more /// information) /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.WindowsAzure.Management.TrafficManager.IDefinitionOperations. /// </param> /// <param name='profileName'> /// Required. The name of the profile to return all definitions /// </param> /// <returns> /// The List Definitions operation response. /// </returns> public static Task <DefinitionsListResponse> ListAsync(this IDefinitionOperations operations, string profileName) { return(operations.ListAsync(profileName, CancellationToken.None)); }