@@ -39,13 +39,18 @@ await routerAdministrationClient.CreateClassificationPolicyAsync(
39
39
PrioritizationRule = new ExpressionRule (" If(job.Hardware_VIP = true, 10, 1)" ),
40
40
QueueSelectors = new List <QueueSelectorAttachment >()
41
41
{
42
- new QueueLabelSelector ()
43
- {
44
- LabelSelectors = new List <LabelSelectorAttachment >
42
+ new ConditionalQueueSelectorAttachment (
43
+ condition : new ExpressionRule ( " If(job.Region = \" NA \" , true, false) " ),
44
+ labelSelectors : new List <QueueSelector >()
45
45
{
46
- new ExpressionRule (" If(job.Region = \" NA\" , \" XBOX_NA_QUEUE\" , \" XBOX_DEFAULT_QUEUE\" )" )
47
- }
48
- }
46
+ new QueueSelector (" Id" , LabelOperator .Equal , new LabelValue (" XBOX_NA_QUEUE" ))
47
+ }),
48
+ new ConditionalQueueSelectorAttachment (
49
+ condition : new ExpressionRule (" If(job.Escalated = \" NA\" , false, true)" ),
50
+ labelSelectors : new List <QueueSelector >()
51
+ {
52
+ new QueueSelector (" Id" , LabelOperator .Equal , new LabelValue (" XBOX_DEFAULT_QUEUE" ))
53
+ })
49
54
}
50
55
});
51
56
```
@@ -131,15 +136,7 @@ await routerAdministrationClient.CreateClassificationPolicyAsync(
131
136
{
132
137
WorkerSelectors = new List <WorkerSelectorAttachment >()
133
138
{
134
- new StaticWorkerSelectorAttachment ()
135
- {
136
- LabelSelector = new WorkerSelector ()
137
- {
138
- Key = " Foo" ,
139
- LabelOperator = LabelOperator .Equal ,
140
- Value = " Bar"
141
- }
142
- }
139
+ new StaticWorkerSelectorAttachment (new WorkerSelector (" Foo" , LabelOperator .Equal , new LabelValue (" Bar" )))
143
140
}
144
141
});
145
142
` ` `
@@ -174,19 +171,12 @@ await routerAdministrationClient.CreateClassificationPolicyAsync(
174
171
{
175
172
WorkerSelectors = new List <WorkerSelectorAttachment >()
176
173
{
177
- new ConditionalWorkerSelectorAttachment ()
178
- {
179
- Condition = new ExpressionRule (" job.Urgent = true" ),
180
- LabelSelectors = new List < WorkerSelector >
174
+ new ConditionalWorkerSelectorAttachment (
175
+ condition : new ExpressionRule (" job.Urgent = true" )),
176
+ labelSelectors : new List <WorkerSelector >()
181
177
{
182
- new WorkerSelector ()
183
- {
184
- Key = " Foo" ,
185
- LabelOperator = LabelOperator .Equal ,
186
- Value = " Bar"
187
- }
178
+ new WorkerSelector (" Foo" , LabelOperator .Equal , " Bar" )
188
179
})
189
- }
190
180
}
191
181
});
192
182
` ` `
@@ -227,7 +217,7 @@ await routerAdministrationClient.CreateClassificationPolicyAsync(
227
217
{
228
218
WorkerSelectors = new List <WorkerSelectorAttachment >()
229
219
{
230
- new PassThroughLabelSelector ( key : " Foo" , @ operator : LabelOperator .Equal )
220
+ new PassThroughQueueSelectorAttachment ( " Foo" , LabelOperator .Equal )
231
221
}
232
222
});
233
223
` ` `
@@ -263,22 +253,20 @@ await routerAdministrationClient.CreateClassificationPolicyAsync(
263
253
{
264
254
WorkerSelectors = new List <WorkerSelectorAttachment >()
265
255
{
266
- new WeightedAllocationWorkerSelectorAttachment ()
267
- {
268
- Weight = 0.3 ,
269
- LabelSelectors = new List < WorkerSelector >
270
- {
271
- new WorkerSelector (" Vendor" , LabelOperator .Equal , " A" )
272
- })
273
- },
274
- new WeightedAllocationWorkerSelectorAttachment ()
275
- {
276
- Weight = 0.7 ,
277
- LabelSelectors = new List < WorkerSelector >
256
+ new WeightedAllocationWorkerSelectorAttachment (
257
+ new List <WorkerWeightedAllocation >()
278
258
{
279
- new WorkerSelector (" Vendor" , LabelOperator .Equal , " B" )
259
+ new WorkerWeightedAllocation(0.3,
260
+ new List <WorkerSelector >()
261
+ {
262
+ new WorkerSelector (" Vendor" , LabelOperator .Equal , " A" )
263
+ }),
264
+ new WorkerWeightedAllocation(0.7,
265
+ new List <WorkerSelector >()
266
+ {
267
+ new WorkerSelector (" Vendor" , LabelOperator .Equal , " B" )
268
+ })
280
269
})
281
- }
282
270
}
283
271
});
284
272
` ` `
@@ -326,12 +314,7 @@ var reclassifiedJob = await routerClient.ReclassifyJobAsync("<job id>");
326
314
::: zone pivot="programming-language-javascript"
327
315
328
316
` ` ` typescript
329
- await client .reclassifyJob (" <jobId>" , {
330
- classificationPolicyId: null ,
331
- labelsToUpdate: {
332
- Hardware_VIP: true
333
- }
334
- });
317
+ await client .reclassifyJob (" <jobId>" );
335
318
` ` `
336
319
337
320
::: zone-end
0 commit comments