@@ -58,6 +58,7 @@ function Test-CreateHttpJob
58
58
Validate- DefaultJob $resourceGroupName $jobCollectionName $jobName $status $startTime $recurrence $endSchedule $jobDefinition
59
59
Validate- HttpJob $method $uri $body $headers $httpAuthenticationType $jobDefinition.JobAction
60
60
61
+ # Create a new http job with client certificate authentication
61
62
$jobName = " HttpJobWithHttpClientCertificateAuthentication"
62
63
$method = " get"
63
64
$body = $null
@@ -69,6 +70,7 @@ function Test-CreateHttpJob
69
70
Validate- DefaultJob $resourceGroupName $jobCollectionName $jobName $status $startTime $recurrence $endSchedule $jobDefinition
70
71
Validate- HttpJob $method $uri $body $headers $httpAuthenticationType $jobDefinition.JobAction
71
72
73
+ # Create a new http job with start time.
72
74
$jobName = " HttpJobWithStartTime"
73
75
$startTime = Get-Date
74
76
$startTime = $startTime.AddDays (1 )
@@ -79,7 +81,7 @@ function Test-CreateHttpJob
79
81
Validate- DefaultJob $resourceGroupName $jobCollectionName $jobName $status $startTime $recurrence $endSchedule $jobDefinition
80
82
Validate- HttpJob $method $uri $body $headers $httpAuthenticationType $jobDefinition.JobAction
81
83
82
- $jobName = " HttpJobWith "
84
+ # Create a new http job with recurrence.
83
85
$jobName = " HttpJobWithRecurrence"
84
86
$interval = 1
85
87
$frequency = " Minute"
@@ -94,6 +96,7 @@ function Test-CreateHttpJob
94
96
Validate- DefaultJob $resourceGroupName $jobCollectionName $jobName $status $startTime $recurrence $endSchedule $jobDefinition
95
97
Validate- HttpJob $method $uri $body $headers $httpAuthenticationType $jobDefinition.JobAction
96
98
99
+ # Create a new job with error http action.
97
100
$jobName = " HttpJobWithErrorHttpAction"
98
101
$status = " Enabled"
99
102
$startTime = $null
@@ -117,6 +120,16 @@ function Test-CreateHttpJob
117
120
Validate- DefaultJob $resourceGroupName $jobCollectionName $jobName $status $startTime $recurrence $endSchedule $jobDefinition
118
121
Validate- HttpJob $method $uri $body $headers $httpAuthenticationType $jobDefinition.JobAction
119
122
Validate- HttpJob $errorActionMethod $errorActionUri $errorActionBody $errorActionHeaders $errorActionAuthenticationType $jobDefinition.JobErrorAction
123
+
124
+ # Create a new job with encodable uri characters.
125
+ $jobName = " HttpJobWithEncodableUriCharacters"
126
+ $uri = " http://www.bing.com/workers?somekey=somevalue%2drandomvalue%2fconsistent%3d"
127
+ $errorActionUri = " http://www.bing.com/workers?somekey=somevalue%2drandomvalue%2fconsistent%3d"
128
+
129
+ $jobDefinition = New-AzureRmSchedulerHttpJob - ResourceGroupName $resourceGroupName - JobCollectionName $jobCollectionName - JobName $jobName - Method $method - Uri $uri - ErrorActionType $errorActionType - ErrorActionMethod $errorActionMethod - ErrorActionUri $errorActionUri - ErrorActionRequestBody $errorActionBody - ErrorActionHeaders $errorActionHeaders - ErrorActionHttpAuthenticationType $errorActionAuthenticationType - ErrorActionUsername $errorActionUsername - ErrorActionPassword $errorActionPassword
130
+ Validate- DefaultJob $resourceGroupName $jobCollectionName $jobName $status $startTime $recurrence $endSchedule $jobDefinition
131
+ Validate- HttpJob $method $uri $body $headers $httpAuthenticationType $jobDefinition.JobAction
132
+ Validate- HttpJob $errorActionMethod $errorActionUri $errorActionBody $errorActionHeaders $errorActionAuthenticationType $jobDefinition.JobErrorAction
120
133
}
121
134
finally
122
135
{
@@ -157,15 +170,16 @@ function Test-UpdateHttpJob
157
170
Validate- DefaultJob $resourceGroupName $jobCollectionName $jobName $status $startTime $recurrence $endSchedule $jobDefinition
158
171
Validate- HttpJob $method $uri $body $headers $httpAuthenticationType $jobDefinition.JobAction
159
172
173
+ # Update a job with start time.
160
174
$startTime = Get-Date
161
175
$startTime = $startTime.AddDays (1 )
162
176
$startTime = $startTime.ToUniversalTime ()
163
177
164
- $jobDefinition = Set-AzureRmSchedulerHttpJob - ResourceGroupName $resourceGroupName - JobCollectionName $jobCollectionName - JobName $jobName - StartTime $startTime
178
+ $jobDefinition = Set-AzureRmSchedulerHttpJob - ResourceGroupName $resourceGroupName - JobCollectionName $jobCollectionName - JobName $jobName - StartTime $startTime - Uri $uri
165
179
Validate- DefaultJob $resourceGroupName $jobCollectionName $jobName $status $startTime $recurrence $endSchedule $jobDefinition
166
180
Validate- HttpJob $method $uri $body $headers $httpAuthenticationType $jobDefinition.JobAction
167
181
168
- # Create a new http job with headers and body
182
+ # Update a job with headers and body.
169
183
$method = " post"
170
184
$body = " Hello"
171
185
$headers = @ {" Content-Type" = " application/json" }
@@ -174,13 +188,15 @@ function Test-UpdateHttpJob
174
188
Validate- DefaultJob $resourceGroupName $jobCollectionName $jobName $status $startTime $recurrence $endSchedule $jobDefinition
175
189
Validate- HttpJob $method $uri $body $headers $httpAuthenticationType $jobDefinition.JobAction
176
190
191
+ # Update a job with authentication.
177
192
$httpAuthenticationType = " Basic"
178
193
$userName = " httpJob"
179
194
$password = " p@ssword!"
180
195
$jobDefinition = Set-AzureRmSchedulerHttpJob - ResourceGroupName $resourceGroupName - JobCollectionName $jobCollectionName - JobName $jobName - HttpAuthenticationType $httpAuthenticationType - Username $username - Password $password
181
196
Validate- DefaultJob $resourceGroupName $jobCollectionName $jobName $status $startTime $recurrence $endSchedule $jobDefinition
182
197
Validate- HttpJob $method $uri $body $headers $httpAuthenticationType $jobDefinition.JobAction
183
198
199
+ # Update a job with interval / frequency.
184
200
$interval = 1
185
201
$frequency = " Minute"
186
202
$endTime = Get-Date
@@ -194,6 +210,13 @@ function Test-UpdateHttpJob
194
210
Validate- DefaultJob $resourceGroupName $jobCollectionName $jobName $status $startTime $recurrence $endSchedule $jobDefinition
195
211
Validate- HttpJob $method $uri $body $headers $httpAuthenticationType $jobDefinition.JobAction
196
212
213
+ # Update a job with encodable characters URI.
214
+ $uri = " http://www.bing.com/workers?somekey=somevalue%2drandomvalue%2fconsistent%3d"
215
+ $jobDefinition = Set-AzureRmSchedulerHttpJob - ResourceGroupName $resourceGroupName - JobCollectionName $jobCollectionName - JobName $jobName - Uri $uri
216
+ Validate- DefaultJob $resourceGroupName $jobCollectionName $jobName $status $startTime $recurrence $endSchedule $jobDefinition
217
+ Validate- HttpJob $method $uri $body $headers $httpAuthenticationType $jobDefinition.JobAction
218
+
219
+ # Update a job with error action.
197
220
$status = " Enabled"
198
221
$jobActionType = " Http"
199
222
$errorActionType = " Http"
@@ -208,7 +231,15 @@ function Test-UpdateHttpJob
208
231
Validate- DefaultJob $resourceGroupName $jobCollectionName $jobName $status $startTime $recurrence $endSchedule $jobDefinition
209
232
Validate- HttpJob $method $uri $body $headers $httpAuthenticationType $jobDefinition.JobAction
210
233
Validate- HttpJob $errorActionMethod $errorActionUri $errorActionBody $errorActionHeaders $errorActionAuthenticationType $jobDefinition.JobErrorAction
234
+
235
+ # Update a job with encodable characters error action URI.
236
+ $errorActionUri = " http://www.bing.com/workers?somekey=somevalue%2drandomvalue%2fconsistent%3d"
237
+ $jobDefinition = Set-AzureRmSchedulerHttpJob - ResourceGroupName $resourceGroupName - JobCollectionName $jobCollectionName - JobName $jobName - ErrorActionType $errorActionType - ErrorActionUri $errorActionUri
238
+ Validate- DefaultJob $resourceGroupName $jobCollectionName $jobName $status $startTime $recurrence $endSchedule $jobDefinition
239
+ Validate- HttpJob $method $uri $body $headers $httpAuthenticationType $jobDefinition.JobAction
240
+ Validate- HttpJob $errorActionMethod $errorActionUri $errorActionBody $errorActionHeaders $errorActionAuthenticationType $jobDefinition.JobErrorAction
211
241
242
+ # Get scheduler job.
212
243
$jobDefinition = Get-AzureRmSchedulerJob - ResourceGroupName $resourceGroupName - JobCollectionName $jobCollectionName
213
244
Validate- DefaultJob $resourceGroupName $jobCollectionName $jobName $status $startTime $recurrence $endSchedule $jobDefinition [0 ]
214
245
Validate- HttpJob $method $uri $body $headers $httpAuthenticationType $jobDefinition [0 ].JobAction
0 commit comments