コード例 #1
0
        private void Configure()
        {
            configuration = new Configuration
            {
                Username = "******",
                Password = "******",
            };

            dcApi       = new DataCenterApi(configuration);
            volumeApi   = new VolumeApi(configuration);
            snapshotApi = new SnapshotApi(configuration);
            //Create a datacenter.
            if (datacenter == null)
            {
                datacenter = new Datacenter
                {
                    Properties = new DatacenterProperties
                    {
                        Name        = ".Net V2 - Test " + DateTime.Now.ToShortTimeString(),
                        Description = "Unit test for .Net SDK PB REST V2",
                        Location    = "us/lasdev"
                    }
                };

                datacenter = dcApi.Create(datacenter);
            }

            if (volume == null)
            {
                volume = new Volume
                {
                    Properties = new VolumeProperties
                    {
                        Size        = 1,
                        LicenceType = "LINUX",
                        Type        = "HDD",
                        Name        = ".Net V2 - Test " + DateTime.Now.ToShortTimeString(),
                    }
                };
                volume = volumeApi.Create(datacenter.Id, volume);
                DoWait(volume.Request);
            }
        }
コード例 #2
0
 public static async Task <IWeatherResult> GetWeatherAsync(this ISnapshotApi api, GoogleApiClient client)
 {
     return((await api.GetWeather(client)).JavaCast <IWeatherResult> ());
 }
コード例 #3
0
 public static async Task <IPlacesResult> GetPlacesAsync(this ISnapshotApi api, GoogleApiClient client)
 {
     return((await api.GetPlaces(client)).JavaCast <IPlacesResult> ());
 }
コード例 #4
0
 public static async Task <ILocationResult> GetLocationAsync(this ISnapshotApi api, GoogleApiClient client)
 {
     return((await api.GetLocation(client)).JavaCast <ILocationResult> ());
 }
コード例 #5
0
 public static async Task <IHeadphoneStateResult> GetHeadphoneStateAsync(this ISnapshotApi api, GoogleApiClient client)
 {
     return((await api.GetHeadphoneState(client)).JavaCast <IHeadphoneStateResult> ());
 }
コード例 #6
0
 public static async Task <IDetectedActivityResult> GetDetectedActivityAsync(this ISnapshotApi api, GoogleApiClient client)
 {
     return((await api.GetDetectedActivity(client)).JavaCast <IDetectedActivityResult> ());
 }
コード例 #7
0
 public static async Task <IBeaconStateResult> GetBeaconStateAsync(this ISnapshotApi api, GoogleApiClient client, System.Collections.Generic.ICollection <BeaconStateTypeFilter> beaconTypes)
 {
     return((await api.GetBeaconState(client)).JavaCast <IBeaconStateResult> ());
 }
コード例 #8
0
 public static async Task <IBeaconStateResult> GetBeaconStateAsync(this ISnapshotApi api, GoogleApiClient client, BeaconStateTypeFilter [] beaconTypes)
 {
     return((await api.GetBeaconState(client)).JavaCast <IBeaconStateResult> ());
 }
コード例 #9
0
        private void Configure()
        {
            configuration = new Configuration
            {
                Username = "******",
                Password = "******",
            };

            dcApi = new DataCenterApi(configuration);
            volumeApi = new VolumeApi(configuration);
            snapshotApi = new SnapshotApi(configuration);
            //Create a datacenter.
            if (datacenter == null)
            {
                datacenter = new Datacenter
                {
                    Properties = new DatacenterProperties
                    {
                        Name = ".Net V2 - Test " + DateTime.Now.ToShortTimeString(),
                        Description = "Unit test for .Net SDK PB REST V2",
                        Location = "us/lasdev"
                    }
                };

                datacenter = dcApi.Create(datacenter);
            }

            if (volume == null)
            {
                volume = new Volume
                {
                    Properties = new VolumeProperties
                    {
                        Size = 1,
                        LicenceType = "LINUX",
                        Type = "HDD",
                        Name = ".Net V2 - Test " + DateTime.Now.ToShortTimeString(),
                    }
                };
                volume = volumeApi.Create(datacenter.Id, volume);
                DoWait(volume.Request);
            }
        }
コード例 #10
0
 public QueueCheckJob(IQueue queue,
                      ISnapshotApi snapshot)
 {
     _queue    = queue;
     _snapshot = snapshot;
 }