1+ using System ;
2+ using System . Collections . Generic ;
3+ using System . Linq ;
4+ using System . Text ;
5+ using System . Threading . Tasks ;
6+
7+ using Amazon . PrometheusService ;
8+ using Amazon . PrometheusService . Model ;
9+
10+ namespace AWSSDKDocSamples . Amazon . PrometheusService . Generated
11+ {
12+ class PrometheusServiceSamples : ISample
13+ {
14+ public void PrometheusServiceCreateScraper ( )
15+ {
16+ #region example-1
17+
18+ var client = new AmazonPrometheusServiceClient ( ) ;
19+ var response = client . CreateScraper ( new CreateScraperRequest
20+ {
21+ Alias = "alias" ,
22+ ClientToken = "token" ,
23+ Destination = new Destination { AmpConfiguration = new AmpConfiguration { WorkspaceArn = "arn:aws:aps:us-west-2:123456789012:workspace/ws-ogh2u499-ce12-hg89-v6c7-123412341234" } } ,
24+ ScrapeConfiguration = new ScrapeConfiguration { ConfigurationBlob = new MemoryStream ( blob ) } ,
25+ Source = new Source { EksConfiguration = new EksConfiguration {
26+ ClusterArn = "arn:aws:eks:us-west-2:123456789012:cluster/example" ,
27+ SecurityGroupIds = new List < string > {
28+ "sg-abc123"
29+ } ,
30+ SubnetIds = new List < string > {
31+ "subnet-abc123"
32+ }
33+ } } ,
34+ Tags = new Dictionary < string , string > {
35+ { "exampleTag" , "exampleValue" }
36+ }
37+ } ) ;
38+
39+ string arn = response . Arn ;
40+ string scraperId = response . ScraperId ;
41+ ScraperStatus status = response . Status ;
42+ Dictionary < string , string > tags = response . Tags ;
43+
44+ #endregion
45+ }
46+
47+ public void PrometheusServiceDeleteScraper ( )
48+ {
49+ #region example-1
50+
51+ var client = new AmazonPrometheusServiceClient ( ) ;
52+ var response = client . DeleteScraper ( new DeleteScraperRequest
53+ {
54+ ClientToken = "token" ,
55+ ScraperId = "scraper-123"
56+ } ) ;
57+
58+ string scraperId = response . ScraperId ;
59+ ScraperStatus status = response . Status ;
60+
61+ #endregion
62+ }
63+
64+ public void PrometheusServiceDescribeScraper ( )
65+ {
66+ #region example-1
67+
68+ var client = new AmazonPrometheusServiceClient ( ) ;
69+ var response = client . DescribeScraper ( new DescribeScraperRequest
70+ {
71+ ScraperId = "scraper-123"
72+ } ) ;
73+
74+ ScraperDescription scraper = response . Scraper ;
75+
76+ #endregion
77+ }
78+
79+ public void PrometheusServiceGetDefaultScraperConfiguration ( )
80+ {
81+ #region example-1
82+
83+ var client = new AmazonPrometheusServiceClient ( ) ;
84+ var response = client . GetDefaultScraperConfiguration ( new GetDefaultScraperConfigurationRequest
85+ {
86+ } ) ;
87+
88+ MemoryStream configuration = response . Configuration ;
89+
90+ #endregion
91+ }
92+
93+ public void PrometheusServiceListScrapers ( )
94+ {
95+ #region example-1
96+
97+ var client = new AmazonPrometheusServiceClient ( ) ;
98+ var response = client . ListScrapers ( new ListScrapersRequest
99+ {
100+ MaxResults = 2 ,
101+ NextToken = "previouslyGeneratedToken"
102+ } ) ;
103+
104+ List < ScraperSummary > scrapers = response . Scrapers ;
105+
106+ #endregion
107+ }
108+
109+ public void PrometheusServiceListScrapers ( )
110+ {
111+ #region example-2
112+
113+ var client = new AmazonPrometheusServiceClient ( ) ;
114+ var response = client . ListScrapers ( new ListScrapersRequest
115+ {
116+ Filters = new Dictionary < string , List < string > > {
117+ { "alias" , new List < string > {
118+ "alias1"
119+ } } ,
120+ { "sourceArn" , new List < string > {
121+ "arn:aws:eks:us-west-2:123456789012:cluster/example1"
122+ } } ,
123+ { "status" , new List < string > {
124+ "ACTIVE"
125+ } }
126+ }
127+ } ) ;
128+
129+ List < ScraperSummary > scrapers = response . Scrapers ;
130+
131+ #endregion
132+ }
133+
134+ public void PrometheusServiceUpdateScraper ( )
135+ {
136+ #region example-1
137+
138+ var client = new AmazonPrometheusServiceClient ( ) ;
139+ var response = client . UpdateScraper ( new UpdateScraperRequest
140+ {
141+ Alias = "alias-update" ,
142+ ClientToken = "token" ,
143+ Destination = new Destination { AmpConfiguration = new AmpConfiguration { WorkspaceArn = "arn:aws:aps:us-west-2:123456789012:workspace/ws-ogh2u499-ce12-hg89-v6c7-123412341234-update" } } ,
144+ ScrapeConfiguration = new ScrapeConfiguration { ConfigurationBlob = new MemoryStream ( blob - update ) } ,
145+ ScraperId = "scraper-123"
146+ } ) ;
147+
148+ string arn = response . Arn ;
149+ string scraperId = response . ScraperId ;
150+ ScraperStatus status = response . Status ;
151+ Dictionary < string , string > tags = response . Tags ;
152+
153+ #endregion
154+ }
155+
156+
157+ # region ISample Members
158+ public virtual void Run ( )
159+ {
160+
161+ }
162+ # endregion
163+
164+ }
165+ }
0 commit comments