Пример #1
0
        /// <summary>
        /// The get data centers with maintenance statuses.
        /// </summary>
        /// <param name="pagingOptions">
        /// The paging options.
        /// </param>
        /// <param name="filterOptions">
        /// The Filter options
        /// </param>
        /// <returns>
        /// The <see cref="Task"/>.
        /// </returns>
        public async Task <IEnumerable <DatacenterType> > GetDataCenters(IPageableRequest pagingOptions = null, DataCenterListOptions filterOptions = null)
        {
            datacenters dataCenters = await _apiClient.GetAsync <datacenters>(
                ApiUris.DataCentres(_apiClient.OrganizationId), pagingOptions, filterOptions);

            return(dataCenters.datacenter);
        }
Пример #2
0
        /// <summary>
        /// The get networks task.
        /// </summary>
        /// <returns>
        /// The <see cref="Task"/>.
        /// </returns>
        public async Task <IEnumerable <NetworkWithLocationsNetwork> > GetNetworks()
        {
            NetworkWithLocations networks =
                await _apiClient.GetAsync <NetworkWithLocations>(ApiUris.NetworkWithLocations(_apiClient.OrganizationId));

            return(networks.Items);
        }
Пример #3
0
 /// <summary>
 /// The get ovf packages.
 /// </summary>
 /// <returns>
 /// The <see cref="Task"/>.
 /// </returns>
 public async Task <OvfPackages> GetOvfPackages()
 {
     return
         (await
          _apiClient.GetAsync <OvfPackages>(
              ApiUris.GetOvfPackages(_apiClient.OrganizationId)));
 }
        /// <summary>
        /// The get images.
        /// </summary>
        /// <param name="imageId">
        /// The image id.
        /// </param>
        /// <param name="name">
        /// The name.
        /// </param>
        /// <param name="location">
        /// The location.
        /// </param>
        /// <param name="operatingSystemId">
        /// The operating system id.
        /// </param>
        /// <param name="operatingSystemFamily">
        /// The operating system family.
        /// </param>
        /// <returns>
        /// The <see cref="Task"/>.
        /// </returns>
        public async Task <IReadOnlyList <ImagesWithDiskSpeedImage> > GetImages(
            string imageId,
            string name,
            string location,
            string operatingSystemId,
            string operatingSystemFamily)
        {
            ImagesWithDiskSpeed imagesWithDiskSpeed =
                await
                _apiClient.GetAsync <ImagesWithDiskSpeed>(
                    ApiUris.ImagesWithDiskSpeed(
                        _apiClient.OrganizationId,
                        ServerImageType.OS,
                        imageId,
                        name,
                        location,
                        operatingSystemId,
                        operatingSystemFamily));

            if (imagesWithDiskSpeed == null)
            {
                return(null);
            }
            if (imagesWithDiskSpeed.image == null)
            {
                return(null);
            }

            return(imagesWithDiskSpeed.image);
        }
Пример #5
0
        /// <summary>	Gets public IP blocks. </summary>
        /// <param name="networkDomainId">	Identifier for the network domain. </param>
        /// <param name="paging">		    The paging options, null means default. </param>
        /// <returns>	The public IP blocks. </returns>
        /// <seealso cref="M:DD.CBU.Compute.Api.Client.Interfaces.IIpam.GetPublicIpBlocks(string,IPageableRequest)"/>
        public async Task <IEnumerable <PublicIpBlockType> > GetPublicIpBlocks(string networkDomainId, IPageableRequest paging = null)
        {
            var response =
                await
                _apiClient.GetAsync <publicIpBlocks>(ApiUris.GetPublicIpBlocks(_apiClient.OrganizationId));

            return(response.publicIpBlock);
        }
