public UsageAggregationManagementClient GetUsageAggregationManagementClient(RecordedDelegatingHandler handler)
        {
            handler.IsPassThrough = false;

            var token = new TokenCloudCredentials(Guid.NewGuid().ToString(), "abc123");
            UsageAggregationManagementClient client = new UsageAggregationManagementClient(token, new Uri("https://mn-azure/management/"));
            client = client.WithHandler(handler);
            return client;
        }
Example #2
0
        public UsageAggregationManagementClient GetUsageAggregationManagementClient(RecordedDelegatingHandler handler)
        {
            handler.IsPassThrough = false;

            var token = new TokenCloudCredentials(Guid.NewGuid().ToString(), "abc123");
            UsageAggregationManagementClient client = new UsageAggregationManagementClient(token, new Uri("https://mn-azure/management/"));

            client = client.WithHandler(handler);
            return(client);
        }
        public override void ExecuteCmdlet()
        {
            if (_theClient == null)
            {
                _theClient = AzureSession.ClientFactory.CreateClient <UsageAggregationManagementClient>(DefaultProfile.Context,
                                                                                                        AzureEnvironment.Endpoint.ResourceManager);
            }

            UsageAggregationGetResponse aggregations = _theClient.UsageAggregates.Get(ReportedStartTime,
                                                                                      ReportedEndTime, AggregationGranularity, ShowDetails,
                                                                                      ContinuationToken);

            WriteObject(aggregations);
        }
        public override void ExecuteCmdlet()
        {
            if (_theClient == null)
            {
                _theClient = AzureSession.ClientFactory.CreateClient<UsageAggregationManagementClient>(DefaultProfile.Context,
                    AzureEnvironment.Endpoint.ResourceManager);
            }

            UsageAggregationGetResponse aggregations = _theClient.UsageAggregates.Get(ReportedStartTime,
                ReportedEndTime, AggregationGranularity, ShowDetails,
                ContinuationToken);

            WriteObject(aggregations);
        }