public static async Task<ServersResponseCollection> GetMcp2DeployedServers(
			this IComputeApiClient client,
			ServerListOptions options = null,
			PageableRequest pagingOptions = null)
		{
			return await client.ServerManagement.Server.GetMcp2DeployedServers(options, pagingOptions);
		}
예제 #2
0
        public async Task GetConsistencyGroups_PaginatedResponse()
        {
            var pagingOptions = new DD.CBU.Compute.Api.Contracts.Requests.PageableRequest
            {
                PageSize   = 3,
                PageNumber = 1,
                Order      = "sourceDataCenterId"
            };

            var baseUriBuilder = new UriBuilder(ApiUris.GetConsistencyGroups(accountId).ToString());

            baseUriBuilder.Query = "pageSize=3&pageNumber=1&orderBy=sourceDataCenterId";
            requestsAndResponses.Add(new Uri(baseUriBuilder.Host + baseUriBuilder.Uri.PathAndQuery, UriKind.Relative), RequestFileResponseType.AsGoodResponse("GetConsistencyGroupsPaginatedResponse.xml"));

            var client   = GetWebApiClient();
            var accessor = new ConsistencyGroupAccessor(client);

            var consistencyGroups = await accessor.GetConsistencyGroupsPaginated(null, pagingOptions);

            Assert.IsNotNull(consistencyGroups);
            Assert.AreEqual(3, consistencyGroups.pageCount);
            Assert.AreEqual(1, consistencyGroups.pageNumber);
            Assert.AreEqual(3, consistencyGroups.pageSize);
            Assert.AreEqual(8, consistencyGroups.totalCount);

            Assert.IsNotNull(consistencyGroups.items);
            Assert.AreEqual(3, consistencyGroups.items.Count());
        }
		/// <summary>
		/// The get mcp 2 deployed servers.
		/// </summary>
		/// <param name="options">
		/// The options.
		/// </param>
		/// <param name="pagingOptions">
		/// The paging options.
		/// </param>
		/// <returns>
		/// The <see cref="Task"/>.
		/// </returns>	
		public async Task<ServersResponseCollection> GetMcp2DeployedServers(
			ServerListOptions options = null,
			PageableRequest pagingOptions = null)
		{
			ServersResponseCollection servers =
				await
				_apiClient.GetAsync<ServersResponseCollection>(ApiUris.GetMcp2Servers(_apiClient.OrganizationId), pagingOptions);
			return servers;
		}
		/// <summary>
		/// 	The get VLAN list. 
		/// </summary>		
		/// <param name="id">
		/// 			  	The id. 
		/// </param>
		/// <param name="vlanName">
		/// 		  	The VLAN name. 
		/// </param>
		/// <param name="networkDomainId">
		/// 	The network domain id. 
		/// </param>
		/// <param name="pagingOptions">
		/// The paging Options.
		/// </param>
		/// <returns>
		/// 	The <see cref="Task"/>. 
		/// </returns>
		public async Task<IEnumerable<VlanType>> GetVlans(Guid id, string vlanName, Guid networkDomainId, PageableRequest pagingOptions = null)
		{
			var vlans =
				await
				_api.GetAsync<vlans>(
					ApiUris.GetVlan(_api.OrganizationId, id, vlanName, networkDomainId), pagingOptions);

			return vlans.vlan;
		}
		/// <summary>
		/// 	Retrieves the list of ACL rules associated with a network. This API requires your
		/// 	organization ID and the ID of the target network.
		/// </summary>		
		/// <param name="options">
		/// 			Options for controlling the operation. 
		/// </param>
		/// <param name="pagingOptions">
		/// 	Options for controlling the paging. 
		/// </param>
		/// <returns>
		/// 	The VLAN collection. 
		/// </returns>
		public async Task<IEnumerable<VlanType>> GetVlans(VlanListOptions options = null, PageableRequest pagingOptions = null)
		{
			var vlans =
				await
				_api.GetAsync<vlans>(
					ApiUris.GetVlanByOrgId(_api.OrganizationId), pagingOptions);

			return vlans.vlan;
		}
		public static async Task<IEnumerable<NetworkDomainType>> GetNetworkDomain(this IComputeApiClient client, Guid networkDomainId, string networkName, PageableRequest pagingOptions = null)
		{
			return await client.Networking.NetworkDomain.GetNetworkDomain(networkDomainId, networkName, pagingOptions);
		}
		public static async Task<IEnumerable<NetworkDomainType>> GetNetworkDomains(this IComputeApiClient client, PageableRequest pagingOptions = null)
		{
			return await client.Networking.NetworkDomain.GetNetworkDomains(pagingOptions);
		}
		public static async Task<IEnumerable<VlanType>> GetVlans(this IComputeApiClient client, Guid id, string vlanName, Guid networkDomainId, PageableRequest pagingOptions = null)
		{
			return await client.Networking.Vlan.GetVlans(id, vlanName, networkDomainId, pagingOptions);
		}
		public static async Task<IEnumerable<VlanType>> GetVlans(this IComputeApiClient client, VlanListOptions options = null, PageableRequest pagingOptions = null)
		{
			return await client.Networking.Vlan.GetVlans(options, pagingOptions);
		}
		/// <summary>
		/// 	This function gets list of network domains from Cloud. 
		/// </summary>
		/// <param name="networkDomainId">
		/// 	Network domain id. 
		/// </param>
		/// <param name="networkName">
		/// 	  	The network Name. 
		/// </param>
		/// <param name="pagingOptions">
		/// 	Options for controlling the paging. 
		/// </param>
		/// <returns>
		/// 	The list of network domains associated with the organization. 
		/// </returns>
		public async Task<IEnumerable<NetworkDomainType>> GetNetworkDomain(Guid networkDomainId, string networkName, PageableRequest pagingOptions = null)
		{
			var networks = await _apiClient.GetAsync<networkDomains>(ApiUris.NetworkDomain(_apiClient.OrganizationId, networkDomainId, networkName), pagingOptions);
			return networks.networkDomain;
		}