Пример #6
0
        public async Task <ServersResponseCollection> GetMcp2DeployedServers(ServerListOptions filteringOptions = null, IPageableRequest pagingOptions = null)
        {
            ServersResponseCollection servers = await _apiClient.GetAsync <ServersResponseCollection>(
                ApiUris.GetMcp2Servers(_apiClient.OrganizationId),
                pagingOptions,
                filteringOptions);

            return(servers);
        }
        /// <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);
        }
        /// <summary>
        /// Retrieves a CSV-formatted daily usage report of the sum total usage across the account.
        /// </summary>
        /// <param name="startDate">The Start Date</param>
        /// <param name="endDate">The End Date</param>
        /// <returns>The CSV formatted result</returns>
        public async Task <string> GetSummaryUsage(DateTime startDate, DateTime endDate)
        {
            var data =
                await
                _apiClient.GetAsync <string>(ApiUris.SummaryUsageReport(_apiClient.OrganizationId, startDate, endDate));

            return(data);
        }
        /// <summary>The get tag keys paginated.</summary>
        /// <param name="tagKeyListOptions">The tag key list options.</param>
        /// <param name="paginngOptions">The paginng options.</param>
        /// <returns>The <see cref="Task"/>.</returns>
        public async Task <PagedResponse <TagKeyType> > GetTagKeysPaginated(TagKeyListOptions tagKeyListOptions = null, IPageableRequest paginngOptions = null)
        {
            var response = await _apiClient.GetAsync <tagKeys>(ApiUris.ListTagKeys(_apiClient.OrganizationId), paginngOptions, tagKeyListOptions);

            return(new PagedResponse <TagKeyType>
            {
                items = response.tagKey,
                totalCount = response.totalCountSpecified ? response.totalCount : (int?)null,
                pageCount = response.pageCountSpecified ? response.pageCount : (int?)null,
                pageNumber = response.pageNumberSpecified ? response.pageNumber : (int?)null,
                pageSize = response.pageSizeSpecified ? response.pageSize : (int?)null
            });
        }
        /// <summary>
        /// The Get Consistency Group menthod.
        /// </summary>
        /// <param name="filteringOptions">The filtering options.</param>
        /// <param name="pagingOptions">The pagination options.</param>
        /// <returns>Paginated result of <see cref="ConsistencyGroupType"/></returns>
        public async Task <PagedResponse <ConsistencyGroupType> > GetConsistencyGroupsPaginated(ConsistencyGroupListOptions filteringOptions = null, PageableRequest pagingOptions = null)
        {
            var response = await _apiClient.GetAsync <consistencyGroups>(ApiUris.GetConsistencyGroups(_apiClient.OrganizationId), pagingOptions, filteringOptions);

            return(new PagedResponse <ConsistencyGroupType>
            {
                items = response.consistencyGroup,
                totalCount = response.totalCountSpecified ? response.totalCount : (int?)null,
                pageCount = response.pageCountSpecified ? response.pageCount : (int?)null,
                pageNumber = response.pageNumberSpecified ? response.pageNumber : (int?)null,
                pageSize = response.pageSizeSpecified ? response.pageSize : (int?)null
            });
        }
Пример #11
0
        /// <summary>
        /// Retrieves the list of the NAT Rules on a particular Network Domain at an MCP 2.0 data center
        /// This API requires your organization ID and the ID of the target network.
        /// </summary>
        /// <param name="networkDomainId">  Identifier for the network domain.</param>
        /// <param name="options">          Options for filtering the operations.</param>
        /// <param name="pagingOptions">    The paging options, null means default.</param>
        /// <returns>                       The NAT Rule collection.</returns>
        public async Task <PagedResponse <NatRuleType> > GetNatRulesPaginated(Guid networkDomainId, NatRuleListOptions options = null, PageableRequest pagingOptions = null)
        {
            var response = await _api.GetAsync <natRules>(ApiUris.GetDomainNatRules(_api.OrganizationId, networkDomainId.ToString()), pagingOptions, options);

            return(new PagedResponse <NatRuleType>
            {
                items = response.natRule,
                totalCount = response.totalCountSpecified ? response.totalCount : (int?)null,
                pageCount = response.pageCountSpecified ? response.pageCount : (int?)null,
                pageNumber = response.pageNumberSpecified ? response.pageNumber : (int?)null,
                pageSize = response.pageSizeSpecified ? response.pageSize : (int?)null
            });
        }
Пример #12
0
        /// <summary>
        /// Retrieves default health monitors.
        /// </summary>
        /// <param name="networkDomainId">The network domain id</param>
        /// <param name="options">The filter options</param>
        /// <param name="pagingOptions">The paging options</param>
        /// <returns>The async task of <see cref="PagedResponse{DefaultHealthMonitorType}"/></returns>
        public async Task <PagedResponse <DefaultHealthMonitorType> > GetDefaultHealthMonitorsPaginated(Guid networkDomainId, DefaultHealthMonitorListOptions options = null, PageableRequest pagingOptions = null)
        {
            var response = await _api.GetAsync <defaultHealthMonitors>(ApiUris.GetDefaultHealthMonitors(_api.OrganizationId, networkDomainId), pagingOptions, options);

            return(new PagedResponse <DefaultHealthMonitorType>
            {
                items = response.defaultHealthMonitor,
                totalCount = response.totalCountSpecified ? response.totalCount : (int?)null,
                pageCount = response.pageCountSpecified ? response.pageCount : (int?)null,
                pageNumber = response.pageNumberSpecified ? response.pageNumber : (int?)null,
                pageSize = response.pageSizeSpecified ? response.pageSize : (int?)null
            });
        }
        /// <summary>
        /// Retrieves all of the VirtualListeners on a particular Network Domain at an MCP 2.0 data center.
        /// </summary>
        /// <param name="options">The filter options</param>
        /// <param name="pagingOptions"> The paging Options.</param>
        /// <returns>The async task of <see cref="PagedResponse{VirtualListenerType}"/></returns>
        public async Task <PagedResponse <VirtualListenerType> > GetVirtualListenersPaginated(VirtualListenerListOptions options = null, PageableRequest pagingOptions = null)
        {
            var response = await _api.GetAsync <virtualListeners>(ApiUris.GetVirtualListeners(_api.OrganizationId), pagingOptions, options);

            return(new PagedResponse <VirtualListenerType>
            {
                items = response.virtualListener,
                totalCount = response.totalCountSpecified ? response.totalCount : (int?)null,
                pageCount = response.pageCountSpecified ? response.pageCount : (int?)null,
                pageNumber = response.pageNumberSpecified ? response.pageNumber : (int?)null,
                pageSize = response.pageSizeSpecified ? response.pageSize : (int?)null
            });
        }
        /// <summary>
        /// The get network domains.
        /// </summary>
        /// <param name="filteringOptions">
        /// The filtering options.
        /// </param>
        /// <param name="pagingOptions">
        /// The paging options.
        /// </param>
        /// <returns>
        /// The <see cref="Task"/>.
        /// </returns>
        public async Task <PagedResponse <NetworkDomainType> > GetNetworkDomainsPaginated(NetworkDomainListOptions filteringOptions = null, PageableRequest pagingOptions = null)
        {
            var response = await _apiClient.GetAsync <networkDomains>(ApiUris.NetworkDomains(_apiClient.OrganizationId), pagingOptions, filteringOptions);

            return(new PagedResponse <NetworkDomainType>
            {
                items = response.networkDomain,
                totalCount = response.totalCountSpecified ? response.totalCount : (int?)null,
                pageCount = response.pageCountSpecified ? response.pageCount : (int?)null,
                pageNumber = response.pageNumberSpecified ? response.pageNumber : (int?)null,
                pageSize = response.pageSizeSpecified ? response.pageSize : (int?)null
            });
        }
        /// <summary>
        /// Gets the available anti affinity rules.
        /// </summary>
        /// <param name="filteringOptions">
        /// The filtering options.
        /// </param>
        /// <param name="pagingOptions">
        /// The paging options.
        /// </param>
        /// <returns>
        /// Collection of <see cref="AntiAffinityRuleType"/>.
        /// </returns>
        public async Task <PagedResponse <AntiAffinityRuleType> > GetAntiAffinityRulesPaginated(AntiAffinityRuleListOptions filteringOptions, IPageableRequest pagingOptions = null)
        {
            var response = await _apiClient.GetAsync <antiAffinityRules>(
                ApiUris.GetMcp2GetAntiAffinityRules(_apiClient.OrganizationId),
                pagingOptions,
                filteringOptions);

            return(new PagedResponse <AntiAffinityRuleType>
            {
                items = response.antiAffinityRule,
                totalCount = response.totalCountSpecified ? response.totalCount : (int?)null,
                pageCount = response.pageCountSpecified ? response.pageCount : (int?)null,
                pageNumber = response.pageNumberSpecified ? response.pageNumber : (int?)null,
                pageSize = response.pageSizeSpecified ? response.pageSize : (int?)null
            });
        }
        /// <summary>	Gets public IP blocks. </summary>
        /// <param name="networkDomainId">	Identifier for the network domain. </param>
        /// <param name="pagingOptions">	The paging options, null means default. </param>
        /// <param name="filterOptions">Filtering option</param>
        /// <returns>	The public IP blocks. </returns>
        public async Task <PagedResponse <PublicIpBlockType> > GetPublicIpBlocksPaginated(Guid networkDomainId, IPageableRequest pagingOptions = null, PublicIpListOptions filterOptions = null)
        {
            var response = await _apiClient.GetAsync <publicIpBlocks>(ApiUris.GetPublicIpBlocks(_apiClient.OrganizationId, networkDomainId.ToString()), pagingOptions, filterOptions);

            return(new PagedResponse <PublicIpBlockType>
            {
                items = response.publicIpBlock,
                totalCount = response.totalCountSpecified ? response.totalCount : (int?)null,
                pageCount = response.pageCountSpecified ? response.pageCount : (int?)null,
                pageNumber = response.pageNumberSpecified ? response.pageNumber : (int?)null,
                pageSize = response.pageSizeSpecified ? response.pageSize : (int?)null
            });
        }
Пример #17
0
        /// <summary>
        /// The get direction.
        /// </summary>
        /// <param name="origin">
        /// The origin.
        /// </param>
        /// <param name="destination">
        /// The destination.
        /// </param>
        /// <returns>
        /// The <see cref="Task"/>.
        /// </returns>
        public async Task <DirectionResponse> GetDirection(string origin, string destination)
        {
            var queryParams = new NameValueCollection {
                { "origin", origin }, { "destination", destination }
            };

            return(await _webApi.GetAsync <DirectionResponse>(EndPointUris.Directions, queryParams));
        }
Пример #18
0
        /// <summary>
        /// </summary>
        /// <param name="address">
        /// The Place ID of the Place for which details are being requested.
        /// </param>
        /// <returns>
        /// The <see cref="Task"/>.
        /// </returns>
        public async Task <GeocodingResponse> Geocode(string address)
        {
            var queryParams = new NameValueCollection {
                { "address", address }
            };

            return(await _webApi.GetAsync <GeocodingResponse>(EndPointUris.Geocode, queryParams));
        }
Пример #19
0
        public async Task <PagedResponse <SecurityGroupType> > GetSecurityGroupsPaged(Guid?vlanId, Guid?serverId, PageableRequest pagingOptions = null,
                                                                                      SecurityGroupListOptions filterOptions = null)
        {
            if (vlanId == null && serverId == null)
            {
                throw new ArgumentException("Both vlanId and serverId cannot be null, atleast provide one");
            }

            var response = await _api.GetAsync <securityGroups>(serverId.HasValue?ApiUris.GetSecurityGroupForServer(_api.OrganizationId, serverId.Value) :  ApiUris.GetSecurityGroupForVlan(_api.OrganizationId, vlanId.Value), pagingOptions, filterOptions);

            return(new PagedResponse <SecurityGroupType>
            {
                items = response.securityGroup,
                totalCount = response.totalCountSpecified ? response.totalCount : (int?)null,
                pageCount = response.pageCountSpecified ? response.pageCount : (int?)null,
                pageNumber = response.pageNumberSpecified ? response.pageNumber : (int?)null,
                pageSize = response.pageSizeSpecified ? response.pageSize : (int?)null
            });
        }
Пример #20
0
        /// <summary>The get mcp 2 deployed servers.</summary>
        /// <param name="serverId">The serve Id</param>
        /// <param name="filteringOptions">The filtering options.</param>
        /// <param name="pagingOptions">The paging options.</param>
        /// <returns>The <see cref="Task"/>.</returns>
        public async Task <PagedResponse <SnapshotType> > GetSnapshotsPaginated(Guid serverId, SnapshotListOptions filteringOptions = null, IPageableRequest pagingOptions = null)
        {
            if (serverId == Guid.Empty)
            {
                throw new ArgumentNullException("serverId");
            }
            var response = await _apiClient.GetAsync <snapshots>(
                ApiUris.ListSnapshots(_apiClient.OrganizationId, serverId),
                pagingOptions,
                filteringOptions);

            return(new PagedResponse <SnapshotType>
            {
                items = response.snapshot,
                totalCount = response.totalCountSpecified ? response.totalCount : (int?)null,
                pageCount = response.pageCountSpecified ? response.pageCount : (int?)null,
                pageNumber = response.pageNumberSpecified ? response.pageNumber : (int?)null,
                pageSize = response.pageSizeSpecified ? response.pageSize : (int?)null
            });
        }
        /// <summary>
        /// Lists all firewall rules.
        /// </summary>
        /// <param name="options">The filter options.</param>
        /// <param name="pagingOptions">The paging options.</param>
        /// <returns>The async task of <see cref="PagedResponse{FirewallRuleType}"/></returns>
        public async Task <PagedResponse <FirewallRuleType> > GetFirewallRulesPaginated(FirewallRuleListOptions options = null, PageableRequest pagingOptions = null)
        {
            var response = await _api.GetAsync <firewallRules>(ApiUris.GetFirewallRules(_api.OrganizationId), pagingOptions, options);

            return(new PagedResponse <FirewallRuleType>
            {
                items = response.firewallRule,
                totalCount = response.totalCountSpecified ? response.totalCount : (int?)null,
                pageCount = response.pageCountSpecified ? response.pageCount : (int?)null,
                pageNumber = response.pageNumberSpecified ? response.pageNumber : (int?)null,
                pageSize = response.pageSizeSpecified ? response.pageSize : (int?)null
            });
        }
 /// <summary>
 /// The Get Organization
 /// </summary>
 /// <returns>Geo Regions</returns>
 public async Task <organization> GetOrganization()
 {
     return(await _apiClient.GetAsync <organization>(ApiUris.GetOrganization(_apiClient.OrganizationId)));
 }
Пример #23
0
 /// <summary>
 /// Gets the monitoring usage report.
 /// </summary>
 /// <param name="startDate">The start date.</param>
 /// <param name="endDate">The end date.</param>
 /// <returns>The usage report as CSV.</returns>
 public async Task <string> GetMonitoringUsageReport(DateTime startDate, DateTime?endDate = null)
 {
     return(await _apiClient.GetAsync <string>(
                ApiUris.GetMonitoringUsageReport(_apiClient.OrganizationId, startDate, endDate)));
 }
Пример #24
0
		/// <summary>
		/// The get network domains.
		/// </summary>
		/// <param name="pagingOptions">
		/// The paging options.
		/// </param>
		/// <returns>
		/// The <see cref="Task"/>.
		/// </returns>
		public async Task<IEnumerable<NetworkDomainType>> GetNetworkDomains(PageableRequest pagingOptions = null)
		{
			var networks = await _apiClient.GetAsync<networkDomains>(ApiUris.NetworkDomains(_apiClient.OrganizationId), pagingOptions);
			return networks.networkDomain;
		}
Пример #25
0
        /// <summary>
        /// The get deployed servers.
        /// </summary>
        /// <param name="serverId">
        /// The server Id.
        /// </param>
        /// <param name="name">
        /// The name.
        /// </param>
        /// <param name="networkId">
        /// The network id.
        /// </param>
        /// <param name="location">
        /// The location.
        /// </param>
        /// <returns>
        /// The <see cref="Task"/>.
        /// </returns>
        public async Task <IEnumerable <ServerWithBackupType> > GetDeployedServers(
            string serverId,
            string name,
            string networkId,
            string location)
        {
            ServersWithBackup servers =
                await
                _apiClient.GetAsync <ServersWithBackup>(
                    ApiUris.DeployedServers(_apiClient.OrganizationId, serverId, name, networkId, location));

            return(servers.server);
        }
        /// <summary>
        /// The get accounts.
        /// </summary>
        /// <returns>
        /// The <see cref="Task"/>.
        /// </returns>
        public async Task <IEnumerable <Account> > GetAccounts()
        {
            Accounts accounts = await _apiClient.GetAsync <Accounts>(ApiUris.Account(_apiClient.OrganizationId));

            return(accounts.Items);
        }
Пример #27
0
 /// <summary>
 /// The disable backup.
 /// </summary>
 /// <param name="serverId">
 /// The server id.
 /// </param>
 /// <returns>
 /// The <see cref="Task"/>.
 /// </returns>
 public async Task <Status> DisableBackup(string serverId)
 {
     return(await _apiClient.GetAsync <Status>(ApiUris.DisableBackup(_apiClient.OrganizationId, serverId)));
 }
 /// <summary>
 /// Get OS Image
 /// </summary>
 /// <param name="imageId">Image Identifier</param>
 /// <returns>OS Image</returns>
 public async Task <OsImageType> GetOsImage(Guid imageId)
 {
     return(await _apiClient.GetAsync <OsImageType>(
                ApiUris.GetMcp2OsImage(_apiClient.OrganizationId, imageId)));
 }
Пример #29
0
        /// <summary>
        /// </summary>
        /// <param name="placeId">
        /// The Place ID of the Place for which details are being requested.
        /// </param>
        /// <returns>
        /// The <see cref="Task"/>.
        /// </returns>
        public async Task <PlaceDetailsResponse> Details(string placeId)
        {
            var queryParams = new NameValueCollection {
                { "placeid", placeId }
            };

            return(await _webApi.GetAsync <PlaceDetailsResponse>(EndPointUris.PlaceSearchDetails, queryParams));
        }
Пример #30
0
 /// <summary>
 /// Get SSL Domain Certificate for given Id.
 /// </summary>
 /// <param name="sslDomainCertificateId">The SSL Domain Certificate Id</param>
 /// <returns>The SSL Domain Certificate/></returns>
 public async Task <SslDomainCertificateType> GetSslDomainCertificate(Guid sslDomainCertificateId)
 {
     return(await _apiClient.GetAsync <SslDomainCertificateType>(
                ApiUris.GetSslDomainCertificate(_apiClient.OrganizationId, sslDomainCertificateId)));
 }