1// Package servicefabric implements the Azure ARM Servicefabric service API version 6.2.0.9. 2// 3// Service Fabric REST Client APIs allows management of Service Fabric clusters, applications and services. 4package servicefabric 5 6// Copyright (c) Microsoft and contributors. All rights reserved. 7// 8// Licensed under the Apache License, Version 2.0 (the "License"); 9// you may not use this file except in compliance with the License. 10// You may obtain a copy of the License at 11// http://www.apache.org/licenses/LICENSE-2.0 12// 13// Unless required by applicable law or agreed to in writing, software 14// distributed under the License is distributed on an "AS IS" BASIS, 15// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16// 17// See the License for the specific language governing permissions and 18// limitations under the License. 19// 20// Code generated by Microsoft (R) AutoRest Code Generator. 21// Changes may cause incorrect behavior and will be lost if the code is regenerated. 22 23import ( 24 "context" 25 "github.com/Azure/go-autorest/autorest" 26 "github.com/Azure/go-autorest/autorest/azure" 27 "github.com/Azure/go-autorest/autorest/date" 28 "github.com/Azure/go-autorest/autorest/validation" 29 "github.com/Azure/go-autorest/tracing" 30 "github.com/satori/go.uuid" 31 "net/http" 32) 33 34const ( 35 // DefaultBaseURI is the default URI used for the service Servicefabric 36 DefaultBaseURI = "http://localhost:19080" 37) 38 39// BaseClient is the base client for Servicefabric. 40type BaseClient struct { 41 autorest.Client 42 BaseURI string 43} 44 45// New creates an instance of the BaseClient client. 46func New() BaseClient { 47 return NewWithBaseURI(DefaultBaseURI) 48} 49 50// NewWithBaseURI creates an instance of the BaseClient client. 51func NewWithBaseURI(baseURI string) BaseClient { 52 return BaseClient{ 53 Client: autorest.NewClientWithUserAgent(UserAgent()), 54 BaseURI: baseURI, 55 } 56} 57 58// BackupPartition creates a backup of the stateful persisted partition's state. In case the partition is already being 59// periodically backed up, then by default the new backup is created at the same backup storage. One can also override 60// the same by specifying the backup storage details as part of the request body. Once the backup is initiated, its 61// progress can be tracked using the GetBackupProgress operation. 62// In case, the operation times out, specify a greater backup timeout value in the query parameter. 63// Parameters: 64// partitionID - the identity of the partition. 65// backupPartitionDescription - describes the parameters to backup the partition now. If not present, backup 66// operation uses default parameters from the backup policy current associated with this partition. 67// backupTimeout - specifies the maximum amount of time, in minutes, to wait for the backup operation to 68// complete. Post that, the operation completes with timeout error. However, in certain corner cases it could 69// be that though the operation returns back timeout, the backup actually goes through. In case of timeout 70// error, its recommended to invoke this operation again with a greater timeout value. The default value for 71// the same is 10 minutes. 72// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 73// duration that the client is willing to wait for the requested operation to complete. The default value for 74// this parameter is 60 seconds. 75func (client BaseClient) BackupPartition(ctx context.Context, partitionID uuid.UUID, backupPartitionDescription *BackupPartitionDescription, backupTimeout *int32, timeout *int64) (result autorest.Response, err error) { 76 if tracing.IsEnabled() { 77 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.BackupPartition") 78 defer func() { 79 sc := -1 80 if result.Response != nil { 81 sc = result.Response.StatusCode 82 } 83 tracing.EndSpan(ctx, sc, err) 84 }() 85 } 86 if err := validation.Validate([]validation.Validation{ 87 {TargetValue: timeout, 88 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 89 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 90 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 91 }}}}}); err != nil { 92 return result, validation.NewError("servicefabric.BaseClient", "BackupPartition", err.Error()) 93 } 94 95 req, err := client.BackupPartitionPreparer(ctx, partitionID, backupPartitionDescription, backupTimeout, timeout) 96 if err != nil { 97 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "BackupPartition", nil, "Failure preparing request") 98 return 99 } 100 101 resp, err := client.BackupPartitionSender(req) 102 if err != nil { 103 result.Response = resp 104 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "BackupPartition", resp, "Failure sending request") 105 return 106 } 107 108 result, err = client.BackupPartitionResponder(resp) 109 if err != nil { 110 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "BackupPartition", resp, "Failure responding to request") 111 } 112 113 return 114} 115 116// BackupPartitionPreparer prepares the BackupPartition request. 117func (client BaseClient) BackupPartitionPreparer(ctx context.Context, partitionID uuid.UUID, backupPartitionDescription *BackupPartitionDescription, backupTimeout *int32, timeout *int64) (*http.Request, error) { 118 pathParameters := map[string]interface{}{ 119 "partitionId": partitionID, 120 } 121 122 const APIVersion = "6.2-preview" 123 queryParameters := map[string]interface{}{ 124 "api-version": APIVersion, 125 } 126 if backupTimeout != nil { 127 queryParameters["BackupTimeout"] = autorest.Encode("query", *backupTimeout) 128 } else { 129 queryParameters["BackupTimeout"] = autorest.Encode("query", 10) 130 } 131 if timeout != nil { 132 queryParameters["timeout"] = autorest.Encode("query", *timeout) 133 } else { 134 queryParameters["timeout"] = autorest.Encode("query", 60) 135 } 136 137 preparer := autorest.CreatePreparer( 138 autorest.AsContentType("application/json; charset=utf-8"), 139 autorest.AsPost(), 140 autorest.WithBaseURL(client.BaseURI), 141 autorest.WithPathParameters("/Partitions/{partitionId}/$/Backup", pathParameters), 142 autorest.WithQueryParameters(queryParameters)) 143 if backupPartitionDescription != nil { 144 preparer = autorest.DecoratePreparer(preparer, 145 autorest.WithJSON(backupPartitionDescription)) 146 } 147 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 148} 149 150// BackupPartitionSender sends the BackupPartition request. The method will close the 151// http.Response Body if it receives an error. 152func (client BaseClient) BackupPartitionSender(req *http.Request) (*http.Response, error) { 153 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 154 return autorest.SendWithSender(client, req, sd...) 155} 156 157// BackupPartitionResponder handles the response to the BackupPartition request. The method always 158// closes the http.Response Body. 159func (client BaseClient) BackupPartitionResponder(resp *http.Response) (result autorest.Response, err error) { 160 err = autorest.Respond( 161 resp, 162 client.ByInspecting(), 163 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), 164 autorest.ByClosing()) 165 result.Response = resp 166 return 167} 168 169// CancelOperation the following is a list of APIs that start fault operations that may be cancelled using 170// CancelOperation - 171// - StartDataLoss 172// - StartQuorumLoss 173// - StartPartitionRestart 174// - StartNodeTransition 175// 176// If force is false, then the specified user-induced operation will be gracefully stopped and cleaned up. If force is 177// true, the command will be aborted, and some internal state 178// may be left behind. Specifying force as true should be used with care. Calling this API with force set to true is 179// not allowed until this API has already 180// been called on the same test command with force set to false first, or unless the test command already has an 181// OperationState of OperationState.RollingBack. 182// Clarification: OperationState.RollingBack means that the system will/is be cleaning up internal system state caused 183// by executing the command. It will not restore data if the 184// test command was to cause data loss. For example, if you call StartDataLoss then call this API, the system will 185// only clean up internal state from running the command. 186// It will not restore the target partition's data, if the command progressed far enough to cause data loss. 187// 188// Important note: if this API is invoked with force==true, internal state may be left behind. 189// Parameters: 190// operationID - a GUID that identifies a call of this API. This is passed into the corresponding GetProgress 191// API 192// force - indicates whether to gracefully rollback and clean up internal system state modified by executing 193// the user-induced operation. 194// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 195// duration that the client is willing to wait for the requested operation to complete. The default value for 196// this parameter is 60 seconds. 197func (client BaseClient) CancelOperation(ctx context.Context, operationID uuid.UUID, force bool, timeout *int64) (result autorest.Response, err error) { 198 if tracing.IsEnabled() { 199 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.CancelOperation") 200 defer func() { 201 sc := -1 202 if result.Response != nil { 203 sc = result.Response.StatusCode 204 } 205 tracing.EndSpan(ctx, sc, err) 206 }() 207 } 208 if err := validation.Validate([]validation.Validation{ 209 {TargetValue: timeout, 210 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 211 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 212 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 213 }}}}}); err != nil { 214 return result, validation.NewError("servicefabric.BaseClient", "CancelOperation", err.Error()) 215 } 216 217 req, err := client.CancelOperationPreparer(ctx, operationID, force, timeout) 218 if err != nil { 219 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CancelOperation", nil, "Failure preparing request") 220 return 221 } 222 223 resp, err := client.CancelOperationSender(req) 224 if err != nil { 225 result.Response = resp 226 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CancelOperation", resp, "Failure sending request") 227 return 228 } 229 230 result, err = client.CancelOperationResponder(resp) 231 if err != nil { 232 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CancelOperation", resp, "Failure responding to request") 233 } 234 235 return 236} 237 238// CancelOperationPreparer prepares the CancelOperation request. 239func (client BaseClient) CancelOperationPreparer(ctx context.Context, operationID uuid.UUID, force bool, timeout *int64) (*http.Request, error) { 240 const APIVersion = "6.0" 241 queryParameters := map[string]interface{}{ 242 "api-version": APIVersion, 243 "Force": autorest.Encode("query", force), 244 "OperationId": autorest.Encode("query", operationID), 245 } 246 if timeout != nil { 247 queryParameters["timeout"] = autorest.Encode("query", *timeout) 248 } else { 249 queryParameters["timeout"] = autorest.Encode("query", 60) 250 } 251 252 preparer := autorest.CreatePreparer( 253 autorest.AsPost(), 254 autorest.WithBaseURL(client.BaseURI), 255 autorest.WithPath("/Faults/$/Cancel"), 256 autorest.WithQueryParameters(queryParameters)) 257 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 258} 259 260// CancelOperationSender sends the CancelOperation request. The method will close the 261// http.Response Body if it receives an error. 262func (client BaseClient) CancelOperationSender(req *http.Request) (*http.Response, error) { 263 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 264 return autorest.SendWithSender(client, req, sd...) 265} 266 267// CancelOperationResponder handles the response to the CancelOperation request. The method always 268// closes the http.Response Body. 269func (client BaseClient) CancelOperationResponder(resp *http.Response) (result autorest.Response, err error) { 270 err = autorest.Respond( 271 resp, 272 client.ByInspecting(), 273 azure.WithErrorUnlessStatusCode(http.StatusOK), 274 autorest.ByClosing()) 275 result.Response = resp 276 return 277} 278 279// CancelRepairTask this API supports the Service Fabric platform; it is not meant to be used directly from your code. 280// Parameters: 281// repairTaskCancelDescription - describes the repair task to be cancelled. 282func (client BaseClient) CancelRepairTask(ctx context.Context, repairTaskCancelDescription RepairTaskCancelDescription) (result RepairTaskUpdateInfo, err error) { 283 if tracing.IsEnabled() { 284 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.CancelRepairTask") 285 defer func() { 286 sc := -1 287 if result.Response.Response != nil { 288 sc = result.Response.Response.StatusCode 289 } 290 tracing.EndSpan(ctx, sc, err) 291 }() 292 } 293 if err := validation.Validate([]validation.Validation{ 294 {TargetValue: repairTaskCancelDescription, 295 Constraints: []validation.Constraint{{Target: "repairTaskCancelDescription.TaskID", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { 296 return result, validation.NewError("servicefabric.BaseClient", "CancelRepairTask", err.Error()) 297 } 298 299 req, err := client.CancelRepairTaskPreparer(ctx, repairTaskCancelDescription) 300 if err != nil { 301 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CancelRepairTask", nil, "Failure preparing request") 302 return 303 } 304 305 resp, err := client.CancelRepairTaskSender(req) 306 if err != nil { 307 result.Response = autorest.Response{Response: resp} 308 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CancelRepairTask", resp, "Failure sending request") 309 return 310 } 311 312 result, err = client.CancelRepairTaskResponder(resp) 313 if err != nil { 314 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CancelRepairTask", resp, "Failure responding to request") 315 } 316 317 return 318} 319 320// CancelRepairTaskPreparer prepares the CancelRepairTask request. 321func (client BaseClient) CancelRepairTaskPreparer(ctx context.Context, repairTaskCancelDescription RepairTaskCancelDescription) (*http.Request, error) { 322 const APIVersion = "6.0" 323 queryParameters := map[string]interface{}{ 324 "api-version": APIVersion, 325 } 326 327 preparer := autorest.CreatePreparer( 328 autorest.AsContentType("application/json; charset=utf-8"), 329 autorest.AsPost(), 330 autorest.WithBaseURL(client.BaseURI), 331 autorest.WithPath("/$/CancelRepairTask"), 332 autorest.WithJSON(repairTaskCancelDescription), 333 autorest.WithQueryParameters(queryParameters)) 334 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 335} 336 337// CancelRepairTaskSender sends the CancelRepairTask request. The method will close the 338// http.Response Body if it receives an error. 339func (client BaseClient) CancelRepairTaskSender(req *http.Request) (*http.Response, error) { 340 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 341 return autorest.SendWithSender(client, req, sd...) 342} 343 344// CancelRepairTaskResponder handles the response to the CancelRepairTask request. The method always 345// closes the http.Response Body. 346func (client BaseClient) CancelRepairTaskResponder(resp *http.Response) (result RepairTaskUpdateInfo, err error) { 347 err = autorest.Respond( 348 resp, 349 client.ByInspecting(), 350 azure.WithErrorUnlessStatusCode(http.StatusOK), 351 autorest.ByUnmarshallingJSON(&result), 352 autorest.ByClosing()) 353 result.Response = autorest.Response{Response: resp} 354 return 355} 356 357// CommitImageStoreUploadSession when all file chunks have been uploaded, the upload session needs to be committed 358// explicitly to complete the upload. Image store preserves the upload session until the expiration time, which is 30 359// minutes after the last chunk received. 360// Parameters: 361// sessionID - a GUID generated by the user for a file uploading. It identifies an image store upload session 362// which keeps track of all file chunks until it is committed. 363// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 364// duration that the client is willing to wait for the requested operation to complete. The default value for 365// this parameter is 60 seconds. 366func (client BaseClient) CommitImageStoreUploadSession(ctx context.Context, sessionID uuid.UUID, timeout *int64) (result autorest.Response, err error) { 367 if tracing.IsEnabled() { 368 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.CommitImageStoreUploadSession") 369 defer func() { 370 sc := -1 371 if result.Response != nil { 372 sc = result.Response.StatusCode 373 } 374 tracing.EndSpan(ctx, sc, err) 375 }() 376 } 377 if err := validation.Validate([]validation.Validation{ 378 {TargetValue: timeout, 379 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 380 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 381 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 382 }}}}}); err != nil { 383 return result, validation.NewError("servicefabric.BaseClient", "CommitImageStoreUploadSession", err.Error()) 384 } 385 386 req, err := client.CommitImageStoreUploadSessionPreparer(ctx, sessionID, timeout) 387 if err != nil { 388 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CommitImageStoreUploadSession", nil, "Failure preparing request") 389 return 390 } 391 392 resp, err := client.CommitImageStoreUploadSessionSender(req) 393 if err != nil { 394 result.Response = resp 395 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CommitImageStoreUploadSession", resp, "Failure sending request") 396 return 397 } 398 399 result, err = client.CommitImageStoreUploadSessionResponder(resp) 400 if err != nil { 401 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CommitImageStoreUploadSession", resp, "Failure responding to request") 402 } 403 404 return 405} 406 407// CommitImageStoreUploadSessionPreparer prepares the CommitImageStoreUploadSession request. 408func (client BaseClient) CommitImageStoreUploadSessionPreparer(ctx context.Context, sessionID uuid.UUID, timeout *int64) (*http.Request, error) { 409 const APIVersion = "6.0" 410 queryParameters := map[string]interface{}{ 411 "api-version": APIVersion, 412 "session-id": autorest.Encode("query", sessionID), 413 } 414 if timeout != nil { 415 queryParameters["timeout"] = autorest.Encode("query", *timeout) 416 } else { 417 queryParameters["timeout"] = autorest.Encode("query", 60) 418 } 419 420 preparer := autorest.CreatePreparer( 421 autorest.AsPost(), 422 autorest.WithBaseURL(client.BaseURI), 423 autorest.WithPath("/ImageStore/$/CommitUploadSession"), 424 autorest.WithQueryParameters(queryParameters)) 425 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 426} 427 428// CommitImageStoreUploadSessionSender sends the CommitImageStoreUploadSession request. The method will close the 429// http.Response Body if it receives an error. 430func (client BaseClient) CommitImageStoreUploadSessionSender(req *http.Request) (*http.Response, error) { 431 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 432 return autorest.SendWithSender(client, req, sd...) 433} 434 435// CommitImageStoreUploadSessionResponder handles the response to the CommitImageStoreUploadSession request. The method always 436// closes the http.Response Body. 437func (client BaseClient) CommitImageStoreUploadSessionResponder(resp *http.Response) (result autorest.Response, err error) { 438 err = autorest.Respond( 439 resp, 440 client.ByInspecting(), 441 azure.WithErrorUnlessStatusCode(http.StatusOK), 442 autorest.ByClosing()) 443 result.Response = resp 444 return 445} 446 447// CopyImageStoreContent copies the image store content from the source image store relative path to the destination 448// image store relative path. 449// Parameters: 450// imageStoreCopyDescription - describes the copy description for the image store. 451// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 452// duration that the client is willing to wait for the requested operation to complete. The default value for 453// this parameter is 60 seconds. 454func (client BaseClient) CopyImageStoreContent(ctx context.Context, imageStoreCopyDescription ImageStoreCopyDescription, timeout *int64) (result autorest.Response, err error) { 455 if tracing.IsEnabled() { 456 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.CopyImageStoreContent") 457 defer func() { 458 sc := -1 459 if result.Response != nil { 460 sc = result.Response.StatusCode 461 } 462 tracing.EndSpan(ctx, sc, err) 463 }() 464 } 465 if err := validation.Validate([]validation.Validation{ 466 {TargetValue: imageStoreCopyDescription, 467 Constraints: []validation.Constraint{{Target: "imageStoreCopyDescription.RemoteSource", Name: validation.Null, Rule: true, Chain: nil}, 468 {Target: "imageStoreCopyDescription.RemoteDestination", Name: validation.Null, Rule: true, Chain: nil}}}, 469 {TargetValue: timeout, 470 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 471 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 472 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 473 }}}}}); err != nil { 474 return result, validation.NewError("servicefabric.BaseClient", "CopyImageStoreContent", err.Error()) 475 } 476 477 req, err := client.CopyImageStoreContentPreparer(ctx, imageStoreCopyDescription, timeout) 478 if err != nil { 479 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CopyImageStoreContent", nil, "Failure preparing request") 480 return 481 } 482 483 resp, err := client.CopyImageStoreContentSender(req) 484 if err != nil { 485 result.Response = resp 486 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CopyImageStoreContent", resp, "Failure sending request") 487 return 488 } 489 490 result, err = client.CopyImageStoreContentResponder(resp) 491 if err != nil { 492 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CopyImageStoreContent", resp, "Failure responding to request") 493 } 494 495 return 496} 497 498// CopyImageStoreContentPreparer prepares the CopyImageStoreContent request. 499func (client BaseClient) CopyImageStoreContentPreparer(ctx context.Context, imageStoreCopyDescription ImageStoreCopyDescription, timeout *int64) (*http.Request, error) { 500 const APIVersion = "6.0" 501 queryParameters := map[string]interface{}{ 502 "api-version": APIVersion, 503 } 504 if timeout != nil { 505 queryParameters["timeout"] = autorest.Encode("query", *timeout) 506 } else { 507 queryParameters["timeout"] = autorest.Encode("query", 60) 508 } 509 510 preparer := autorest.CreatePreparer( 511 autorest.AsContentType("application/json; charset=utf-8"), 512 autorest.AsPost(), 513 autorest.WithBaseURL(client.BaseURI), 514 autorest.WithPath("/ImageStore/$/Copy"), 515 autorest.WithJSON(imageStoreCopyDescription), 516 autorest.WithQueryParameters(queryParameters)) 517 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 518} 519 520// CopyImageStoreContentSender sends the CopyImageStoreContent request. The method will close the 521// http.Response Body if it receives an error. 522func (client BaseClient) CopyImageStoreContentSender(req *http.Request) (*http.Response, error) { 523 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 524 return autorest.SendWithSender(client, req, sd...) 525} 526 527// CopyImageStoreContentResponder handles the response to the CopyImageStoreContent request. The method always 528// closes the http.Response Body. 529func (client BaseClient) CopyImageStoreContentResponder(resp *http.Response) (result autorest.Response, err error) { 530 err = autorest.Respond( 531 resp, 532 client.ByInspecting(), 533 azure.WithErrorUnlessStatusCode(http.StatusOK), 534 autorest.ByClosing()) 535 result.Response = resp 536 return 537} 538 539// CreateApplication creates a Service Fabric application using the specified description. 540// Parameters: 541// applicationDescription - description for creating an application. 542// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 543// duration that the client is willing to wait for the requested operation to complete. The default value for 544// this parameter is 60 seconds. 545func (client BaseClient) CreateApplication(ctx context.Context, applicationDescription ApplicationDescription, timeout *int64) (result autorest.Response, err error) { 546 if tracing.IsEnabled() { 547 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.CreateApplication") 548 defer func() { 549 sc := -1 550 if result.Response != nil { 551 sc = result.Response.StatusCode 552 } 553 tracing.EndSpan(ctx, sc, err) 554 }() 555 } 556 if err := validation.Validate([]validation.Validation{ 557 {TargetValue: applicationDescription, 558 Constraints: []validation.Constraint{{Target: "applicationDescription.Name", Name: validation.Null, Rule: true, Chain: nil}, 559 {Target: "applicationDescription.TypeName", Name: validation.Null, Rule: true, Chain: nil}, 560 {Target: "applicationDescription.TypeVersion", Name: validation.Null, Rule: true, Chain: nil}, 561 {Target: "applicationDescription.ApplicationCapacity", Name: validation.Null, Rule: false, 562 Chain: []validation.Constraint{{Target: "applicationDescription.ApplicationCapacity.MinimumNodes", Name: validation.Null, Rule: false, 563 Chain: []validation.Constraint{{Target: "applicationDescription.ApplicationCapacity.MinimumNodes", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}, 564 {Target: "applicationDescription.ApplicationCapacity.MaximumNodes", Name: validation.Null, Rule: false, 565 Chain: []validation.Constraint{{Target: "applicationDescription.ApplicationCapacity.MaximumNodes", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}, 566 }}}}, 567 {TargetValue: timeout, 568 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 569 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 570 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 571 }}}}}); err != nil { 572 return result, validation.NewError("servicefabric.BaseClient", "CreateApplication", err.Error()) 573 } 574 575 req, err := client.CreateApplicationPreparer(ctx, applicationDescription, timeout) 576 if err != nil { 577 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CreateApplication", nil, "Failure preparing request") 578 return 579 } 580 581 resp, err := client.CreateApplicationSender(req) 582 if err != nil { 583 result.Response = resp 584 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CreateApplication", resp, "Failure sending request") 585 return 586 } 587 588 result, err = client.CreateApplicationResponder(resp) 589 if err != nil { 590 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CreateApplication", resp, "Failure responding to request") 591 } 592 593 return 594} 595 596// CreateApplicationPreparer prepares the CreateApplication request. 597func (client BaseClient) CreateApplicationPreparer(ctx context.Context, applicationDescription ApplicationDescription, timeout *int64) (*http.Request, error) { 598 const APIVersion = "6.0" 599 queryParameters := map[string]interface{}{ 600 "api-version": APIVersion, 601 } 602 if timeout != nil { 603 queryParameters["timeout"] = autorest.Encode("query", *timeout) 604 } else { 605 queryParameters["timeout"] = autorest.Encode("query", 60) 606 } 607 608 preparer := autorest.CreatePreparer( 609 autorest.AsContentType("application/json; charset=utf-8"), 610 autorest.AsPost(), 611 autorest.WithBaseURL(client.BaseURI), 612 autorest.WithPath("/Applications/$/Create"), 613 autorest.WithJSON(applicationDescription), 614 autorest.WithQueryParameters(queryParameters)) 615 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 616} 617 618// CreateApplicationSender sends the CreateApplication request. The method will close the 619// http.Response Body if it receives an error. 620func (client BaseClient) CreateApplicationSender(req *http.Request) (*http.Response, error) { 621 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 622 return autorest.SendWithSender(client, req, sd...) 623} 624 625// CreateApplicationResponder handles the response to the CreateApplication request. The method always 626// closes the http.Response Body. 627func (client BaseClient) CreateApplicationResponder(resp *http.Response) (result autorest.Response, err error) { 628 err = autorest.Respond( 629 resp, 630 client.ByInspecting(), 631 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), 632 autorest.ByClosing()) 633 result.Response = resp 634 return 635} 636 637// CreateBackupPolicy creates a backup policy which can be associated later with a Service Fabric application, service 638// or a partition for periodic backup. 639// Parameters: 640// backupPolicyDescription - describes the backup policy. 641// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 642// duration that the client is willing to wait for the requested operation to complete. The default value for 643// this parameter is 60 seconds. 644func (client BaseClient) CreateBackupPolicy(ctx context.Context, backupPolicyDescription BackupPolicyDescription, timeout *int64) (result autorest.Response, err error) { 645 if tracing.IsEnabled() { 646 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.CreateBackupPolicy") 647 defer func() { 648 sc := -1 649 if result.Response != nil { 650 sc = result.Response.StatusCode 651 } 652 tracing.EndSpan(ctx, sc, err) 653 }() 654 } 655 if err := validation.Validate([]validation.Validation{ 656 {TargetValue: backupPolicyDescription, 657 Constraints: []validation.Constraint{{Target: "backupPolicyDescription.Name", Name: validation.Null, Rule: true, Chain: nil}, 658 {Target: "backupPolicyDescription.AutoRestoreOnDataLoss", Name: validation.Null, Rule: true, Chain: nil}, 659 {Target: "backupPolicyDescription.MaxIncrementalBackups", Name: validation.Null, Rule: true, 660 Chain: []validation.Constraint{{Target: "backupPolicyDescription.MaxIncrementalBackups", Name: validation.InclusiveMaximum, Rule: int64(255), Chain: nil}, 661 {Target: "backupPolicyDescription.MaxIncrementalBackups", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}, 662 }}, 663 {Target: "backupPolicyDescription.Schedule", Name: validation.Null, Rule: true, Chain: nil}, 664 {Target: "backupPolicyDescription.Storage", Name: validation.Null, Rule: true, Chain: nil}}}, 665 {TargetValue: timeout, 666 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 667 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 668 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 669 }}}}}); err != nil { 670 return result, validation.NewError("servicefabric.BaseClient", "CreateBackupPolicy", err.Error()) 671 } 672 673 req, err := client.CreateBackupPolicyPreparer(ctx, backupPolicyDescription, timeout) 674 if err != nil { 675 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CreateBackupPolicy", nil, "Failure preparing request") 676 return 677 } 678 679 resp, err := client.CreateBackupPolicySender(req) 680 if err != nil { 681 result.Response = resp 682 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CreateBackupPolicy", resp, "Failure sending request") 683 return 684 } 685 686 result, err = client.CreateBackupPolicyResponder(resp) 687 if err != nil { 688 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CreateBackupPolicy", resp, "Failure responding to request") 689 } 690 691 return 692} 693 694// CreateBackupPolicyPreparer prepares the CreateBackupPolicy request. 695func (client BaseClient) CreateBackupPolicyPreparer(ctx context.Context, backupPolicyDescription BackupPolicyDescription, timeout *int64) (*http.Request, error) { 696 const APIVersion = "6.2-preview" 697 queryParameters := map[string]interface{}{ 698 "api-version": APIVersion, 699 } 700 if timeout != nil { 701 queryParameters["timeout"] = autorest.Encode("query", *timeout) 702 } else { 703 queryParameters["timeout"] = autorest.Encode("query", 60) 704 } 705 706 preparer := autorest.CreatePreparer( 707 autorest.AsContentType("application/json; charset=utf-8"), 708 autorest.AsPost(), 709 autorest.WithBaseURL(client.BaseURI), 710 autorest.WithPath("/BackupRestore/BackupPolicies/$/Create"), 711 autorest.WithJSON(backupPolicyDescription), 712 autorest.WithQueryParameters(queryParameters)) 713 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 714} 715 716// CreateBackupPolicySender sends the CreateBackupPolicy request. The method will close the 717// http.Response Body if it receives an error. 718func (client BaseClient) CreateBackupPolicySender(req *http.Request) (*http.Response, error) { 719 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 720 return autorest.SendWithSender(client, req, sd...) 721} 722 723// CreateBackupPolicyResponder handles the response to the CreateBackupPolicy request. The method always 724// closes the http.Response Body. 725func (client BaseClient) CreateBackupPolicyResponder(resp *http.Response) (result autorest.Response, err error) { 726 err = autorest.Respond( 727 resp, 728 client.ByInspecting(), 729 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), 730 autorest.ByClosing()) 731 result.Response = resp 732 return 733} 734 735// CreateComposeDeployment compose is a file format that describes multi-container applications. This API allows 736// deploying container based applications defined in compose format in a Service Fabric cluster. Once the deployment is 737// created it's status can be tracked via `GetComposeDeploymentStatus` API. 738// Parameters: 739// createComposeDeploymentDescription - describes the compose deployment that needs to be created. 740// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 741// duration that the client is willing to wait for the requested operation to complete. The default value for 742// this parameter is 60 seconds. 743func (client BaseClient) CreateComposeDeployment(ctx context.Context, createComposeDeploymentDescription CreateComposeDeploymentDescription, timeout *int64) (result autorest.Response, err error) { 744 if tracing.IsEnabled() { 745 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.CreateComposeDeployment") 746 defer func() { 747 sc := -1 748 if result.Response != nil { 749 sc = result.Response.StatusCode 750 } 751 tracing.EndSpan(ctx, sc, err) 752 }() 753 } 754 if err := validation.Validate([]validation.Validation{ 755 {TargetValue: createComposeDeploymentDescription, 756 Constraints: []validation.Constraint{{Target: "createComposeDeploymentDescription.DeploymentName", Name: validation.Null, Rule: true, Chain: nil}, 757 {Target: "createComposeDeploymentDescription.ComposeFileContent", Name: validation.Null, Rule: true, Chain: nil}}}, 758 {TargetValue: timeout, 759 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 760 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 761 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 762 }}}}}); err != nil { 763 return result, validation.NewError("servicefabric.BaseClient", "CreateComposeDeployment", err.Error()) 764 } 765 766 req, err := client.CreateComposeDeploymentPreparer(ctx, createComposeDeploymentDescription, timeout) 767 if err != nil { 768 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CreateComposeDeployment", nil, "Failure preparing request") 769 return 770 } 771 772 resp, err := client.CreateComposeDeploymentSender(req) 773 if err != nil { 774 result.Response = resp 775 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CreateComposeDeployment", resp, "Failure sending request") 776 return 777 } 778 779 result, err = client.CreateComposeDeploymentResponder(resp) 780 if err != nil { 781 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CreateComposeDeployment", resp, "Failure responding to request") 782 } 783 784 return 785} 786 787// CreateComposeDeploymentPreparer prepares the CreateComposeDeployment request. 788func (client BaseClient) CreateComposeDeploymentPreparer(ctx context.Context, createComposeDeploymentDescription CreateComposeDeploymentDescription, timeout *int64) (*http.Request, error) { 789 const APIVersion = "6.0-preview" 790 queryParameters := map[string]interface{}{ 791 "api-version": APIVersion, 792 } 793 if timeout != nil { 794 queryParameters["timeout"] = autorest.Encode("query", *timeout) 795 } else { 796 queryParameters["timeout"] = autorest.Encode("query", 60) 797 } 798 799 preparer := autorest.CreatePreparer( 800 autorest.AsContentType("application/json; charset=utf-8"), 801 autorest.AsPut(), 802 autorest.WithBaseURL(client.BaseURI), 803 autorest.WithPath("/ComposeDeployments/$/Create"), 804 autorest.WithJSON(createComposeDeploymentDescription), 805 autorest.WithQueryParameters(queryParameters)) 806 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 807} 808 809// CreateComposeDeploymentSender sends the CreateComposeDeployment request. The method will close the 810// http.Response Body if it receives an error. 811func (client BaseClient) CreateComposeDeploymentSender(req *http.Request) (*http.Response, error) { 812 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 813 return autorest.SendWithSender(client, req, sd...) 814} 815 816// CreateComposeDeploymentResponder handles the response to the CreateComposeDeployment request. The method always 817// closes the http.Response Body. 818func (client BaseClient) CreateComposeDeploymentResponder(resp *http.Response) (result autorest.Response, err error) { 819 err = autorest.Respond( 820 resp, 821 client.ByInspecting(), 822 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), 823 autorest.ByClosing()) 824 result.Response = resp 825 return 826} 827 828// CreateName creates the specified Service Fabric name. 829// Parameters: 830// nameDescription - describes the Service Fabric name to be created. 831// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 832// duration that the client is willing to wait for the requested operation to complete. The default value for 833// this parameter is 60 seconds. 834func (client BaseClient) CreateName(ctx context.Context, nameDescription NameDescription, timeout *int64) (result autorest.Response, err error) { 835 if tracing.IsEnabled() { 836 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.CreateName") 837 defer func() { 838 sc := -1 839 if result.Response != nil { 840 sc = result.Response.StatusCode 841 } 842 tracing.EndSpan(ctx, sc, err) 843 }() 844 } 845 if err := validation.Validate([]validation.Validation{ 846 {TargetValue: nameDescription, 847 Constraints: []validation.Constraint{{Target: "nameDescription.Name", Name: validation.Null, Rule: true, Chain: nil}}}, 848 {TargetValue: timeout, 849 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 850 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 851 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 852 }}}}}); err != nil { 853 return result, validation.NewError("servicefabric.BaseClient", "CreateName", err.Error()) 854 } 855 856 req, err := client.CreateNamePreparer(ctx, nameDescription, timeout) 857 if err != nil { 858 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CreateName", nil, "Failure preparing request") 859 return 860 } 861 862 resp, err := client.CreateNameSender(req) 863 if err != nil { 864 result.Response = resp 865 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CreateName", resp, "Failure sending request") 866 return 867 } 868 869 result, err = client.CreateNameResponder(resp) 870 if err != nil { 871 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CreateName", resp, "Failure responding to request") 872 } 873 874 return 875} 876 877// CreateNamePreparer prepares the CreateName request. 878func (client BaseClient) CreateNamePreparer(ctx context.Context, nameDescription NameDescription, timeout *int64) (*http.Request, error) { 879 const APIVersion = "6.0" 880 queryParameters := map[string]interface{}{ 881 "api-version": APIVersion, 882 } 883 if timeout != nil { 884 queryParameters["timeout"] = autorest.Encode("query", *timeout) 885 } else { 886 queryParameters["timeout"] = autorest.Encode("query", 60) 887 } 888 889 preparer := autorest.CreatePreparer( 890 autorest.AsContentType("application/json; charset=utf-8"), 891 autorest.AsPost(), 892 autorest.WithBaseURL(client.BaseURI), 893 autorest.WithPath("/Names/$/Create"), 894 autorest.WithJSON(nameDescription), 895 autorest.WithQueryParameters(queryParameters)) 896 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 897} 898 899// CreateNameSender sends the CreateName request. The method will close the 900// http.Response Body if it receives an error. 901func (client BaseClient) CreateNameSender(req *http.Request) (*http.Response, error) { 902 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 903 return autorest.SendWithSender(client, req, sd...) 904} 905 906// CreateNameResponder handles the response to the CreateName request. The method always 907// closes the http.Response Body. 908func (client BaseClient) CreateNameResponder(resp *http.Response) (result autorest.Response, err error) { 909 err = autorest.Respond( 910 resp, 911 client.ByInspecting(), 912 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), 913 autorest.ByClosing()) 914 result.Response = resp 915 return 916} 917 918// CreateRepairTask for clusters that have the Repair Manager Service configured, 919// this API provides a way to create repair tasks that run automatically or manually. 920// For repair tasks that run automatically, an appropriate repair executor 921// must be running for each repair action to run automatically. 922// These are currently only available in specially-configured Azure Cloud Services. 923// 924// To create a manual repair task, provide the set of impacted node names and the 925// expected impact. When the state of the created repair task changes to approved, 926// you can safely perform repair actions on those nodes. 927// 928// This API supports the Service Fabric platform; it is not meant to be used directly from your code. 929// Parameters: 930// repairTask - describes the repair task to be created or updated. 931func (client BaseClient) CreateRepairTask(ctx context.Context, repairTask RepairTask) (result RepairTaskUpdateInfo, err error) { 932 if tracing.IsEnabled() { 933 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.CreateRepairTask") 934 defer func() { 935 sc := -1 936 if result.Response.Response != nil { 937 sc = result.Response.Response.StatusCode 938 } 939 tracing.EndSpan(ctx, sc, err) 940 }() 941 } 942 if err := validation.Validate([]validation.Validation{ 943 {TargetValue: repairTask, 944 Constraints: []validation.Constraint{{Target: "repairTask.TaskID", Name: validation.Null, Rule: true, Chain: nil}, 945 {Target: "repairTask.Action", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { 946 return result, validation.NewError("servicefabric.BaseClient", "CreateRepairTask", err.Error()) 947 } 948 949 req, err := client.CreateRepairTaskPreparer(ctx, repairTask) 950 if err != nil { 951 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CreateRepairTask", nil, "Failure preparing request") 952 return 953 } 954 955 resp, err := client.CreateRepairTaskSender(req) 956 if err != nil { 957 result.Response = autorest.Response{Response: resp} 958 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CreateRepairTask", resp, "Failure sending request") 959 return 960 } 961 962 result, err = client.CreateRepairTaskResponder(resp) 963 if err != nil { 964 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CreateRepairTask", resp, "Failure responding to request") 965 } 966 967 return 968} 969 970// CreateRepairTaskPreparer prepares the CreateRepairTask request. 971func (client BaseClient) CreateRepairTaskPreparer(ctx context.Context, repairTask RepairTask) (*http.Request, error) { 972 const APIVersion = "6.0" 973 queryParameters := map[string]interface{}{ 974 "api-version": APIVersion, 975 } 976 977 preparer := autorest.CreatePreparer( 978 autorest.AsContentType("application/json; charset=utf-8"), 979 autorest.AsPost(), 980 autorest.WithBaseURL(client.BaseURI), 981 autorest.WithPath("/$/CreateRepairTask"), 982 autorest.WithJSON(repairTask), 983 autorest.WithQueryParameters(queryParameters)) 984 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 985} 986 987// CreateRepairTaskSender sends the CreateRepairTask request. The method will close the 988// http.Response Body if it receives an error. 989func (client BaseClient) CreateRepairTaskSender(req *http.Request) (*http.Response, error) { 990 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 991 return autorest.SendWithSender(client, req, sd...) 992} 993 994// CreateRepairTaskResponder handles the response to the CreateRepairTask request. The method always 995// closes the http.Response Body. 996func (client BaseClient) CreateRepairTaskResponder(resp *http.Response) (result RepairTaskUpdateInfo, err error) { 997 err = autorest.Respond( 998 resp, 999 client.ByInspecting(), 1000 azure.WithErrorUnlessStatusCode(http.StatusOK), 1001 autorest.ByUnmarshallingJSON(&result), 1002 autorest.ByClosing()) 1003 result.Response = autorest.Response{Response: resp} 1004 return 1005} 1006 1007// CreateService this api allows creating a new Service Fabric stateless or stateful service under a specified Service 1008// Fabric application. The description for creating the service includes partitioning information and optional 1009// properties for placement and load balancing. Some of the properties can later be modified using `UpdateService` API. 1010// Parameters: 1011// applicationID - the identity of the application. This is typically the full name of the application without 1012// the 'fabric:' URI scheme. 1013// Starting from version 6.0, hierarchical names are delimited with the "~" character. 1014// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" 1015// in 6.0+ and "myapp/app1" in previous versions. 1016// serviceDescription - the information necessary to create a service. 1017// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 1018// duration that the client is willing to wait for the requested operation to complete. The default value for 1019// this parameter is 60 seconds. 1020func (client BaseClient) CreateService(ctx context.Context, applicationID string, serviceDescription BasicServiceDescription, timeout *int64) (result autorest.Response, err error) { 1021 if tracing.IsEnabled() { 1022 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.CreateService") 1023 defer func() { 1024 sc := -1 1025 if result.Response != nil { 1026 sc = result.Response.StatusCode 1027 } 1028 tracing.EndSpan(ctx, sc, err) 1029 }() 1030 } 1031 if err := validation.Validate([]validation.Validation{ 1032 {TargetValue: serviceDescription, 1033 Constraints: []validation.Constraint{{Target: "serviceDescription.ServiceName", Name: validation.Null, Rule: true, Chain: nil}, 1034 {Target: "serviceDescription.ServiceTypeName", Name: validation.Null, Rule: true, Chain: nil}, 1035 {Target: "serviceDescription.PartitionDescription", Name: validation.Null, Rule: true, Chain: nil}}}, 1036 {TargetValue: timeout, 1037 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 1038 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 1039 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 1040 }}}}}); err != nil { 1041 return result, validation.NewError("servicefabric.BaseClient", "CreateService", err.Error()) 1042 } 1043 1044 req, err := client.CreateServicePreparer(ctx, applicationID, serviceDescription, timeout) 1045 if err != nil { 1046 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CreateService", nil, "Failure preparing request") 1047 return 1048 } 1049 1050 resp, err := client.CreateServiceSender(req) 1051 if err != nil { 1052 result.Response = resp 1053 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CreateService", resp, "Failure sending request") 1054 return 1055 } 1056 1057 result, err = client.CreateServiceResponder(resp) 1058 if err != nil { 1059 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CreateService", resp, "Failure responding to request") 1060 } 1061 1062 return 1063} 1064 1065// CreateServicePreparer prepares the CreateService request. 1066func (client BaseClient) CreateServicePreparer(ctx context.Context, applicationID string, serviceDescription BasicServiceDescription, timeout *int64) (*http.Request, error) { 1067 pathParameters := map[string]interface{}{ 1068 "applicationId": applicationID, 1069 } 1070 1071 const APIVersion = "6.0" 1072 queryParameters := map[string]interface{}{ 1073 "api-version": APIVersion, 1074 } 1075 if timeout != nil { 1076 queryParameters["timeout"] = autorest.Encode("query", *timeout) 1077 } else { 1078 queryParameters["timeout"] = autorest.Encode("query", 60) 1079 } 1080 1081 preparer := autorest.CreatePreparer( 1082 autorest.AsContentType("application/json; charset=utf-8"), 1083 autorest.AsPost(), 1084 autorest.WithBaseURL(client.BaseURI), 1085 autorest.WithPathParameters("/Applications/{applicationId}/$/GetServices/$/Create", pathParameters), 1086 autorest.WithJSON(serviceDescription), 1087 autorest.WithQueryParameters(queryParameters)) 1088 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 1089} 1090 1091// CreateServiceSender sends the CreateService request. The method will close the 1092// http.Response Body if it receives an error. 1093func (client BaseClient) CreateServiceSender(req *http.Request) (*http.Response, error) { 1094 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 1095 return autorest.SendWithSender(client, req, sd...) 1096} 1097 1098// CreateServiceResponder handles the response to the CreateService request. The method always 1099// closes the http.Response Body. 1100func (client BaseClient) CreateServiceResponder(resp *http.Response) (result autorest.Response, err error) { 1101 err = autorest.Respond( 1102 resp, 1103 client.ByInspecting(), 1104 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), 1105 autorest.ByClosing()) 1106 result.Response = resp 1107 return 1108} 1109 1110// CreateServiceFromTemplate creates a Service Fabric service from the service template defined in the application 1111// manifest. A service template contains the properties that will be same for the service instance of the same type. 1112// The API allows overriding the properties that are usually different for different services of the same service type. 1113// Parameters: 1114// applicationID - the identity of the application. This is typically the full name of the application without 1115// the 'fabric:' URI scheme. 1116// Starting from version 6.0, hierarchical names are delimited with the "~" character. 1117// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" 1118// in 6.0+ and "myapp/app1" in previous versions. 1119// serviceFromTemplateDescription - describes the service that needs to be created from the template defined in 1120// the application manifest. 1121// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 1122// duration that the client is willing to wait for the requested operation to complete. The default value for 1123// this parameter is 60 seconds. 1124func (client BaseClient) CreateServiceFromTemplate(ctx context.Context, applicationID string, serviceFromTemplateDescription ServiceFromTemplateDescription, timeout *int64) (result autorest.Response, err error) { 1125 if tracing.IsEnabled() { 1126 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.CreateServiceFromTemplate") 1127 defer func() { 1128 sc := -1 1129 if result.Response != nil { 1130 sc = result.Response.StatusCode 1131 } 1132 tracing.EndSpan(ctx, sc, err) 1133 }() 1134 } 1135 if err := validation.Validate([]validation.Validation{ 1136 {TargetValue: serviceFromTemplateDescription, 1137 Constraints: []validation.Constraint{{Target: "serviceFromTemplateDescription.ApplicationName", Name: validation.Null, Rule: true, Chain: nil}, 1138 {Target: "serviceFromTemplateDescription.ServiceName", Name: validation.Null, Rule: true, Chain: nil}, 1139 {Target: "serviceFromTemplateDescription.ServiceTypeName", Name: validation.Null, Rule: true, Chain: nil}}}, 1140 {TargetValue: timeout, 1141 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 1142 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 1143 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 1144 }}}}}); err != nil { 1145 return result, validation.NewError("servicefabric.BaseClient", "CreateServiceFromTemplate", err.Error()) 1146 } 1147 1148 req, err := client.CreateServiceFromTemplatePreparer(ctx, applicationID, serviceFromTemplateDescription, timeout) 1149 if err != nil { 1150 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CreateServiceFromTemplate", nil, "Failure preparing request") 1151 return 1152 } 1153 1154 resp, err := client.CreateServiceFromTemplateSender(req) 1155 if err != nil { 1156 result.Response = resp 1157 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CreateServiceFromTemplate", resp, "Failure sending request") 1158 return 1159 } 1160 1161 result, err = client.CreateServiceFromTemplateResponder(resp) 1162 if err != nil { 1163 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CreateServiceFromTemplate", resp, "Failure responding to request") 1164 } 1165 1166 return 1167} 1168 1169// CreateServiceFromTemplatePreparer prepares the CreateServiceFromTemplate request. 1170func (client BaseClient) CreateServiceFromTemplatePreparer(ctx context.Context, applicationID string, serviceFromTemplateDescription ServiceFromTemplateDescription, timeout *int64) (*http.Request, error) { 1171 pathParameters := map[string]interface{}{ 1172 "applicationId": applicationID, 1173 } 1174 1175 const APIVersion = "6.0" 1176 queryParameters := map[string]interface{}{ 1177 "api-version": APIVersion, 1178 } 1179 if timeout != nil { 1180 queryParameters["timeout"] = autorest.Encode("query", *timeout) 1181 } else { 1182 queryParameters["timeout"] = autorest.Encode("query", 60) 1183 } 1184 1185 preparer := autorest.CreatePreparer( 1186 autorest.AsContentType("application/json; charset=utf-8"), 1187 autorest.AsPost(), 1188 autorest.WithBaseURL(client.BaseURI), 1189 autorest.WithPathParameters("/Applications/{applicationId}/$/GetServices/$/CreateFromTemplate", pathParameters), 1190 autorest.WithJSON(serviceFromTemplateDescription), 1191 autorest.WithQueryParameters(queryParameters)) 1192 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 1193} 1194 1195// CreateServiceFromTemplateSender sends the CreateServiceFromTemplate request. The method will close the 1196// http.Response Body if it receives an error. 1197func (client BaseClient) CreateServiceFromTemplateSender(req *http.Request) (*http.Response, error) { 1198 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 1199 return autorest.SendWithSender(client, req, sd...) 1200} 1201 1202// CreateServiceFromTemplateResponder handles the response to the CreateServiceFromTemplate request. The method always 1203// closes the http.Response Body. 1204func (client BaseClient) CreateServiceFromTemplateResponder(resp *http.Response) (result autorest.Response, err error) { 1205 err = autorest.Respond( 1206 resp, 1207 client.ByInspecting(), 1208 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), 1209 autorest.ByClosing()) 1210 result.Response = resp 1211 return 1212} 1213 1214// DeleteApplication deletes an existing Service Fabric application. An application must be created before it can be 1215// deleted. Deleting an application will delete all services that are part of that application. By default, Service 1216// Fabric will try to close service replicas in a graceful manner and then delete the service. However, if a service is 1217// having issues closing the replica gracefully, the delete operation may take a long time or get stuck. Use the 1218// optional ForceRemove flag to skip the graceful close sequence and forcefully delete the application and all of the 1219// its services. 1220// Parameters: 1221// applicationID - the identity of the application. This is typically the full name of the application without 1222// the 'fabric:' URI scheme. 1223// Starting from version 6.0, hierarchical names are delimited with the "~" character. 1224// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" 1225// in 6.0+ and "myapp/app1" in previous versions. 1226// forceRemove - remove a Service Fabric application or service forcefully without going through the graceful 1227// shutdown sequence. This parameter can be used to forcefully delete an application or service for which 1228// delete is timing out due to issues in the service code that prevents graceful close of replicas. 1229// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 1230// duration that the client is willing to wait for the requested operation to complete. The default value for 1231// this parameter is 60 seconds. 1232func (client BaseClient) DeleteApplication(ctx context.Context, applicationID string, forceRemove *bool, timeout *int64) (result autorest.Response, err error) { 1233 if tracing.IsEnabled() { 1234 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.DeleteApplication") 1235 defer func() { 1236 sc := -1 1237 if result.Response != nil { 1238 sc = result.Response.StatusCode 1239 } 1240 tracing.EndSpan(ctx, sc, err) 1241 }() 1242 } 1243 if err := validation.Validate([]validation.Validation{ 1244 {TargetValue: timeout, 1245 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 1246 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 1247 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 1248 }}}}}); err != nil { 1249 return result, validation.NewError("servicefabric.BaseClient", "DeleteApplication", err.Error()) 1250 } 1251 1252 req, err := client.DeleteApplicationPreparer(ctx, applicationID, forceRemove, timeout) 1253 if err != nil { 1254 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeleteApplication", nil, "Failure preparing request") 1255 return 1256 } 1257 1258 resp, err := client.DeleteApplicationSender(req) 1259 if err != nil { 1260 result.Response = resp 1261 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeleteApplication", resp, "Failure sending request") 1262 return 1263 } 1264 1265 result, err = client.DeleteApplicationResponder(resp) 1266 if err != nil { 1267 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeleteApplication", resp, "Failure responding to request") 1268 } 1269 1270 return 1271} 1272 1273// DeleteApplicationPreparer prepares the DeleteApplication request. 1274func (client BaseClient) DeleteApplicationPreparer(ctx context.Context, applicationID string, forceRemove *bool, timeout *int64) (*http.Request, error) { 1275 pathParameters := map[string]interface{}{ 1276 "applicationId": applicationID, 1277 } 1278 1279 const APIVersion = "6.0" 1280 queryParameters := map[string]interface{}{ 1281 "api-version": APIVersion, 1282 } 1283 if forceRemove != nil { 1284 queryParameters["ForceRemove"] = autorest.Encode("query", *forceRemove) 1285 } 1286 if timeout != nil { 1287 queryParameters["timeout"] = autorest.Encode("query", *timeout) 1288 } else { 1289 queryParameters["timeout"] = autorest.Encode("query", 60) 1290 } 1291 1292 preparer := autorest.CreatePreparer( 1293 autorest.AsPost(), 1294 autorest.WithBaseURL(client.BaseURI), 1295 autorest.WithPathParameters("/Applications/{applicationId}/$/Delete", pathParameters), 1296 autorest.WithQueryParameters(queryParameters)) 1297 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 1298} 1299 1300// DeleteApplicationSender sends the DeleteApplication request. The method will close the 1301// http.Response Body if it receives an error. 1302func (client BaseClient) DeleteApplicationSender(req *http.Request) (*http.Response, error) { 1303 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 1304 return autorest.SendWithSender(client, req, sd...) 1305} 1306 1307// DeleteApplicationResponder handles the response to the DeleteApplication request. The method always 1308// closes the http.Response Body. 1309func (client BaseClient) DeleteApplicationResponder(resp *http.Response) (result autorest.Response, err error) { 1310 err = autorest.Respond( 1311 resp, 1312 client.ByInspecting(), 1313 azure.WithErrorUnlessStatusCode(http.StatusOK), 1314 autorest.ByClosing()) 1315 result.Response = resp 1316 return 1317} 1318 1319// DeleteBackupPolicy deletes an existing backup policy. A backup policy must be created before it can be deleted. A 1320// currently active backup policy, associated with any Service Fabric application, service or partition, cannot be 1321// deleted without first deleting the mapping. 1322// Parameters: 1323// backupPolicyName - the name of the backup policy. 1324// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 1325// duration that the client is willing to wait for the requested operation to complete. The default value for 1326// this parameter is 60 seconds. 1327func (client BaseClient) DeleteBackupPolicy(ctx context.Context, backupPolicyName string, timeout *int64) (result autorest.Response, err error) { 1328 if tracing.IsEnabled() { 1329 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.DeleteBackupPolicy") 1330 defer func() { 1331 sc := -1 1332 if result.Response != nil { 1333 sc = result.Response.StatusCode 1334 } 1335 tracing.EndSpan(ctx, sc, err) 1336 }() 1337 } 1338 if err := validation.Validate([]validation.Validation{ 1339 {TargetValue: timeout, 1340 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 1341 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 1342 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 1343 }}}}}); err != nil { 1344 return result, validation.NewError("servicefabric.BaseClient", "DeleteBackupPolicy", err.Error()) 1345 } 1346 1347 req, err := client.DeleteBackupPolicyPreparer(ctx, backupPolicyName, timeout) 1348 if err != nil { 1349 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeleteBackupPolicy", nil, "Failure preparing request") 1350 return 1351 } 1352 1353 resp, err := client.DeleteBackupPolicySender(req) 1354 if err != nil { 1355 result.Response = resp 1356 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeleteBackupPolicy", resp, "Failure sending request") 1357 return 1358 } 1359 1360 result, err = client.DeleteBackupPolicyResponder(resp) 1361 if err != nil { 1362 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeleteBackupPolicy", resp, "Failure responding to request") 1363 } 1364 1365 return 1366} 1367 1368// DeleteBackupPolicyPreparer prepares the DeleteBackupPolicy request. 1369func (client BaseClient) DeleteBackupPolicyPreparer(ctx context.Context, backupPolicyName string, timeout *int64) (*http.Request, error) { 1370 pathParameters := map[string]interface{}{ 1371 "backupPolicyName": autorest.Encode("path", backupPolicyName), 1372 } 1373 1374 const APIVersion = "6.2-preview" 1375 queryParameters := map[string]interface{}{ 1376 "api-version": APIVersion, 1377 } 1378 if timeout != nil { 1379 queryParameters["timeout"] = autorest.Encode("query", *timeout) 1380 } else { 1381 queryParameters["timeout"] = autorest.Encode("query", 60) 1382 } 1383 1384 preparer := autorest.CreatePreparer( 1385 autorest.AsPost(), 1386 autorest.WithBaseURL(client.BaseURI), 1387 autorest.WithPathParameters("/BackupRestore/BackupPolicies/{backupPolicyName}/$/Delete", pathParameters), 1388 autorest.WithQueryParameters(queryParameters)) 1389 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 1390} 1391 1392// DeleteBackupPolicySender sends the DeleteBackupPolicy request. The method will close the 1393// http.Response Body if it receives an error. 1394func (client BaseClient) DeleteBackupPolicySender(req *http.Request) (*http.Response, error) { 1395 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 1396 return autorest.SendWithSender(client, req, sd...) 1397} 1398 1399// DeleteBackupPolicyResponder handles the response to the DeleteBackupPolicy request. The method always 1400// closes the http.Response Body. 1401func (client BaseClient) DeleteBackupPolicyResponder(resp *http.Response) (result autorest.Response, err error) { 1402 err = autorest.Respond( 1403 resp, 1404 client.ByInspecting(), 1405 azure.WithErrorUnlessStatusCode(http.StatusOK), 1406 autorest.ByClosing()) 1407 result.Response = resp 1408 return 1409} 1410 1411// DeleteImageStoreContent deletes existing image store content being found within the given image store relative path. 1412// This can be used to delete uploaded application packages once they are provisioned. 1413// Parameters: 1414// contentPath - relative path to file or folder in the image store from its root. 1415// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 1416// duration that the client is willing to wait for the requested operation to complete. The default value for 1417// this parameter is 60 seconds. 1418func (client BaseClient) DeleteImageStoreContent(ctx context.Context, contentPath string, timeout *int64) (result autorest.Response, err error) { 1419 if tracing.IsEnabled() { 1420 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.DeleteImageStoreContent") 1421 defer func() { 1422 sc := -1 1423 if result.Response != nil { 1424 sc = result.Response.StatusCode 1425 } 1426 tracing.EndSpan(ctx, sc, err) 1427 }() 1428 } 1429 if err := validation.Validate([]validation.Validation{ 1430 {TargetValue: timeout, 1431 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 1432 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 1433 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 1434 }}}}}); err != nil { 1435 return result, validation.NewError("servicefabric.BaseClient", "DeleteImageStoreContent", err.Error()) 1436 } 1437 1438 req, err := client.DeleteImageStoreContentPreparer(ctx, contentPath, timeout) 1439 if err != nil { 1440 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeleteImageStoreContent", nil, "Failure preparing request") 1441 return 1442 } 1443 1444 resp, err := client.DeleteImageStoreContentSender(req) 1445 if err != nil { 1446 result.Response = resp 1447 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeleteImageStoreContent", resp, "Failure sending request") 1448 return 1449 } 1450 1451 result, err = client.DeleteImageStoreContentResponder(resp) 1452 if err != nil { 1453 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeleteImageStoreContent", resp, "Failure responding to request") 1454 } 1455 1456 return 1457} 1458 1459// DeleteImageStoreContentPreparer prepares the DeleteImageStoreContent request. 1460func (client BaseClient) DeleteImageStoreContentPreparer(ctx context.Context, contentPath string, timeout *int64) (*http.Request, error) { 1461 pathParameters := map[string]interface{}{ 1462 "contentPath": autorest.Encode("path", contentPath), 1463 } 1464 1465 const APIVersion = "6.0" 1466 queryParameters := map[string]interface{}{ 1467 "api-version": APIVersion, 1468 } 1469 if timeout != nil { 1470 queryParameters["timeout"] = autorest.Encode("query", *timeout) 1471 } else { 1472 queryParameters["timeout"] = autorest.Encode("query", 60) 1473 } 1474 1475 preparer := autorest.CreatePreparer( 1476 autorest.AsDelete(), 1477 autorest.WithBaseURL(client.BaseURI), 1478 autorest.WithPathParameters("/ImageStore/{contentPath}", pathParameters), 1479 autorest.WithQueryParameters(queryParameters)) 1480 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 1481} 1482 1483// DeleteImageStoreContentSender sends the DeleteImageStoreContent request. The method will close the 1484// http.Response Body if it receives an error. 1485func (client BaseClient) DeleteImageStoreContentSender(req *http.Request) (*http.Response, error) { 1486 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 1487 return autorest.SendWithSender(client, req, sd...) 1488} 1489 1490// DeleteImageStoreContentResponder handles the response to the DeleteImageStoreContent request. The method always 1491// closes the http.Response Body. 1492func (client BaseClient) DeleteImageStoreContentResponder(resp *http.Response) (result autorest.Response, err error) { 1493 err = autorest.Respond( 1494 resp, 1495 client.ByInspecting(), 1496 azure.WithErrorUnlessStatusCode(http.StatusOK), 1497 autorest.ByClosing()) 1498 result.Response = resp 1499 return 1500} 1501 1502// DeleteImageStoreUploadSession the DELETE request will cause the existing upload session to expire and remove any 1503// previously uploaded file chunks. 1504// Parameters: 1505// sessionID - a GUID generated by the user for a file uploading. It identifies an image store upload session 1506// which keeps track of all file chunks until it is committed. 1507// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 1508// duration that the client is willing to wait for the requested operation to complete. The default value for 1509// this parameter is 60 seconds. 1510func (client BaseClient) DeleteImageStoreUploadSession(ctx context.Context, sessionID uuid.UUID, timeout *int64) (result autorest.Response, err error) { 1511 if tracing.IsEnabled() { 1512 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.DeleteImageStoreUploadSession") 1513 defer func() { 1514 sc := -1 1515 if result.Response != nil { 1516 sc = result.Response.StatusCode 1517 } 1518 tracing.EndSpan(ctx, sc, err) 1519 }() 1520 } 1521 if err := validation.Validate([]validation.Validation{ 1522 {TargetValue: timeout, 1523 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 1524 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 1525 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 1526 }}}}}); err != nil { 1527 return result, validation.NewError("servicefabric.BaseClient", "DeleteImageStoreUploadSession", err.Error()) 1528 } 1529 1530 req, err := client.DeleteImageStoreUploadSessionPreparer(ctx, sessionID, timeout) 1531 if err != nil { 1532 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeleteImageStoreUploadSession", nil, "Failure preparing request") 1533 return 1534 } 1535 1536 resp, err := client.DeleteImageStoreUploadSessionSender(req) 1537 if err != nil { 1538 result.Response = resp 1539 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeleteImageStoreUploadSession", resp, "Failure sending request") 1540 return 1541 } 1542 1543 result, err = client.DeleteImageStoreUploadSessionResponder(resp) 1544 if err != nil { 1545 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeleteImageStoreUploadSession", resp, "Failure responding to request") 1546 } 1547 1548 return 1549} 1550 1551// DeleteImageStoreUploadSessionPreparer prepares the DeleteImageStoreUploadSession request. 1552func (client BaseClient) DeleteImageStoreUploadSessionPreparer(ctx context.Context, sessionID uuid.UUID, timeout *int64) (*http.Request, error) { 1553 const APIVersion = "6.0" 1554 queryParameters := map[string]interface{}{ 1555 "api-version": APIVersion, 1556 "session-id": autorest.Encode("query", sessionID), 1557 } 1558 if timeout != nil { 1559 queryParameters["timeout"] = autorest.Encode("query", *timeout) 1560 } else { 1561 queryParameters["timeout"] = autorest.Encode("query", 60) 1562 } 1563 1564 preparer := autorest.CreatePreparer( 1565 autorest.AsDelete(), 1566 autorest.WithBaseURL(client.BaseURI), 1567 autorest.WithPath("/ImageStore/$/DeleteUploadSession"), 1568 autorest.WithQueryParameters(queryParameters)) 1569 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 1570} 1571 1572// DeleteImageStoreUploadSessionSender sends the DeleteImageStoreUploadSession request. The method will close the 1573// http.Response Body if it receives an error. 1574func (client BaseClient) DeleteImageStoreUploadSessionSender(req *http.Request) (*http.Response, error) { 1575 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 1576 return autorest.SendWithSender(client, req, sd...) 1577} 1578 1579// DeleteImageStoreUploadSessionResponder handles the response to the DeleteImageStoreUploadSession request. The method always 1580// closes the http.Response Body. 1581func (client BaseClient) DeleteImageStoreUploadSessionResponder(resp *http.Response) (result autorest.Response, err error) { 1582 err = autorest.Respond( 1583 resp, 1584 client.ByInspecting(), 1585 azure.WithErrorUnlessStatusCode(http.StatusOK), 1586 autorest.ByClosing()) 1587 result.Response = resp 1588 return 1589} 1590 1591// DeleteName deletes the specified Service Fabric name. A name must be created before it can be deleted. Deleting a 1592// name with child properties will fail. 1593// Parameters: 1594// nameID - the Service Fabric name, without the 'fabric:' URI scheme. 1595// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 1596// duration that the client is willing to wait for the requested operation to complete. The default value for 1597// this parameter is 60 seconds. 1598func (client BaseClient) DeleteName(ctx context.Context, nameID string, timeout *int64) (result autorest.Response, err error) { 1599 if tracing.IsEnabled() { 1600 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.DeleteName") 1601 defer func() { 1602 sc := -1 1603 if result.Response != nil { 1604 sc = result.Response.StatusCode 1605 } 1606 tracing.EndSpan(ctx, sc, err) 1607 }() 1608 } 1609 if err := validation.Validate([]validation.Validation{ 1610 {TargetValue: timeout, 1611 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 1612 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 1613 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 1614 }}}}}); err != nil { 1615 return result, validation.NewError("servicefabric.BaseClient", "DeleteName", err.Error()) 1616 } 1617 1618 req, err := client.DeleteNamePreparer(ctx, nameID, timeout) 1619 if err != nil { 1620 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeleteName", nil, "Failure preparing request") 1621 return 1622 } 1623 1624 resp, err := client.DeleteNameSender(req) 1625 if err != nil { 1626 result.Response = resp 1627 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeleteName", resp, "Failure sending request") 1628 return 1629 } 1630 1631 result, err = client.DeleteNameResponder(resp) 1632 if err != nil { 1633 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeleteName", resp, "Failure responding to request") 1634 } 1635 1636 return 1637} 1638 1639// DeleteNamePreparer prepares the DeleteName request. 1640func (client BaseClient) DeleteNamePreparer(ctx context.Context, nameID string, timeout *int64) (*http.Request, error) { 1641 pathParameters := map[string]interface{}{ 1642 "nameId": nameID, 1643 } 1644 1645 const APIVersion = "6.0" 1646 queryParameters := map[string]interface{}{ 1647 "api-version": APIVersion, 1648 } 1649 if timeout != nil { 1650 queryParameters["timeout"] = autorest.Encode("query", *timeout) 1651 } else { 1652 queryParameters["timeout"] = autorest.Encode("query", 60) 1653 } 1654 1655 preparer := autorest.CreatePreparer( 1656 autorest.AsDelete(), 1657 autorest.WithBaseURL(client.BaseURI), 1658 autorest.WithPathParameters("/Names/{nameId}", pathParameters), 1659 autorest.WithQueryParameters(queryParameters)) 1660 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 1661} 1662 1663// DeleteNameSender sends the DeleteName request. The method will close the 1664// http.Response Body if it receives an error. 1665func (client BaseClient) DeleteNameSender(req *http.Request) (*http.Response, error) { 1666 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 1667 return autorest.SendWithSender(client, req, sd...) 1668} 1669 1670// DeleteNameResponder handles the response to the DeleteName request. The method always 1671// closes the http.Response Body. 1672func (client BaseClient) DeleteNameResponder(resp *http.Response) (result autorest.Response, err error) { 1673 err = autorest.Respond( 1674 resp, 1675 client.ByInspecting(), 1676 azure.WithErrorUnlessStatusCode(http.StatusOK), 1677 autorest.ByClosing()) 1678 result.Response = resp 1679 return 1680} 1681 1682// DeleteProperty deletes the specified Service Fabric property under a given name. A property must be created before 1683// it can be deleted. 1684// Parameters: 1685// nameID - the Service Fabric name, without the 'fabric:' URI scheme. 1686// propertyName - specifies the name of the property to get. 1687// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 1688// duration that the client is willing to wait for the requested operation to complete. The default value for 1689// this parameter is 60 seconds. 1690func (client BaseClient) DeleteProperty(ctx context.Context, nameID string, propertyName string, timeout *int64) (result autorest.Response, err error) { 1691 if tracing.IsEnabled() { 1692 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.DeleteProperty") 1693 defer func() { 1694 sc := -1 1695 if result.Response != nil { 1696 sc = result.Response.StatusCode 1697 } 1698 tracing.EndSpan(ctx, sc, err) 1699 }() 1700 } 1701 if err := validation.Validate([]validation.Validation{ 1702 {TargetValue: timeout, 1703 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 1704 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 1705 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 1706 }}}}}); err != nil { 1707 return result, validation.NewError("servicefabric.BaseClient", "DeleteProperty", err.Error()) 1708 } 1709 1710 req, err := client.DeletePropertyPreparer(ctx, nameID, propertyName, timeout) 1711 if err != nil { 1712 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeleteProperty", nil, "Failure preparing request") 1713 return 1714 } 1715 1716 resp, err := client.DeletePropertySender(req) 1717 if err != nil { 1718 result.Response = resp 1719 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeleteProperty", resp, "Failure sending request") 1720 return 1721 } 1722 1723 result, err = client.DeletePropertyResponder(resp) 1724 if err != nil { 1725 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeleteProperty", resp, "Failure responding to request") 1726 } 1727 1728 return 1729} 1730 1731// DeletePropertyPreparer prepares the DeleteProperty request. 1732func (client BaseClient) DeletePropertyPreparer(ctx context.Context, nameID string, propertyName string, timeout *int64) (*http.Request, error) { 1733 pathParameters := map[string]interface{}{ 1734 "nameId": nameID, 1735 } 1736 1737 const APIVersion = "6.0" 1738 queryParameters := map[string]interface{}{ 1739 "api-version": APIVersion, 1740 "PropertyName": autorest.Encode("query", propertyName), 1741 } 1742 if timeout != nil { 1743 queryParameters["timeout"] = autorest.Encode("query", *timeout) 1744 } else { 1745 queryParameters["timeout"] = autorest.Encode("query", 60) 1746 } 1747 1748 preparer := autorest.CreatePreparer( 1749 autorest.AsDelete(), 1750 autorest.WithBaseURL(client.BaseURI), 1751 autorest.WithPathParameters("/Names/{nameId}/$/GetProperty", pathParameters), 1752 autorest.WithQueryParameters(queryParameters)) 1753 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 1754} 1755 1756// DeletePropertySender sends the DeleteProperty request. The method will close the 1757// http.Response Body if it receives an error. 1758func (client BaseClient) DeletePropertySender(req *http.Request) (*http.Response, error) { 1759 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 1760 return autorest.SendWithSender(client, req, sd...) 1761} 1762 1763// DeletePropertyResponder handles the response to the DeleteProperty request. The method always 1764// closes the http.Response Body. 1765func (client BaseClient) DeletePropertyResponder(resp *http.Response) (result autorest.Response, err error) { 1766 err = autorest.Respond( 1767 resp, 1768 client.ByInspecting(), 1769 azure.WithErrorUnlessStatusCode(http.StatusOK), 1770 autorest.ByClosing()) 1771 result.Response = resp 1772 return 1773} 1774 1775// DeleteRepairTask this API supports the Service Fabric platform; it is not meant to be used directly from your code. 1776// Parameters: 1777// repairTaskDeleteDescription - describes the repair task to be deleted. 1778func (client BaseClient) DeleteRepairTask(ctx context.Context, repairTaskDeleteDescription RepairTaskDeleteDescription) (result autorest.Response, err error) { 1779 if tracing.IsEnabled() { 1780 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.DeleteRepairTask") 1781 defer func() { 1782 sc := -1 1783 if result.Response != nil { 1784 sc = result.Response.StatusCode 1785 } 1786 tracing.EndSpan(ctx, sc, err) 1787 }() 1788 } 1789 if err := validation.Validate([]validation.Validation{ 1790 {TargetValue: repairTaskDeleteDescription, 1791 Constraints: []validation.Constraint{{Target: "repairTaskDeleteDescription.TaskID", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { 1792 return result, validation.NewError("servicefabric.BaseClient", "DeleteRepairTask", err.Error()) 1793 } 1794 1795 req, err := client.DeleteRepairTaskPreparer(ctx, repairTaskDeleteDescription) 1796 if err != nil { 1797 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeleteRepairTask", nil, "Failure preparing request") 1798 return 1799 } 1800 1801 resp, err := client.DeleteRepairTaskSender(req) 1802 if err != nil { 1803 result.Response = resp 1804 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeleteRepairTask", resp, "Failure sending request") 1805 return 1806 } 1807 1808 result, err = client.DeleteRepairTaskResponder(resp) 1809 if err != nil { 1810 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeleteRepairTask", resp, "Failure responding to request") 1811 } 1812 1813 return 1814} 1815 1816// DeleteRepairTaskPreparer prepares the DeleteRepairTask request. 1817func (client BaseClient) DeleteRepairTaskPreparer(ctx context.Context, repairTaskDeleteDescription RepairTaskDeleteDescription) (*http.Request, error) { 1818 const APIVersion = "6.0" 1819 queryParameters := map[string]interface{}{ 1820 "api-version": APIVersion, 1821 } 1822 1823 preparer := autorest.CreatePreparer( 1824 autorest.AsContentType("application/json; charset=utf-8"), 1825 autorest.AsPost(), 1826 autorest.WithBaseURL(client.BaseURI), 1827 autorest.WithPath("/$/DeleteRepairTask"), 1828 autorest.WithJSON(repairTaskDeleteDescription), 1829 autorest.WithQueryParameters(queryParameters)) 1830 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 1831} 1832 1833// DeleteRepairTaskSender sends the DeleteRepairTask request. The method will close the 1834// http.Response Body if it receives an error. 1835func (client BaseClient) DeleteRepairTaskSender(req *http.Request) (*http.Response, error) { 1836 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 1837 return autorest.SendWithSender(client, req, sd...) 1838} 1839 1840// DeleteRepairTaskResponder handles the response to the DeleteRepairTask request. The method always 1841// closes the http.Response Body. 1842func (client BaseClient) DeleteRepairTaskResponder(resp *http.Response) (result autorest.Response, err error) { 1843 err = autorest.Respond( 1844 resp, 1845 client.ByInspecting(), 1846 azure.WithErrorUnlessStatusCode(http.StatusOK), 1847 autorest.ByClosing()) 1848 result.Response = resp 1849 return 1850} 1851 1852// DeleteService deletes an existing Service Fabric service. A service must be created before it can be deleted. By 1853// default, Service Fabric will try to close service replicas in a graceful manner and then delete the service. 1854// However, if the service is having issues closing the replica gracefully, the delete operation may take a long time 1855// or get stuck. Use the optional ForceRemove flag to skip the graceful close sequence and forcefully delete the 1856// service. 1857// Parameters: 1858// serviceID - the identity of the service. This is typically the full name of the service without the 1859// 'fabric:' URI scheme. 1860// Starting from version 6.0, hierarchical names are delimited with the "~" character. 1861// For example, if the service name is "fabric:/myapp/app1/svc1", the service identity would be 1862// "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in previous versions. 1863// forceRemove - remove a Service Fabric application or service forcefully without going through the graceful 1864// shutdown sequence. This parameter can be used to forcefully delete an application or service for which 1865// delete is timing out due to issues in the service code that prevents graceful close of replicas. 1866// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 1867// duration that the client is willing to wait for the requested operation to complete. The default value for 1868// this parameter is 60 seconds. 1869func (client BaseClient) DeleteService(ctx context.Context, serviceID string, forceRemove *bool, timeout *int64) (result autorest.Response, err error) { 1870 if tracing.IsEnabled() { 1871 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.DeleteService") 1872 defer func() { 1873 sc := -1 1874 if result.Response != nil { 1875 sc = result.Response.StatusCode 1876 } 1877 tracing.EndSpan(ctx, sc, err) 1878 }() 1879 } 1880 if err := validation.Validate([]validation.Validation{ 1881 {TargetValue: timeout, 1882 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 1883 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 1884 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 1885 }}}}}); err != nil { 1886 return result, validation.NewError("servicefabric.BaseClient", "DeleteService", err.Error()) 1887 } 1888 1889 req, err := client.DeleteServicePreparer(ctx, serviceID, forceRemove, timeout) 1890 if err != nil { 1891 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeleteService", nil, "Failure preparing request") 1892 return 1893 } 1894 1895 resp, err := client.DeleteServiceSender(req) 1896 if err != nil { 1897 result.Response = resp 1898 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeleteService", resp, "Failure sending request") 1899 return 1900 } 1901 1902 result, err = client.DeleteServiceResponder(resp) 1903 if err != nil { 1904 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeleteService", resp, "Failure responding to request") 1905 } 1906 1907 return 1908} 1909 1910// DeleteServicePreparer prepares the DeleteService request. 1911func (client BaseClient) DeleteServicePreparer(ctx context.Context, serviceID string, forceRemove *bool, timeout *int64) (*http.Request, error) { 1912 pathParameters := map[string]interface{}{ 1913 "serviceId": serviceID, 1914 } 1915 1916 const APIVersion = "6.0" 1917 queryParameters := map[string]interface{}{ 1918 "api-version": APIVersion, 1919 } 1920 if forceRemove != nil { 1921 queryParameters["ForceRemove"] = autorest.Encode("query", *forceRemove) 1922 } 1923 if timeout != nil { 1924 queryParameters["timeout"] = autorest.Encode("query", *timeout) 1925 } else { 1926 queryParameters["timeout"] = autorest.Encode("query", 60) 1927 } 1928 1929 preparer := autorest.CreatePreparer( 1930 autorest.AsPost(), 1931 autorest.WithBaseURL(client.BaseURI), 1932 autorest.WithPathParameters("/Services/{serviceId}/$/Delete", pathParameters), 1933 autorest.WithQueryParameters(queryParameters)) 1934 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 1935} 1936 1937// DeleteServiceSender sends the DeleteService request. The method will close the 1938// http.Response Body if it receives an error. 1939func (client BaseClient) DeleteServiceSender(req *http.Request) (*http.Response, error) { 1940 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 1941 return autorest.SendWithSender(client, req, sd...) 1942} 1943 1944// DeleteServiceResponder handles the response to the DeleteService request. The method always 1945// closes the http.Response Body. 1946func (client BaseClient) DeleteServiceResponder(resp *http.Response) (result autorest.Response, err error) { 1947 err = autorest.Respond( 1948 resp, 1949 client.ByInspecting(), 1950 azure.WithErrorUnlessStatusCode(http.StatusOK), 1951 autorest.ByClosing()) 1952 result.Response = resp 1953 return 1954} 1955 1956// DeployServicePackageToNode this API provides a way to download code packages including the container images on a 1957// specific node outside of the normal application deployment and upgrade path. This is useful for the large code 1958// packages and container images to be present on the node before the actual application deployment and upgrade, thus 1959// significantly reducing the total time required for the deployment or upgrade. 1960// Parameters: 1961// nodeName - the name of the node. 1962// deployServicePackageToNodeDescription - describes information for deploying a service package to a Service 1963// Fabric node. 1964// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 1965// duration that the client is willing to wait for the requested operation to complete. The default value for 1966// this parameter is 60 seconds. 1967func (client BaseClient) DeployServicePackageToNode(ctx context.Context, nodeName string, deployServicePackageToNodeDescription DeployServicePackageToNodeDescription, timeout *int64) (result autorest.Response, err error) { 1968 if tracing.IsEnabled() { 1969 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.DeployServicePackageToNode") 1970 defer func() { 1971 sc := -1 1972 if result.Response != nil { 1973 sc = result.Response.StatusCode 1974 } 1975 tracing.EndSpan(ctx, sc, err) 1976 }() 1977 } 1978 if err := validation.Validate([]validation.Validation{ 1979 {TargetValue: deployServicePackageToNodeDescription, 1980 Constraints: []validation.Constraint{{Target: "deployServicePackageToNodeDescription.ServiceManifestName", Name: validation.Null, Rule: true, Chain: nil}, 1981 {Target: "deployServicePackageToNodeDescription.ApplicationTypeName", Name: validation.Null, Rule: true, Chain: nil}, 1982 {Target: "deployServicePackageToNodeDescription.ApplicationTypeVersion", Name: validation.Null, Rule: true, Chain: nil}, 1983 {Target: "deployServicePackageToNodeDescription.NodeName", Name: validation.Null, Rule: true, Chain: nil}}}, 1984 {TargetValue: timeout, 1985 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 1986 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 1987 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 1988 }}}}}); err != nil { 1989 return result, validation.NewError("servicefabric.BaseClient", "DeployServicePackageToNode", err.Error()) 1990 } 1991 1992 req, err := client.DeployServicePackageToNodePreparer(ctx, nodeName, deployServicePackageToNodeDescription, timeout) 1993 if err != nil { 1994 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeployServicePackageToNode", nil, "Failure preparing request") 1995 return 1996 } 1997 1998 resp, err := client.DeployServicePackageToNodeSender(req) 1999 if err != nil { 2000 result.Response = resp 2001 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeployServicePackageToNode", resp, "Failure sending request") 2002 return 2003 } 2004 2005 result, err = client.DeployServicePackageToNodeResponder(resp) 2006 if err != nil { 2007 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeployServicePackageToNode", resp, "Failure responding to request") 2008 } 2009 2010 return 2011} 2012 2013// DeployServicePackageToNodePreparer prepares the DeployServicePackageToNode request. 2014func (client BaseClient) DeployServicePackageToNodePreparer(ctx context.Context, nodeName string, deployServicePackageToNodeDescription DeployServicePackageToNodeDescription, timeout *int64) (*http.Request, error) { 2015 pathParameters := map[string]interface{}{ 2016 "nodeName": autorest.Encode("path", nodeName), 2017 } 2018 2019 const APIVersion = "6.0" 2020 queryParameters := map[string]interface{}{ 2021 "api-version": APIVersion, 2022 } 2023 if timeout != nil { 2024 queryParameters["timeout"] = autorest.Encode("query", *timeout) 2025 } else { 2026 queryParameters["timeout"] = autorest.Encode("query", 60) 2027 } 2028 2029 preparer := autorest.CreatePreparer( 2030 autorest.AsContentType("application/json; charset=utf-8"), 2031 autorest.AsPost(), 2032 autorest.WithBaseURL(client.BaseURI), 2033 autorest.WithPathParameters("/Nodes/{nodeName}/$/DeployServicePackage", pathParameters), 2034 autorest.WithJSON(deployServicePackageToNodeDescription), 2035 autorest.WithQueryParameters(queryParameters)) 2036 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 2037} 2038 2039// DeployServicePackageToNodeSender sends the DeployServicePackageToNode request. The method will close the 2040// http.Response Body if it receives an error. 2041func (client BaseClient) DeployServicePackageToNodeSender(req *http.Request) (*http.Response, error) { 2042 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 2043 return autorest.SendWithSender(client, req, sd...) 2044} 2045 2046// DeployServicePackageToNodeResponder handles the response to the DeployServicePackageToNode request. The method always 2047// closes the http.Response Body. 2048func (client BaseClient) DeployServicePackageToNodeResponder(resp *http.Response) (result autorest.Response, err error) { 2049 err = autorest.Respond( 2050 resp, 2051 client.ByInspecting(), 2052 azure.WithErrorUnlessStatusCode(http.StatusOK), 2053 autorest.ByClosing()) 2054 result.Response = resp 2055 return 2056} 2057 2058// DisableApplicationBackup disables periodic backup of Service Fabric application which was previously enabled. 2059// Parameters: 2060// applicationID - the identity of the application. This is typically the full name of the application without 2061// the 'fabric:' URI scheme. 2062// Starting from version 6.0, hierarchical names are delimited with the "~" character. 2063// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" 2064// in 6.0+ and "myapp/app1" in previous versions. 2065// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 2066// duration that the client is willing to wait for the requested operation to complete. The default value for 2067// this parameter is 60 seconds. 2068func (client BaseClient) DisableApplicationBackup(ctx context.Context, applicationID string, timeout *int64) (result autorest.Response, err error) { 2069 if tracing.IsEnabled() { 2070 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.DisableApplicationBackup") 2071 defer func() { 2072 sc := -1 2073 if result.Response != nil { 2074 sc = result.Response.StatusCode 2075 } 2076 tracing.EndSpan(ctx, sc, err) 2077 }() 2078 } 2079 if err := validation.Validate([]validation.Validation{ 2080 {TargetValue: timeout, 2081 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 2082 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 2083 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 2084 }}}}}); err != nil { 2085 return result, validation.NewError("servicefabric.BaseClient", "DisableApplicationBackup", err.Error()) 2086 } 2087 2088 req, err := client.DisableApplicationBackupPreparer(ctx, applicationID, timeout) 2089 if err != nil { 2090 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DisableApplicationBackup", nil, "Failure preparing request") 2091 return 2092 } 2093 2094 resp, err := client.DisableApplicationBackupSender(req) 2095 if err != nil { 2096 result.Response = resp 2097 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DisableApplicationBackup", resp, "Failure sending request") 2098 return 2099 } 2100 2101 result, err = client.DisableApplicationBackupResponder(resp) 2102 if err != nil { 2103 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DisableApplicationBackup", resp, "Failure responding to request") 2104 } 2105 2106 return 2107} 2108 2109// DisableApplicationBackupPreparer prepares the DisableApplicationBackup request. 2110func (client BaseClient) DisableApplicationBackupPreparer(ctx context.Context, applicationID string, timeout *int64) (*http.Request, error) { 2111 pathParameters := map[string]interface{}{ 2112 "applicationId": applicationID, 2113 } 2114 2115 const APIVersion = "6.2-preview" 2116 queryParameters := map[string]interface{}{ 2117 "api-version": APIVersion, 2118 } 2119 if timeout != nil { 2120 queryParameters["timeout"] = autorest.Encode("query", *timeout) 2121 } else { 2122 queryParameters["timeout"] = autorest.Encode("query", 60) 2123 } 2124 2125 preparer := autorest.CreatePreparer( 2126 autorest.AsPost(), 2127 autorest.WithBaseURL(client.BaseURI), 2128 autorest.WithPathParameters("/Applications/{applicationId}/$/DisableBackup", pathParameters), 2129 autorest.WithQueryParameters(queryParameters)) 2130 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 2131} 2132 2133// DisableApplicationBackupSender sends the DisableApplicationBackup request. The method will close the 2134// http.Response Body if it receives an error. 2135func (client BaseClient) DisableApplicationBackupSender(req *http.Request) (*http.Response, error) { 2136 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 2137 return autorest.SendWithSender(client, req, sd...) 2138} 2139 2140// DisableApplicationBackupResponder handles the response to the DisableApplicationBackup request. The method always 2141// closes the http.Response Body. 2142func (client BaseClient) DisableApplicationBackupResponder(resp *http.Response) (result autorest.Response, err error) { 2143 err = autorest.Respond( 2144 resp, 2145 client.ByInspecting(), 2146 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), 2147 autorest.ByClosing()) 2148 result.Response = resp 2149 return 2150} 2151 2152// DisableNode deactivate a Service Fabric cluster node with the specified deactivation intent. Once the deactivation 2153// is in progress, the deactivation intent can be increased, but not decreased (for example, a node which is was 2154// deactivated with the Pause intent can be deactivated further with Restart, but not the other way around. Nodes may 2155// be reactivated using the Activate a node operation any time after they are deactivated. If the deactivation is not 2156// complete this will cancel the deactivation. A node which goes down and comes back up while deactivated will still 2157// need to be reactivated before services will be placed on that node. 2158// Parameters: 2159// nodeName - the name of the node. 2160// deactivationIntentDescription - describes the intent or reason for deactivating the node. 2161// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 2162// duration that the client is willing to wait for the requested operation to complete. The default value for 2163// this parameter is 60 seconds. 2164func (client BaseClient) DisableNode(ctx context.Context, nodeName string, deactivationIntentDescription DeactivationIntentDescription, timeout *int64) (result autorest.Response, err error) { 2165 if tracing.IsEnabled() { 2166 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.DisableNode") 2167 defer func() { 2168 sc := -1 2169 if result.Response != nil { 2170 sc = result.Response.StatusCode 2171 } 2172 tracing.EndSpan(ctx, sc, err) 2173 }() 2174 } 2175 if err := validation.Validate([]validation.Validation{ 2176 {TargetValue: timeout, 2177 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 2178 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 2179 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 2180 }}}}}); err != nil { 2181 return result, validation.NewError("servicefabric.BaseClient", "DisableNode", err.Error()) 2182 } 2183 2184 req, err := client.DisableNodePreparer(ctx, nodeName, deactivationIntentDescription, timeout) 2185 if err != nil { 2186 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DisableNode", nil, "Failure preparing request") 2187 return 2188 } 2189 2190 resp, err := client.DisableNodeSender(req) 2191 if err != nil { 2192 result.Response = resp 2193 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DisableNode", resp, "Failure sending request") 2194 return 2195 } 2196 2197 result, err = client.DisableNodeResponder(resp) 2198 if err != nil { 2199 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DisableNode", resp, "Failure responding to request") 2200 } 2201 2202 return 2203} 2204 2205// DisableNodePreparer prepares the DisableNode request. 2206func (client BaseClient) DisableNodePreparer(ctx context.Context, nodeName string, deactivationIntentDescription DeactivationIntentDescription, timeout *int64) (*http.Request, error) { 2207 pathParameters := map[string]interface{}{ 2208 "nodeName": autorest.Encode("path", nodeName), 2209 } 2210 2211 const APIVersion = "6.0" 2212 queryParameters := map[string]interface{}{ 2213 "api-version": APIVersion, 2214 } 2215 if timeout != nil { 2216 queryParameters["timeout"] = autorest.Encode("query", *timeout) 2217 } else { 2218 queryParameters["timeout"] = autorest.Encode("query", 60) 2219 } 2220 2221 preparer := autorest.CreatePreparer( 2222 autorest.AsContentType("application/json; charset=utf-8"), 2223 autorest.AsPost(), 2224 autorest.WithBaseURL(client.BaseURI), 2225 autorest.WithPathParameters("/Nodes/{nodeName}/$/Deactivate", pathParameters), 2226 autorest.WithJSON(deactivationIntentDescription), 2227 autorest.WithQueryParameters(queryParameters)) 2228 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 2229} 2230 2231// DisableNodeSender sends the DisableNode request. The method will close the 2232// http.Response Body if it receives an error. 2233func (client BaseClient) DisableNodeSender(req *http.Request) (*http.Response, error) { 2234 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 2235 return autorest.SendWithSender(client, req, sd...) 2236} 2237 2238// DisableNodeResponder handles the response to the DisableNode request. The method always 2239// closes the http.Response Body. 2240func (client BaseClient) DisableNodeResponder(resp *http.Response) (result autorest.Response, err error) { 2241 err = autorest.Respond( 2242 resp, 2243 client.ByInspecting(), 2244 azure.WithErrorUnlessStatusCode(http.StatusOK), 2245 autorest.ByClosing()) 2246 result.Response = resp 2247 return 2248} 2249 2250// DisablePartitionBackup disables periodic backup of partition which was previously enabled. Backup must be explicitly 2251// enabled before it can be disabled. 2252// In case the backup is enabled for the Service Fabric application or service, which this partition is part of, this 2253// partition would continue to be periodically backed up as per the policy mapped at the higher level entity. 2254// Parameters: 2255// partitionID - the identity of the partition. 2256// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 2257// duration that the client is willing to wait for the requested operation to complete. The default value for 2258// this parameter is 60 seconds. 2259func (client BaseClient) DisablePartitionBackup(ctx context.Context, partitionID uuid.UUID, timeout *int64) (result autorest.Response, err error) { 2260 if tracing.IsEnabled() { 2261 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.DisablePartitionBackup") 2262 defer func() { 2263 sc := -1 2264 if result.Response != nil { 2265 sc = result.Response.StatusCode 2266 } 2267 tracing.EndSpan(ctx, sc, err) 2268 }() 2269 } 2270 if err := validation.Validate([]validation.Validation{ 2271 {TargetValue: timeout, 2272 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 2273 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 2274 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 2275 }}}}}); err != nil { 2276 return result, validation.NewError("servicefabric.BaseClient", "DisablePartitionBackup", err.Error()) 2277 } 2278 2279 req, err := client.DisablePartitionBackupPreparer(ctx, partitionID, timeout) 2280 if err != nil { 2281 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DisablePartitionBackup", nil, "Failure preparing request") 2282 return 2283 } 2284 2285 resp, err := client.DisablePartitionBackupSender(req) 2286 if err != nil { 2287 result.Response = resp 2288 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DisablePartitionBackup", resp, "Failure sending request") 2289 return 2290 } 2291 2292 result, err = client.DisablePartitionBackupResponder(resp) 2293 if err != nil { 2294 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DisablePartitionBackup", resp, "Failure responding to request") 2295 } 2296 2297 return 2298} 2299 2300// DisablePartitionBackupPreparer prepares the DisablePartitionBackup request. 2301func (client BaseClient) DisablePartitionBackupPreparer(ctx context.Context, partitionID uuid.UUID, timeout *int64) (*http.Request, error) { 2302 pathParameters := map[string]interface{}{ 2303 "partitionId": partitionID, 2304 } 2305 2306 const APIVersion = "6.2-preview" 2307 queryParameters := map[string]interface{}{ 2308 "api-version": APIVersion, 2309 } 2310 if timeout != nil { 2311 queryParameters["timeout"] = autorest.Encode("query", *timeout) 2312 } else { 2313 queryParameters["timeout"] = autorest.Encode("query", 60) 2314 } 2315 2316 preparer := autorest.CreatePreparer( 2317 autorest.AsPost(), 2318 autorest.WithBaseURL(client.BaseURI), 2319 autorest.WithPathParameters("/Partitions/{partitionId}/$/DisableBackup", pathParameters), 2320 autorest.WithQueryParameters(queryParameters)) 2321 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 2322} 2323 2324// DisablePartitionBackupSender sends the DisablePartitionBackup request. The method will close the 2325// http.Response Body if it receives an error. 2326func (client BaseClient) DisablePartitionBackupSender(req *http.Request) (*http.Response, error) { 2327 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 2328 return autorest.SendWithSender(client, req, sd...) 2329} 2330 2331// DisablePartitionBackupResponder handles the response to the DisablePartitionBackup request. The method always 2332// closes the http.Response Body. 2333func (client BaseClient) DisablePartitionBackupResponder(resp *http.Response) (result autorest.Response, err error) { 2334 err = autorest.Respond( 2335 resp, 2336 client.ByInspecting(), 2337 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), 2338 autorest.ByClosing()) 2339 result.Response = resp 2340 return 2341} 2342 2343// DisableServiceBackup disables periodic backup of Service Fabric service which was previously enabled. Backup must be 2344// explicitly enabled before it can be disabled. 2345// In case the backup is enabled for the Service Fabric application, which this service is part of, this service would 2346// continue to be periodically backed up as per the policy mapped at the application level. 2347// Parameters: 2348// serviceID - the identity of the service. This is typically the full name of the service without the 2349// 'fabric:' URI scheme. 2350// Starting from version 6.0, hierarchical names are delimited with the "~" character. 2351// For example, if the service name is "fabric:/myapp/app1/svc1", the service identity would be 2352// "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in previous versions. 2353// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 2354// duration that the client is willing to wait for the requested operation to complete. The default value for 2355// this parameter is 60 seconds. 2356func (client BaseClient) DisableServiceBackup(ctx context.Context, serviceID string, timeout *int64) (result autorest.Response, err error) { 2357 if tracing.IsEnabled() { 2358 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.DisableServiceBackup") 2359 defer func() { 2360 sc := -1 2361 if result.Response != nil { 2362 sc = result.Response.StatusCode 2363 } 2364 tracing.EndSpan(ctx, sc, err) 2365 }() 2366 } 2367 if err := validation.Validate([]validation.Validation{ 2368 {TargetValue: timeout, 2369 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 2370 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 2371 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 2372 }}}}}); err != nil { 2373 return result, validation.NewError("servicefabric.BaseClient", "DisableServiceBackup", err.Error()) 2374 } 2375 2376 req, err := client.DisableServiceBackupPreparer(ctx, serviceID, timeout) 2377 if err != nil { 2378 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DisableServiceBackup", nil, "Failure preparing request") 2379 return 2380 } 2381 2382 resp, err := client.DisableServiceBackupSender(req) 2383 if err != nil { 2384 result.Response = resp 2385 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DisableServiceBackup", resp, "Failure sending request") 2386 return 2387 } 2388 2389 result, err = client.DisableServiceBackupResponder(resp) 2390 if err != nil { 2391 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DisableServiceBackup", resp, "Failure responding to request") 2392 } 2393 2394 return 2395} 2396 2397// DisableServiceBackupPreparer prepares the DisableServiceBackup request. 2398func (client BaseClient) DisableServiceBackupPreparer(ctx context.Context, serviceID string, timeout *int64) (*http.Request, error) { 2399 pathParameters := map[string]interface{}{ 2400 "serviceId": serviceID, 2401 } 2402 2403 const APIVersion = "6.2-preview" 2404 queryParameters := map[string]interface{}{ 2405 "api-version": APIVersion, 2406 } 2407 if timeout != nil { 2408 queryParameters["timeout"] = autorest.Encode("query", *timeout) 2409 } else { 2410 queryParameters["timeout"] = autorest.Encode("query", 60) 2411 } 2412 2413 preparer := autorest.CreatePreparer( 2414 autorest.AsPost(), 2415 autorest.WithBaseURL(client.BaseURI), 2416 autorest.WithPathParameters("/Services/{serviceId}/$/DisableBackup", pathParameters), 2417 autorest.WithQueryParameters(queryParameters)) 2418 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 2419} 2420 2421// DisableServiceBackupSender sends the DisableServiceBackup request. The method will close the 2422// http.Response Body if it receives an error. 2423func (client BaseClient) DisableServiceBackupSender(req *http.Request) (*http.Response, error) { 2424 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 2425 return autorest.SendWithSender(client, req, sd...) 2426} 2427 2428// DisableServiceBackupResponder handles the response to the DisableServiceBackup request. The method always 2429// closes the http.Response Body. 2430func (client BaseClient) DisableServiceBackupResponder(resp *http.Response) (result autorest.Response, err error) { 2431 err = autorest.Respond( 2432 resp, 2433 client.ByInspecting(), 2434 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), 2435 autorest.ByClosing()) 2436 result.Response = resp 2437 return 2438} 2439 2440// EnableApplicationBackup enables periodic backup of stateful partitions which are part of this Service Fabric 2441// application. Each partition is backed up individually as per the specified backup policy description. 2442// Note only C# based Reliable Actor and Reliable Stateful services are currently supported for periodic backup. 2443// Parameters: 2444// applicationID - the identity of the application. This is typically the full name of the application without 2445// the 'fabric:' URI scheme. 2446// Starting from version 6.0, hierarchical names are delimited with the "~" character. 2447// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" 2448// in 6.0+ and "myapp/app1" in previous versions. 2449// enableBackupDescription - specifies the parameters for enabling backup. 2450// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 2451// duration that the client is willing to wait for the requested operation to complete. The default value for 2452// this parameter is 60 seconds. 2453func (client BaseClient) EnableApplicationBackup(ctx context.Context, applicationID string, enableBackupDescription EnableBackupDescription, timeout *int64) (result autorest.Response, err error) { 2454 if tracing.IsEnabled() { 2455 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.EnableApplicationBackup") 2456 defer func() { 2457 sc := -1 2458 if result.Response != nil { 2459 sc = result.Response.StatusCode 2460 } 2461 tracing.EndSpan(ctx, sc, err) 2462 }() 2463 } 2464 if err := validation.Validate([]validation.Validation{ 2465 {TargetValue: enableBackupDescription, 2466 Constraints: []validation.Constraint{{Target: "enableBackupDescription.BackupPolicyName", Name: validation.Null, Rule: true, Chain: nil}}}, 2467 {TargetValue: timeout, 2468 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 2469 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 2470 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 2471 }}}}}); err != nil { 2472 return result, validation.NewError("servicefabric.BaseClient", "EnableApplicationBackup", err.Error()) 2473 } 2474 2475 req, err := client.EnableApplicationBackupPreparer(ctx, applicationID, enableBackupDescription, timeout) 2476 if err != nil { 2477 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "EnableApplicationBackup", nil, "Failure preparing request") 2478 return 2479 } 2480 2481 resp, err := client.EnableApplicationBackupSender(req) 2482 if err != nil { 2483 result.Response = resp 2484 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "EnableApplicationBackup", resp, "Failure sending request") 2485 return 2486 } 2487 2488 result, err = client.EnableApplicationBackupResponder(resp) 2489 if err != nil { 2490 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "EnableApplicationBackup", resp, "Failure responding to request") 2491 } 2492 2493 return 2494} 2495 2496// EnableApplicationBackupPreparer prepares the EnableApplicationBackup request. 2497func (client BaseClient) EnableApplicationBackupPreparer(ctx context.Context, applicationID string, enableBackupDescription EnableBackupDescription, timeout *int64) (*http.Request, error) { 2498 pathParameters := map[string]interface{}{ 2499 "applicationId": applicationID, 2500 } 2501 2502 const APIVersion = "6.2-preview" 2503 queryParameters := map[string]interface{}{ 2504 "api-version": APIVersion, 2505 } 2506 if timeout != nil { 2507 queryParameters["timeout"] = autorest.Encode("query", *timeout) 2508 } else { 2509 queryParameters["timeout"] = autorest.Encode("query", 60) 2510 } 2511 2512 preparer := autorest.CreatePreparer( 2513 autorest.AsContentType("application/json; charset=utf-8"), 2514 autorest.AsPost(), 2515 autorest.WithBaseURL(client.BaseURI), 2516 autorest.WithPathParameters("/Applications/{applicationId}/$/EnableBackup", pathParameters), 2517 autorest.WithJSON(enableBackupDescription), 2518 autorest.WithQueryParameters(queryParameters)) 2519 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 2520} 2521 2522// EnableApplicationBackupSender sends the EnableApplicationBackup request. The method will close the 2523// http.Response Body if it receives an error. 2524func (client BaseClient) EnableApplicationBackupSender(req *http.Request) (*http.Response, error) { 2525 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 2526 return autorest.SendWithSender(client, req, sd...) 2527} 2528 2529// EnableApplicationBackupResponder handles the response to the EnableApplicationBackup request. The method always 2530// closes the http.Response Body. 2531func (client BaseClient) EnableApplicationBackupResponder(resp *http.Response) (result autorest.Response, err error) { 2532 err = autorest.Respond( 2533 resp, 2534 client.ByInspecting(), 2535 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), 2536 autorest.ByClosing()) 2537 result.Response = resp 2538 return 2539} 2540 2541// EnableNode activates a Service Fabric cluster node which is currently deactivated. Once activated, the node will 2542// again become a viable target for placing new replicas, and any deactivated replicas remaining on the node will be 2543// reactivated. 2544// Parameters: 2545// nodeName - the name of the node. 2546// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 2547// duration that the client is willing to wait for the requested operation to complete. The default value for 2548// this parameter is 60 seconds. 2549func (client BaseClient) EnableNode(ctx context.Context, nodeName string, timeout *int64) (result autorest.Response, err error) { 2550 if tracing.IsEnabled() { 2551 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.EnableNode") 2552 defer func() { 2553 sc := -1 2554 if result.Response != nil { 2555 sc = result.Response.StatusCode 2556 } 2557 tracing.EndSpan(ctx, sc, err) 2558 }() 2559 } 2560 if err := validation.Validate([]validation.Validation{ 2561 {TargetValue: timeout, 2562 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 2563 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 2564 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 2565 }}}}}); err != nil { 2566 return result, validation.NewError("servicefabric.BaseClient", "EnableNode", err.Error()) 2567 } 2568 2569 req, err := client.EnableNodePreparer(ctx, nodeName, timeout) 2570 if err != nil { 2571 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "EnableNode", nil, "Failure preparing request") 2572 return 2573 } 2574 2575 resp, err := client.EnableNodeSender(req) 2576 if err != nil { 2577 result.Response = resp 2578 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "EnableNode", resp, "Failure sending request") 2579 return 2580 } 2581 2582 result, err = client.EnableNodeResponder(resp) 2583 if err != nil { 2584 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "EnableNode", resp, "Failure responding to request") 2585 } 2586 2587 return 2588} 2589 2590// EnableNodePreparer prepares the EnableNode request. 2591func (client BaseClient) EnableNodePreparer(ctx context.Context, nodeName string, timeout *int64) (*http.Request, error) { 2592 pathParameters := map[string]interface{}{ 2593 "nodeName": autorest.Encode("path", nodeName), 2594 } 2595 2596 const APIVersion = "6.0" 2597 queryParameters := map[string]interface{}{ 2598 "api-version": APIVersion, 2599 } 2600 if timeout != nil { 2601 queryParameters["timeout"] = autorest.Encode("query", *timeout) 2602 } else { 2603 queryParameters["timeout"] = autorest.Encode("query", 60) 2604 } 2605 2606 preparer := autorest.CreatePreparer( 2607 autorest.AsPost(), 2608 autorest.WithBaseURL(client.BaseURI), 2609 autorest.WithPathParameters("/Nodes/{nodeName}/$/Activate", pathParameters), 2610 autorest.WithQueryParameters(queryParameters)) 2611 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 2612} 2613 2614// EnableNodeSender sends the EnableNode request. The method will close the 2615// http.Response Body if it receives an error. 2616func (client BaseClient) EnableNodeSender(req *http.Request) (*http.Response, error) { 2617 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 2618 return autorest.SendWithSender(client, req, sd...) 2619} 2620 2621// EnableNodeResponder handles the response to the EnableNode request. The method always 2622// closes the http.Response Body. 2623func (client BaseClient) EnableNodeResponder(resp *http.Response) (result autorest.Response, err error) { 2624 err = autorest.Respond( 2625 resp, 2626 client.ByInspecting(), 2627 azure.WithErrorUnlessStatusCode(http.StatusOK), 2628 autorest.ByClosing()) 2629 result.Response = resp 2630 return 2631} 2632 2633// EnablePartitionBackup enables periodic backup of stateful persisted partition. Each partition is backed up as per 2634// the specified backup policy description. In case the application or service, which is partition is part of, is 2635// already enabled for backup then this operation would override the policy being used to take the periodic backup of 2636// this partition. 2637// Note only C# based Reliable Actor and Reliable Stateful services are currently supported for periodic backup. 2638// Parameters: 2639// partitionID - the identity of the partition. 2640// enableBackupDescription - specifies the parameters for enabling backup. 2641// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 2642// duration that the client is willing to wait for the requested operation to complete. The default value for 2643// this parameter is 60 seconds. 2644func (client BaseClient) EnablePartitionBackup(ctx context.Context, partitionID uuid.UUID, enableBackupDescription EnableBackupDescription, timeout *int64) (result autorest.Response, err error) { 2645 if tracing.IsEnabled() { 2646 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.EnablePartitionBackup") 2647 defer func() { 2648 sc := -1 2649 if result.Response != nil { 2650 sc = result.Response.StatusCode 2651 } 2652 tracing.EndSpan(ctx, sc, err) 2653 }() 2654 } 2655 if err := validation.Validate([]validation.Validation{ 2656 {TargetValue: enableBackupDescription, 2657 Constraints: []validation.Constraint{{Target: "enableBackupDescription.BackupPolicyName", Name: validation.Null, Rule: true, Chain: nil}}}, 2658 {TargetValue: timeout, 2659 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 2660 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 2661 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 2662 }}}}}); err != nil { 2663 return result, validation.NewError("servicefabric.BaseClient", "EnablePartitionBackup", err.Error()) 2664 } 2665 2666 req, err := client.EnablePartitionBackupPreparer(ctx, partitionID, enableBackupDescription, timeout) 2667 if err != nil { 2668 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "EnablePartitionBackup", nil, "Failure preparing request") 2669 return 2670 } 2671 2672 resp, err := client.EnablePartitionBackupSender(req) 2673 if err != nil { 2674 result.Response = resp 2675 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "EnablePartitionBackup", resp, "Failure sending request") 2676 return 2677 } 2678 2679 result, err = client.EnablePartitionBackupResponder(resp) 2680 if err != nil { 2681 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "EnablePartitionBackup", resp, "Failure responding to request") 2682 } 2683 2684 return 2685} 2686 2687// EnablePartitionBackupPreparer prepares the EnablePartitionBackup request. 2688func (client BaseClient) EnablePartitionBackupPreparer(ctx context.Context, partitionID uuid.UUID, enableBackupDescription EnableBackupDescription, timeout *int64) (*http.Request, error) { 2689 pathParameters := map[string]interface{}{ 2690 "partitionId": partitionID, 2691 } 2692 2693 const APIVersion = "6.2-preview" 2694 queryParameters := map[string]interface{}{ 2695 "api-version": APIVersion, 2696 } 2697 if timeout != nil { 2698 queryParameters["timeout"] = autorest.Encode("query", *timeout) 2699 } else { 2700 queryParameters["timeout"] = autorest.Encode("query", 60) 2701 } 2702 2703 preparer := autorest.CreatePreparer( 2704 autorest.AsContentType("application/json; charset=utf-8"), 2705 autorest.AsPost(), 2706 autorest.WithBaseURL(client.BaseURI), 2707 autorest.WithPathParameters("/Partitions/{partitionId}/$/EnableBackup", pathParameters), 2708 autorest.WithJSON(enableBackupDescription), 2709 autorest.WithQueryParameters(queryParameters)) 2710 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 2711} 2712 2713// EnablePartitionBackupSender sends the EnablePartitionBackup request. The method will close the 2714// http.Response Body if it receives an error. 2715func (client BaseClient) EnablePartitionBackupSender(req *http.Request) (*http.Response, error) { 2716 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 2717 return autorest.SendWithSender(client, req, sd...) 2718} 2719 2720// EnablePartitionBackupResponder handles the response to the EnablePartitionBackup request. The method always 2721// closes the http.Response Body. 2722func (client BaseClient) EnablePartitionBackupResponder(resp *http.Response) (result autorest.Response, err error) { 2723 err = autorest.Respond( 2724 resp, 2725 client.ByInspecting(), 2726 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), 2727 autorest.ByClosing()) 2728 result.Response = resp 2729 return 2730} 2731 2732// EnableServiceBackup enables periodic backup of stateful partitions which are part of this Service Fabric service. 2733// Each partition is backed up individually as per the specified backup policy description. In case the application, 2734// which the service is part of, is already enabled for backup then this operation would override the policy being used 2735// to take the periodic backup for this service and its partitions (unless explicitly overridden at the partition 2736// level). 2737// Note only C# based Reliable Actor and Reliable Stateful services are currently supported for periodic backup. 2738// Parameters: 2739// serviceID - the identity of the service. This is typically the full name of the service without the 2740// 'fabric:' URI scheme. 2741// Starting from version 6.0, hierarchical names are delimited with the "~" character. 2742// For example, if the service name is "fabric:/myapp/app1/svc1", the service identity would be 2743// "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in previous versions. 2744// enableBackupDescription - specifies the parameters for enabling backup. 2745// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 2746// duration that the client is willing to wait for the requested operation to complete. The default value for 2747// this parameter is 60 seconds. 2748func (client BaseClient) EnableServiceBackup(ctx context.Context, serviceID string, enableBackupDescription EnableBackupDescription, timeout *int64) (result autorest.Response, err error) { 2749 if tracing.IsEnabled() { 2750 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.EnableServiceBackup") 2751 defer func() { 2752 sc := -1 2753 if result.Response != nil { 2754 sc = result.Response.StatusCode 2755 } 2756 tracing.EndSpan(ctx, sc, err) 2757 }() 2758 } 2759 if err := validation.Validate([]validation.Validation{ 2760 {TargetValue: enableBackupDescription, 2761 Constraints: []validation.Constraint{{Target: "enableBackupDescription.BackupPolicyName", Name: validation.Null, Rule: true, Chain: nil}}}, 2762 {TargetValue: timeout, 2763 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 2764 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 2765 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 2766 }}}}}); err != nil { 2767 return result, validation.NewError("servicefabric.BaseClient", "EnableServiceBackup", err.Error()) 2768 } 2769 2770 req, err := client.EnableServiceBackupPreparer(ctx, serviceID, enableBackupDescription, timeout) 2771 if err != nil { 2772 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "EnableServiceBackup", nil, "Failure preparing request") 2773 return 2774 } 2775 2776 resp, err := client.EnableServiceBackupSender(req) 2777 if err != nil { 2778 result.Response = resp 2779 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "EnableServiceBackup", resp, "Failure sending request") 2780 return 2781 } 2782 2783 result, err = client.EnableServiceBackupResponder(resp) 2784 if err != nil { 2785 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "EnableServiceBackup", resp, "Failure responding to request") 2786 } 2787 2788 return 2789} 2790 2791// EnableServiceBackupPreparer prepares the EnableServiceBackup request. 2792func (client BaseClient) EnableServiceBackupPreparer(ctx context.Context, serviceID string, enableBackupDescription EnableBackupDescription, timeout *int64) (*http.Request, error) { 2793 pathParameters := map[string]interface{}{ 2794 "serviceId": serviceID, 2795 } 2796 2797 const APIVersion = "6.2-preview" 2798 queryParameters := map[string]interface{}{ 2799 "api-version": APIVersion, 2800 } 2801 if timeout != nil { 2802 queryParameters["timeout"] = autorest.Encode("query", *timeout) 2803 } else { 2804 queryParameters["timeout"] = autorest.Encode("query", 60) 2805 } 2806 2807 preparer := autorest.CreatePreparer( 2808 autorest.AsContentType("application/json; charset=utf-8"), 2809 autorest.AsPost(), 2810 autorest.WithBaseURL(client.BaseURI), 2811 autorest.WithPathParameters("/Services/{serviceId}/$/EnableBackup", pathParameters), 2812 autorest.WithJSON(enableBackupDescription), 2813 autorest.WithQueryParameters(queryParameters)) 2814 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 2815} 2816 2817// EnableServiceBackupSender sends the EnableServiceBackup request. The method will close the 2818// http.Response Body if it receives an error. 2819func (client BaseClient) EnableServiceBackupSender(req *http.Request) (*http.Response, error) { 2820 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 2821 return autorest.SendWithSender(client, req, sd...) 2822} 2823 2824// EnableServiceBackupResponder handles the response to the EnableServiceBackup request. The method always 2825// closes the http.Response Body. 2826func (client BaseClient) EnableServiceBackupResponder(resp *http.Response) (result autorest.Response, err error) { 2827 err = autorest.Respond( 2828 resp, 2829 client.ByInspecting(), 2830 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), 2831 autorest.ByClosing()) 2832 result.Response = resp 2833 return 2834} 2835 2836// ForceApproveRepairTask this API supports the Service Fabric platform; it is not meant to be used directly from your 2837// code. 2838// Parameters: 2839// repairTaskApproveDescription - describes the repair task to be approved. 2840func (client BaseClient) ForceApproveRepairTask(ctx context.Context, repairTaskApproveDescription RepairTaskApproveDescription) (result RepairTaskUpdateInfo, err error) { 2841 if tracing.IsEnabled() { 2842 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ForceApproveRepairTask") 2843 defer func() { 2844 sc := -1 2845 if result.Response.Response != nil { 2846 sc = result.Response.Response.StatusCode 2847 } 2848 tracing.EndSpan(ctx, sc, err) 2849 }() 2850 } 2851 if err := validation.Validate([]validation.Validation{ 2852 {TargetValue: repairTaskApproveDescription, 2853 Constraints: []validation.Constraint{{Target: "repairTaskApproveDescription.TaskID", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { 2854 return result, validation.NewError("servicefabric.BaseClient", "ForceApproveRepairTask", err.Error()) 2855 } 2856 2857 req, err := client.ForceApproveRepairTaskPreparer(ctx, repairTaskApproveDescription) 2858 if err != nil { 2859 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ForceApproveRepairTask", nil, "Failure preparing request") 2860 return 2861 } 2862 2863 resp, err := client.ForceApproveRepairTaskSender(req) 2864 if err != nil { 2865 result.Response = autorest.Response{Response: resp} 2866 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ForceApproveRepairTask", resp, "Failure sending request") 2867 return 2868 } 2869 2870 result, err = client.ForceApproveRepairTaskResponder(resp) 2871 if err != nil { 2872 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ForceApproveRepairTask", resp, "Failure responding to request") 2873 } 2874 2875 return 2876} 2877 2878// ForceApproveRepairTaskPreparer prepares the ForceApproveRepairTask request. 2879func (client BaseClient) ForceApproveRepairTaskPreparer(ctx context.Context, repairTaskApproveDescription RepairTaskApproveDescription) (*http.Request, error) { 2880 const APIVersion = "6.0" 2881 queryParameters := map[string]interface{}{ 2882 "api-version": APIVersion, 2883 } 2884 2885 preparer := autorest.CreatePreparer( 2886 autorest.AsContentType("application/json; charset=utf-8"), 2887 autorest.AsPost(), 2888 autorest.WithBaseURL(client.BaseURI), 2889 autorest.WithPath("/$/ForceApproveRepairTask"), 2890 autorest.WithJSON(repairTaskApproveDescription), 2891 autorest.WithQueryParameters(queryParameters)) 2892 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 2893} 2894 2895// ForceApproveRepairTaskSender sends the ForceApproveRepairTask request. The method will close the 2896// http.Response Body if it receives an error. 2897func (client BaseClient) ForceApproveRepairTaskSender(req *http.Request) (*http.Response, error) { 2898 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 2899 return autorest.SendWithSender(client, req, sd...) 2900} 2901 2902// ForceApproveRepairTaskResponder handles the response to the ForceApproveRepairTask request. The method always 2903// closes the http.Response Body. 2904func (client BaseClient) ForceApproveRepairTaskResponder(resp *http.Response) (result RepairTaskUpdateInfo, err error) { 2905 err = autorest.Respond( 2906 resp, 2907 client.ByInspecting(), 2908 azure.WithErrorUnlessStatusCode(http.StatusOK), 2909 autorest.ByUnmarshallingJSON(&result), 2910 autorest.ByClosing()) 2911 result.Response = autorest.Response{Response: resp} 2912 return 2913} 2914 2915// GetAadMetadata gets the Azure Active Directory metadata used for secured connection to cluster. 2916// This API is not supposed to be called separately. It provides information needed to set up an Azure Active Directory 2917// secured connection with a Service Fabric cluster. 2918// Parameters: 2919// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 2920// duration that the client is willing to wait for the requested operation to complete. The default value for 2921// this parameter is 60 seconds. 2922func (client BaseClient) GetAadMetadata(ctx context.Context, timeout *int64) (result AadMetadataObject, err error) { 2923 if tracing.IsEnabled() { 2924 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetAadMetadata") 2925 defer func() { 2926 sc := -1 2927 if result.Response.Response != nil { 2928 sc = result.Response.Response.StatusCode 2929 } 2930 tracing.EndSpan(ctx, sc, err) 2931 }() 2932 } 2933 if err := validation.Validate([]validation.Validation{ 2934 {TargetValue: timeout, 2935 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 2936 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 2937 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 2938 }}}}}); err != nil { 2939 return result, validation.NewError("servicefabric.BaseClient", "GetAadMetadata", err.Error()) 2940 } 2941 2942 req, err := client.GetAadMetadataPreparer(ctx, timeout) 2943 if err != nil { 2944 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetAadMetadata", nil, "Failure preparing request") 2945 return 2946 } 2947 2948 resp, err := client.GetAadMetadataSender(req) 2949 if err != nil { 2950 result.Response = autorest.Response{Response: resp} 2951 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetAadMetadata", resp, "Failure sending request") 2952 return 2953 } 2954 2955 result, err = client.GetAadMetadataResponder(resp) 2956 if err != nil { 2957 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetAadMetadata", resp, "Failure responding to request") 2958 } 2959 2960 return 2961} 2962 2963// GetAadMetadataPreparer prepares the GetAadMetadata request. 2964func (client BaseClient) GetAadMetadataPreparer(ctx context.Context, timeout *int64) (*http.Request, error) { 2965 const APIVersion = "6.0" 2966 queryParameters := map[string]interface{}{ 2967 "api-version": APIVersion, 2968 } 2969 if timeout != nil { 2970 queryParameters["timeout"] = autorest.Encode("query", *timeout) 2971 } else { 2972 queryParameters["timeout"] = autorest.Encode("query", 60) 2973 } 2974 2975 preparer := autorest.CreatePreparer( 2976 autorest.AsGet(), 2977 autorest.WithBaseURL(client.BaseURI), 2978 autorest.WithPath("/$/GetAadMetadata"), 2979 autorest.WithQueryParameters(queryParameters)) 2980 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 2981} 2982 2983// GetAadMetadataSender sends the GetAadMetadata request. The method will close the 2984// http.Response Body if it receives an error. 2985func (client BaseClient) GetAadMetadataSender(req *http.Request) (*http.Response, error) { 2986 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 2987 return autorest.SendWithSender(client, req, sd...) 2988} 2989 2990// GetAadMetadataResponder handles the response to the GetAadMetadata request. The method always 2991// closes the http.Response Body. 2992func (client BaseClient) GetAadMetadataResponder(resp *http.Response) (result AadMetadataObject, err error) { 2993 err = autorest.Respond( 2994 resp, 2995 client.ByInspecting(), 2996 azure.WithErrorUnlessStatusCode(http.StatusOK), 2997 autorest.ByUnmarshallingJSON(&result), 2998 autorest.ByClosing()) 2999 result.Response = autorest.Response{Response: resp} 3000 return 3001} 3002 3003// GetAllEntitiesBackedUpByPolicy returns a list of Service Fabric application, service or partition which are 3004// associated with this backup policy. 3005// Parameters: 3006// backupPolicyName - the name of the backup policy. 3007// continuationToken - the continuation token parameter is used to obtain next set of results. A continuation 3008// token with a non empty value is included in the response of the API when the results from the system do not 3009// fit in a single response. When this value is passed to the next API call, the API returns next set of 3010// results. If there are no further results then the continuation token does not contain a value. The value of 3011// this parameter should not be URL encoded. 3012// maxResults - the maximum number of results to be returned as part of the paged queries. This parameter 3013// defines the upper bound on the number of results returned. The results returned can be less than the 3014// specified maximum results if they do not fit in the message as per the max message size restrictions defined 3015// in the configuration. If this parameter is zero or not specified, the paged queries includes as many results 3016// as possible that fit in the return message. 3017// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 3018// duration that the client is willing to wait for the requested operation to complete. The default value for 3019// this parameter is 60 seconds. 3020func (client BaseClient) GetAllEntitiesBackedUpByPolicy(ctx context.Context, backupPolicyName string, continuationToken string, maxResults *int64, timeout *int64) (result PagedBackupEntityList, err error) { 3021 if tracing.IsEnabled() { 3022 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetAllEntitiesBackedUpByPolicy") 3023 defer func() { 3024 sc := -1 3025 if result.Response.Response != nil { 3026 sc = result.Response.Response.StatusCode 3027 } 3028 tracing.EndSpan(ctx, sc, err) 3029 }() 3030 } 3031 if err := validation.Validate([]validation.Validation{ 3032 {TargetValue: maxResults, 3033 Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false, 3034 Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}, 3035 {TargetValue: timeout, 3036 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 3037 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 3038 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 3039 }}}}}); err != nil { 3040 return result, validation.NewError("servicefabric.BaseClient", "GetAllEntitiesBackedUpByPolicy", err.Error()) 3041 } 3042 3043 req, err := client.GetAllEntitiesBackedUpByPolicyPreparer(ctx, backupPolicyName, continuationToken, maxResults, timeout) 3044 if err != nil { 3045 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetAllEntitiesBackedUpByPolicy", nil, "Failure preparing request") 3046 return 3047 } 3048 3049 resp, err := client.GetAllEntitiesBackedUpByPolicySender(req) 3050 if err != nil { 3051 result.Response = autorest.Response{Response: resp} 3052 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetAllEntitiesBackedUpByPolicy", resp, "Failure sending request") 3053 return 3054 } 3055 3056 result, err = client.GetAllEntitiesBackedUpByPolicyResponder(resp) 3057 if err != nil { 3058 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetAllEntitiesBackedUpByPolicy", resp, "Failure responding to request") 3059 } 3060 3061 return 3062} 3063 3064// GetAllEntitiesBackedUpByPolicyPreparer prepares the GetAllEntitiesBackedUpByPolicy request. 3065func (client BaseClient) GetAllEntitiesBackedUpByPolicyPreparer(ctx context.Context, backupPolicyName string, continuationToken string, maxResults *int64, timeout *int64) (*http.Request, error) { 3066 pathParameters := map[string]interface{}{ 3067 "backupPolicyName": autorest.Encode("path", backupPolicyName), 3068 } 3069 3070 const APIVersion = "6.2-preview" 3071 queryParameters := map[string]interface{}{ 3072 "api-version": APIVersion, 3073 } 3074 if len(continuationToken) > 0 { 3075 queryParameters["ContinuationToken"] = continuationToken 3076 } 3077 if maxResults != nil { 3078 queryParameters["MaxResults"] = autorest.Encode("query", *maxResults) 3079 } else { 3080 queryParameters["MaxResults"] = autorest.Encode("query", 0) 3081 } 3082 if timeout != nil { 3083 queryParameters["timeout"] = autorest.Encode("query", *timeout) 3084 } else { 3085 queryParameters["timeout"] = autorest.Encode("query", 60) 3086 } 3087 3088 preparer := autorest.CreatePreparer( 3089 autorest.AsGet(), 3090 autorest.WithBaseURL(client.BaseURI), 3091 autorest.WithPathParameters("/BackupRestore/BackupPolicies/{backupPolicyName}/$/GetBackupEnabledEntities", pathParameters), 3092 autorest.WithQueryParameters(queryParameters)) 3093 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 3094} 3095 3096// GetAllEntitiesBackedUpByPolicySender sends the GetAllEntitiesBackedUpByPolicy request. The method will close the 3097// http.Response Body if it receives an error. 3098func (client BaseClient) GetAllEntitiesBackedUpByPolicySender(req *http.Request) (*http.Response, error) { 3099 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 3100 return autorest.SendWithSender(client, req, sd...) 3101} 3102 3103// GetAllEntitiesBackedUpByPolicyResponder handles the response to the GetAllEntitiesBackedUpByPolicy request. The method always 3104// closes the http.Response Body. 3105func (client BaseClient) GetAllEntitiesBackedUpByPolicyResponder(resp *http.Response) (result PagedBackupEntityList, err error) { 3106 err = autorest.Respond( 3107 resp, 3108 client.ByInspecting(), 3109 azure.WithErrorUnlessStatusCode(http.StatusOK), 3110 autorest.ByUnmarshallingJSON(&result), 3111 autorest.ByClosing()) 3112 result.Response = autorest.Response{Response: resp} 3113 return 3114} 3115 3116// GetApplicationBackupConfigurationInfo gets the Service Fabric backup configuration information for the application 3117// and the services and partitions under this application. 3118// Parameters: 3119// applicationID - the identity of the application. This is typically the full name of the application without 3120// the 'fabric:' URI scheme. 3121// Starting from version 6.0, hierarchical names are delimited with the "~" character. 3122// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" 3123// in 6.0+ and "myapp/app1" in previous versions. 3124// continuationToken - the continuation token parameter is used to obtain next set of results. A continuation 3125// token with a non empty value is included in the response of the API when the results from the system do not 3126// fit in a single response. When this value is passed to the next API call, the API returns next set of 3127// results. If there are no further results then the continuation token does not contain a value. The value of 3128// this parameter should not be URL encoded. 3129// maxResults - the maximum number of results to be returned as part of the paged queries. This parameter 3130// defines the upper bound on the number of results returned. The results returned can be less than the 3131// specified maximum results if they do not fit in the message as per the max message size restrictions defined 3132// in the configuration. If this parameter is zero or not specified, the paged queries includes as many results 3133// as possible that fit in the return message. 3134// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 3135// duration that the client is willing to wait for the requested operation to complete. The default value for 3136// this parameter is 60 seconds. 3137func (client BaseClient) GetApplicationBackupConfigurationInfo(ctx context.Context, applicationID string, continuationToken string, maxResults *int64, timeout *int64) (result PagedBackupConfigurationInfoList, err error) { 3138 if tracing.IsEnabled() { 3139 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetApplicationBackupConfigurationInfo") 3140 defer func() { 3141 sc := -1 3142 if result.Response.Response != nil { 3143 sc = result.Response.Response.StatusCode 3144 } 3145 tracing.EndSpan(ctx, sc, err) 3146 }() 3147 } 3148 if err := validation.Validate([]validation.Validation{ 3149 {TargetValue: maxResults, 3150 Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false, 3151 Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}, 3152 {TargetValue: timeout, 3153 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 3154 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 3155 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 3156 }}}}}); err != nil { 3157 return result, validation.NewError("servicefabric.BaseClient", "GetApplicationBackupConfigurationInfo", err.Error()) 3158 } 3159 3160 req, err := client.GetApplicationBackupConfigurationInfoPreparer(ctx, applicationID, continuationToken, maxResults, timeout) 3161 if err != nil { 3162 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationBackupConfigurationInfo", nil, "Failure preparing request") 3163 return 3164 } 3165 3166 resp, err := client.GetApplicationBackupConfigurationInfoSender(req) 3167 if err != nil { 3168 result.Response = autorest.Response{Response: resp} 3169 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationBackupConfigurationInfo", resp, "Failure sending request") 3170 return 3171 } 3172 3173 result, err = client.GetApplicationBackupConfigurationInfoResponder(resp) 3174 if err != nil { 3175 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationBackupConfigurationInfo", resp, "Failure responding to request") 3176 } 3177 3178 return 3179} 3180 3181// GetApplicationBackupConfigurationInfoPreparer prepares the GetApplicationBackupConfigurationInfo request. 3182func (client BaseClient) GetApplicationBackupConfigurationInfoPreparer(ctx context.Context, applicationID string, continuationToken string, maxResults *int64, timeout *int64) (*http.Request, error) { 3183 pathParameters := map[string]interface{}{ 3184 "applicationId": applicationID, 3185 } 3186 3187 const APIVersion = "6.2-preview" 3188 queryParameters := map[string]interface{}{ 3189 "api-version": APIVersion, 3190 } 3191 if len(continuationToken) > 0 { 3192 queryParameters["ContinuationToken"] = continuationToken 3193 } 3194 if maxResults != nil { 3195 queryParameters["MaxResults"] = autorest.Encode("query", *maxResults) 3196 } else { 3197 queryParameters["MaxResults"] = autorest.Encode("query", 0) 3198 } 3199 if timeout != nil { 3200 queryParameters["timeout"] = autorest.Encode("query", *timeout) 3201 } else { 3202 queryParameters["timeout"] = autorest.Encode("query", 60) 3203 } 3204 3205 preparer := autorest.CreatePreparer( 3206 autorest.AsGet(), 3207 autorest.WithBaseURL(client.BaseURI), 3208 autorest.WithPathParameters("/Applications/{applicationId}/$/GetBackupConfigurationInfo", pathParameters), 3209 autorest.WithQueryParameters(queryParameters)) 3210 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 3211} 3212 3213// GetApplicationBackupConfigurationInfoSender sends the GetApplicationBackupConfigurationInfo request. The method will close the 3214// http.Response Body if it receives an error. 3215func (client BaseClient) GetApplicationBackupConfigurationInfoSender(req *http.Request) (*http.Response, error) { 3216 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 3217 return autorest.SendWithSender(client, req, sd...) 3218} 3219 3220// GetApplicationBackupConfigurationInfoResponder handles the response to the GetApplicationBackupConfigurationInfo request. The method always 3221// closes the http.Response Body. 3222func (client BaseClient) GetApplicationBackupConfigurationInfoResponder(resp *http.Response) (result PagedBackupConfigurationInfoList, err error) { 3223 err = autorest.Respond( 3224 resp, 3225 client.ByInspecting(), 3226 azure.WithErrorUnlessStatusCode(http.StatusOK), 3227 autorest.ByUnmarshallingJSON(&result), 3228 autorest.ByClosing()) 3229 result.Response = autorest.Response{Response: resp} 3230 return 3231} 3232 3233// GetApplicationBackupList returns a list of backups available for every partition in this Service Fabric application. 3234// The server enumerates all the backups available at the backup location configured in the backup policy. It also 3235// allows filtering of the result based on start and end datetime or just fetching the latest available backup for 3236// every partition. 3237// Parameters: 3238// applicationID - the identity of the application. This is typically the full name of the application without 3239// the 'fabric:' URI scheme. 3240// Starting from version 6.0, hierarchical names are delimited with the "~" character. 3241// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" 3242// in 6.0+ and "myapp/app1" in previous versions. 3243// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 3244// duration that the client is willing to wait for the requested operation to complete. The default value for 3245// this parameter is 60 seconds. 3246// latest - specifies whether to get only the most recent backup available for a partition for the specified 3247// time range. 3248// startDateTimeFilter - specify the start date time from which to enumerate backups, in datetime format. The 3249// date time must be specified in ISO8601 format. This is an optional parameter. If not specified, all backups 3250// from the beginning are enumerated. 3251// endDateTimeFilter - specify the end date time till which to enumerate backups, in datetime format. The date 3252// time must be specified in ISO8601 format. This is an optional parameter. If not specified, enumeration is 3253// done till the most recent backup. 3254// continuationToken - the continuation token parameter is used to obtain next set of results. A continuation 3255// token with a non empty value is included in the response of the API when the results from the system do not 3256// fit in a single response. When this value is passed to the next API call, the API returns next set of 3257// results. If there are no further results then the continuation token does not contain a value. The value of 3258// this parameter should not be URL encoded. 3259// maxResults - the maximum number of results to be returned as part of the paged queries. This parameter 3260// defines the upper bound on the number of results returned. The results returned can be less than the 3261// specified maximum results if they do not fit in the message as per the max message size restrictions defined 3262// in the configuration. If this parameter is zero or not specified, the paged queries includes as many results 3263// as possible that fit in the return message. 3264func (client BaseClient) GetApplicationBackupList(ctx context.Context, applicationID string, timeout *int64, latest *bool, startDateTimeFilter *date.Time, endDateTimeFilter *date.Time, continuationToken string, maxResults *int64) (result PagedBackupInfoList, err error) { 3265 if tracing.IsEnabled() { 3266 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetApplicationBackupList") 3267 defer func() { 3268 sc := -1 3269 if result.Response.Response != nil { 3270 sc = result.Response.Response.StatusCode 3271 } 3272 tracing.EndSpan(ctx, sc, err) 3273 }() 3274 } 3275 if err := validation.Validate([]validation.Validation{ 3276 {TargetValue: timeout, 3277 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 3278 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 3279 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 3280 }}}}, 3281 {TargetValue: maxResults, 3282 Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false, 3283 Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}}); err != nil { 3284 return result, validation.NewError("servicefabric.BaseClient", "GetApplicationBackupList", err.Error()) 3285 } 3286 3287 req, err := client.GetApplicationBackupListPreparer(ctx, applicationID, timeout, latest, startDateTimeFilter, endDateTimeFilter, continuationToken, maxResults) 3288 if err != nil { 3289 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationBackupList", nil, "Failure preparing request") 3290 return 3291 } 3292 3293 resp, err := client.GetApplicationBackupListSender(req) 3294 if err != nil { 3295 result.Response = autorest.Response{Response: resp} 3296 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationBackupList", resp, "Failure sending request") 3297 return 3298 } 3299 3300 result, err = client.GetApplicationBackupListResponder(resp) 3301 if err != nil { 3302 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationBackupList", resp, "Failure responding to request") 3303 } 3304 3305 return 3306} 3307 3308// GetApplicationBackupListPreparer prepares the GetApplicationBackupList request. 3309func (client BaseClient) GetApplicationBackupListPreparer(ctx context.Context, applicationID string, timeout *int64, latest *bool, startDateTimeFilter *date.Time, endDateTimeFilter *date.Time, continuationToken string, maxResults *int64) (*http.Request, error) { 3310 pathParameters := map[string]interface{}{ 3311 "applicationId": applicationID, 3312 } 3313 3314 const APIVersion = "6.2-preview" 3315 queryParameters := map[string]interface{}{ 3316 "api-version": APIVersion, 3317 } 3318 if timeout != nil { 3319 queryParameters["timeout"] = autorest.Encode("query", *timeout) 3320 } else { 3321 queryParameters["timeout"] = autorest.Encode("query", 60) 3322 } 3323 if latest != nil { 3324 queryParameters["Latest"] = autorest.Encode("query", *latest) 3325 } else { 3326 queryParameters["Latest"] = autorest.Encode("query", false) 3327 } 3328 if startDateTimeFilter != nil { 3329 queryParameters["StartDateTimeFilter"] = autorest.Encode("query", *startDateTimeFilter) 3330 } 3331 if endDateTimeFilter != nil { 3332 queryParameters["EndDateTimeFilter"] = autorest.Encode("query", *endDateTimeFilter) 3333 } 3334 if len(continuationToken) > 0 { 3335 queryParameters["ContinuationToken"] = continuationToken 3336 } 3337 if maxResults != nil { 3338 queryParameters["MaxResults"] = autorest.Encode("query", *maxResults) 3339 } else { 3340 queryParameters["MaxResults"] = autorest.Encode("query", 0) 3341 } 3342 3343 preparer := autorest.CreatePreparer( 3344 autorest.AsGet(), 3345 autorest.WithBaseURL(client.BaseURI), 3346 autorest.WithPathParameters("/Applications/{applicationId}/$/GetBackups", pathParameters), 3347 autorest.WithQueryParameters(queryParameters)) 3348 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 3349} 3350 3351// GetApplicationBackupListSender sends the GetApplicationBackupList request. The method will close the 3352// http.Response Body if it receives an error. 3353func (client BaseClient) GetApplicationBackupListSender(req *http.Request) (*http.Response, error) { 3354 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 3355 return autorest.SendWithSender(client, req, sd...) 3356} 3357 3358// GetApplicationBackupListResponder handles the response to the GetApplicationBackupList request. The method always 3359// closes the http.Response Body. 3360func (client BaseClient) GetApplicationBackupListResponder(resp *http.Response) (result PagedBackupInfoList, err error) { 3361 err = autorest.Respond( 3362 resp, 3363 client.ByInspecting(), 3364 azure.WithErrorUnlessStatusCode(http.StatusOK), 3365 autorest.ByUnmarshallingJSON(&result), 3366 autorest.ByClosing()) 3367 result.Response = autorest.Response{Response: resp} 3368 return 3369} 3370 3371// GetApplicationEventList the response is list of ApplicationEvent objects. 3372// Parameters: 3373// applicationID - the identity of the application. This is typically the full name of the application without 3374// the 'fabric:' URI scheme. 3375// Starting from version 6.0, hierarchical names are delimited with the "~" character. 3376// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" 3377// in 6.0+ and "myapp/app1" in previous versions. 3378// startTimeUtc - the start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. 3379// endTimeUtc - the end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. 3380// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 3381// duration that the client is willing to wait for the requested operation to complete. The default value for 3382// this parameter is 60 seconds. 3383// eventsTypesFilter - this is a comma separated string specifying the types of FabricEvents that should only 3384// be included in the response. 3385// excludeAnalysisEvents - this param disables the retrieval of AnalysisEvents if true is passed. 3386// skipCorrelationLookup - this param disables the search of CorrelatedEvents information if true is passed. 3387// otherwise the CorrelationEvents get processed and HasCorrelatedEvents field in every FabricEvent gets 3388// populated. 3389func (client BaseClient) GetApplicationEventList(ctx context.Context, applicationID string, startTimeUtc string, endTimeUtc string, timeout *int64, eventsTypesFilter string, excludeAnalysisEvents *bool, skipCorrelationLookup *bool) (result ListApplicationEvent, err error) { 3390 if tracing.IsEnabled() { 3391 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetApplicationEventList") 3392 defer func() { 3393 sc := -1 3394 if result.Response.Response != nil { 3395 sc = result.Response.Response.StatusCode 3396 } 3397 tracing.EndSpan(ctx, sc, err) 3398 }() 3399 } 3400 if err := validation.Validate([]validation.Validation{ 3401 {TargetValue: timeout, 3402 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 3403 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 3404 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 3405 }}}}}); err != nil { 3406 return result, validation.NewError("servicefabric.BaseClient", "GetApplicationEventList", err.Error()) 3407 } 3408 3409 req, err := client.GetApplicationEventListPreparer(ctx, applicationID, startTimeUtc, endTimeUtc, timeout, eventsTypesFilter, excludeAnalysisEvents, skipCorrelationLookup) 3410 if err != nil { 3411 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationEventList", nil, "Failure preparing request") 3412 return 3413 } 3414 3415 resp, err := client.GetApplicationEventListSender(req) 3416 if err != nil { 3417 result.Response = autorest.Response{Response: resp} 3418 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationEventList", resp, "Failure sending request") 3419 return 3420 } 3421 3422 result, err = client.GetApplicationEventListResponder(resp) 3423 if err != nil { 3424 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationEventList", resp, "Failure responding to request") 3425 } 3426 3427 return 3428} 3429 3430// GetApplicationEventListPreparer prepares the GetApplicationEventList request. 3431func (client BaseClient) GetApplicationEventListPreparer(ctx context.Context, applicationID string, startTimeUtc string, endTimeUtc string, timeout *int64, eventsTypesFilter string, excludeAnalysisEvents *bool, skipCorrelationLookup *bool) (*http.Request, error) { 3432 pathParameters := map[string]interface{}{ 3433 "applicationId": applicationID, 3434 } 3435 3436 const APIVersion = "6.2-preview" 3437 queryParameters := map[string]interface{}{ 3438 "api-version": APIVersion, 3439 "EndTimeUtc": autorest.Encode("query", endTimeUtc), 3440 "StartTimeUtc": autorest.Encode("query", startTimeUtc), 3441 } 3442 if timeout != nil { 3443 queryParameters["timeout"] = autorest.Encode("query", *timeout) 3444 } else { 3445 queryParameters["timeout"] = autorest.Encode("query", 60) 3446 } 3447 if len(eventsTypesFilter) > 0 { 3448 queryParameters["EventsTypesFilter"] = autorest.Encode("query", eventsTypesFilter) 3449 } 3450 if excludeAnalysisEvents != nil { 3451 queryParameters["ExcludeAnalysisEvents"] = autorest.Encode("query", *excludeAnalysisEvents) 3452 } 3453 if skipCorrelationLookup != nil { 3454 queryParameters["SkipCorrelationLookup"] = autorest.Encode("query", *skipCorrelationLookup) 3455 } 3456 3457 preparer := autorest.CreatePreparer( 3458 autorest.AsGet(), 3459 autorest.WithBaseURL(client.BaseURI), 3460 autorest.WithPathParameters("/EventsStore/Applications/{applicationId}/$/Events", pathParameters), 3461 autorest.WithQueryParameters(queryParameters)) 3462 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 3463} 3464 3465// GetApplicationEventListSender sends the GetApplicationEventList request. The method will close the 3466// http.Response Body if it receives an error. 3467func (client BaseClient) GetApplicationEventListSender(req *http.Request) (*http.Response, error) { 3468 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 3469 return autorest.SendWithSender(client, req, sd...) 3470} 3471 3472// GetApplicationEventListResponder handles the response to the GetApplicationEventList request. The method always 3473// closes the http.Response Body. 3474func (client BaseClient) GetApplicationEventListResponder(resp *http.Response) (result ListApplicationEvent, err error) { 3475 err = autorest.Respond( 3476 resp, 3477 client.ByInspecting(), 3478 azure.WithErrorUnlessStatusCode(http.StatusOK), 3479 autorest.ByUnmarshallingJSON(&result), 3480 autorest.ByClosing()) 3481 result.Response = autorest.Response{Response: resp} 3482 return 3483} 3484 3485// GetApplicationHealth returns the heath state of the service fabric application. The response reports either Ok, 3486// Error or Warning health state. If the entity is not found in the health store, it will return Error. 3487// Parameters: 3488// applicationID - the identity of the application. This is typically the full name of the application without 3489// the 'fabric:' URI scheme. 3490// Starting from version 6.0, hierarchical names are delimited with the "~" character. 3491// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" 3492// in 6.0+ and "myapp/app1" in previous versions. 3493// eventsHealthStateFilter - allows filtering the collection of HealthEvent objects returned based on health 3494// state. 3495// The possible values for this parameter include integer value of one of the following health states. 3496// Only events that match the filter are returned. All events are used to evaluate the aggregated health state. 3497// If not specified, all entries are returned. The state values are flag based enumeration, so the value could 3498// be a combination of these value obtained using bitwise 'OR' operator. For example, If the provided value is 3499// 6 then all of the events with HealthState value of OK (2) and Warning (4) are returned. 3500// 3501// - Default - Default value. Matches any HealthState. The value is zero. 3502// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given 3503// collection of states. The value is 1. 3504// - Ok - Filter that matches input with HealthState value Ok. The value is 2. 3505// - Warning - Filter that matches input with HealthState value Warning. The value is 4. 3506// - Error - Filter that matches input with HealthState value Error. The value is 8. 3507// - All - Filter that matches input with any HealthState value. The value is 65535. 3508// deployedApplicationsHealthStateFilter - allows filtering of the deployed applications health state objects 3509// returned in the result of application health query based on their health state. 3510// The possible values for this parameter include integer value of one of the following health states. Only 3511// deployed applications that match the filter will be returned. 3512// All deployed applications are used to evaluate the aggregated health state. If not specified, all entries 3513// are returned. 3514// The state values are flag based enumeration, so the value could be a combination of these value obtained 3515// using bitwise 'OR' operator. 3516// For example, if the provided value is 6 then health state of deployed applications with HealthState value of 3517// OK (2) and Warning (4) are returned. 3518// 3519// - Default - Default value. Matches any HealthState. The value is zero. 3520// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given 3521// collection of states. The value is 1. 3522// - Ok - Filter that matches input with HealthState value Ok. The value is 2. 3523// - Warning - Filter that matches input with HealthState value Warning. The value is 4. 3524// - Error - Filter that matches input with HealthState value Error. The value is 8. 3525// - All - Filter that matches input with any HealthState value. The value is 65535. 3526// servicesHealthStateFilter - allows filtering of the services health state objects returned in the result of 3527// services health query based on their health state. 3528// The possible values for this parameter include integer value of one of the following health states. 3529// Only services that match the filter are returned. All services are used to evaluate the aggregated health 3530// state. 3531// If not specified, all entries are returned. The state values are flag based enumeration, so the value could 3532// be a combination of these value 3533// obtained using bitwise 'OR' operator. For example, if the provided value is 6 then health state of services 3534// with HealthState value of OK (2) and Warning (4) will be returned. 3535// 3536// - Default - Default value. Matches any HealthState. The value is zero. 3537// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given 3538// collection of states. The value is 1. 3539// - Ok - Filter that matches input with HealthState value Ok. The value is 2. 3540// - Warning - Filter that matches input with HealthState value Warning. The value is 4. 3541// - Error - Filter that matches input with HealthState value Error. The value is 8. 3542// - All - Filter that matches input with any HealthState value. The value is 65535. 3543// excludeHealthStatistics - indicates whether the health statistics should be returned as part of the query 3544// result. False by default. 3545// The statistics show the number of children entities in health state Ok, Warning, and Error. 3546// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 3547// duration that the client is willing to wait for the requested operation to complete. The default value for 3548// this parameter is 60 seconds. 3549func (client BaseClient) GetApplicationHealth(ctx context.Context, applicationID string, eventsHealthStateFilter *int32, deployedApplicationsHealthStateFilter *int32, servicesHealthStateFilter *int32, excludeHealthStatistics *bool, timeout *int64) (result ApplicationHealth, err error) { 3550 if tracing.IsEnabled() { 3551 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetApplicationHealth") 3552 defer func() { 3553 sc := -1 3554 if result.Response.Response != nil { 3555 sc = result.Response.Response.StatusCode 3556 } 3557 tracing.EndSpan(ctx, sc, err) 3558 }() 3559 } 3560 if err := validation.Validate([]validation.Validation{ 3561 {TargetValue: timeout, 3562 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 3563 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 3564 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 3565 }}}}}); err != nil { 3566 return result, validation.NewError("servicefabric.BaseClient", "GetApplicationHealth", err.Error()) 3567 } 3568 3569 req, err := client.GetApplicationHealthPreparer(ctx, applicationID, eventsHealthStateFilter, deployedApplicationsHealthStateFilter, servicesHealthStateFilter, excludeHealthStatistics, timeout) 3570 if err != nil { 3571 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationHealth", nil, "Failure preparing request") 3572 return 3573 } 3574 3575 resp, err := client.GetApplicationHealthSender(req) 3576 if err != nil { 3577 result.Response = autorest.Response{Response: resp} 3578 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationHealth", resp, "Failure sending request") 3579 return 3580 } 3581 3582 result, err = client.GetApplicationHealthResponder(resp) 3583 if err != nil { 3584 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationHealth", resp, "Failure responding to request") 3585 } 3586 3587 return 3588} 3589 3590// GetApplicationHealthPreparer prepares the GetApplicationHealth request. 3591func (client BaseClient) GetApplicationHealthPreparer(ctx context.Context, applicationID string, eventsHealthStateFilter *int32, deployedApplicationsHealthStateFilter *int32, servicesHealthStateFilter *int32, excludeHealthStatistics *bool, timeout *int64) (*http.Request, error) { 3592 pathParameters := map[string]interface{}{ 3593 "applicationId": applicationID, 3594 } 3595 3596 const APIVersion = "6.0" 3597 queryParameters := map[string]interface{}{ 3598 "api-version": APIVersion, 3599 } 3600 if eventsHealthStateFilter != nil { 3601 queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", *eventsHealthStateFilter) 3602 } else { 3603 queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", 0) 3604 } 3605 if deployedApplicationsHealthStateFilter != nil { 3606 queryParameters["DeployedApplicationsHealthStateFilter"] = autorest.Encode("query", *deployedApplicationsHealthStateFilter) 3607 } else { 3608 queryParameters["DeployedApplicationsHealthStateFilter"] = autorest.Encode("query", 0) 3609 } 3610 if servicesHealthStateFilter != nil { 3611 queryParameters["ServicesHealthStateFilter"] = autorest.Encode("query", *servicesHealthStateFilter) 3612 } else { 3613 queryParameters["ServicesHealthStateFilter"] = autorest.Encode("query", 0) 3614 } 3615 if excludeHealthStatistics != nil { 3616 queryParameters["ExcludeHealthStatistics"] = autorest.Encode("query", *excludeHealthStatistics) 3617 } else { 3618 queryParameters["ExcludeHealthStatistics"] = autorest.Encode("query", false) 3619 } 3620 if timeout != nil { 3621 queryParameters["timeout"] = autorest.Encode("query", *timeout) 3622 } else { 3623 queryParameters["timeout"] = autorest.Encode("query", 60) 3624 } 3625 3626 preparer := autorest.CreatePreparer( 3627 autorest.AsGet(), 3628 autorest.WithBaseURL(client.BaseURI), 3629 autorest.WithPathParameters("/Applications/{applicationId}/$/GetHealth", pathParameters), 3630 autorest.WithQueryParameters(queryParameters)) 3631 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 3632} 3633 3634// GetApplicationHealthSender sends the GetApplicationHealth request. The method will close the 3635// http.Response Body if it receives an error. 3636func (client BaseClient) GetApplicationHealthSender(req *http.Request) (*http.Response, error) { 3637 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 3638 return autorest.SendWithSender(client, req, sd...) 3639} 3640 3641// GetApplicationHealthResponder handles the response to the GetApplicationHealth request. The method always 3642// closes the http.Response Body. 3643func (client BaseClient) GetApplicationHealthResponder(resp *http.Response) (result ApplicationHealth, err error) { 3644 err = autorest.Respond( 3645 resp, 3646 client.ByInspecting(), 3647 azure.WithErrorUnlessStatusCode(http.StatusOK), 3648 autorest.ByUnmarshallingJSON(&result), 3649 autorest.ByClosing()) 3650 result.Response = autorest.Response{Response: resp} 3651 return 3652} 3653 3654// GetApplicationHealthUsingPolicy gets the health of a Service Fabric application. Use EventsHealthStateFilter to 3655// filter the collection of health events reported on the node based on the health state. Use ClusterHealthPolicies to 3656// override the health policies used to evaluate the health. 3657// Parameters: 3658// applicationID - the identity of the application. This is typically the full name of the application without 3659// the 'fabric:' URI scheme. 3660// Starting from version 6.0, hierarchical names are delimited with the "~" character. 3661// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" 3662// in 6.0+ and "myapp/app1" in previous versions. 3663// eventsHealthStateFilter - allows filtering the collection of HealthEvent objects returned based on health 3664// state. 3665// The possible values for this parameter include integer value of one of the following health states. 3666// Only events that match the filter are returned. All events are used to evaluate the aggregated health state. 3667// If not specified, all entries are returned. The state values are flag based enumeration, so the value could 3668// be a combination of these value obtained using bitwise 'OR' operator. For example, If the provided value is 3669// 6 then all of the events with HealthState value of OK (2) and Warning (4) are returned. 3670// 3671// - Default - Default value. Matches any HealthState. The value is zero. 3672// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given 3673// collection of states. The value is 1. 3674// - Ok - Filter that matches input with HealthState value Ok. The value is 2. 3675// - Warning - Filter that matches input with HealthState value Warning. The value is 4. 3676// - Error - Filter that matches input with HealthState value Error. The value is 8. 3677// - All - Filter that matches input with any HealthState value. The value is 65535. 3678// deployedApplicationsHealthStateFilter - allows filtering of the deployed applications health state objects 3679// returned in the result of application health query based on their health state. 3680// The possible values for this parameter include integer value of one of the following health states. Only 3681// deployed applications that match the filter will be returned. 3682// All deployed applications are used to evaluate the aggregated health state. If not specified, all entries 3683// are returned. 3684// The state values are flag based enumeration, so the value could be a combination of these value obtained 3685// using bitwise 'OR' operator. 3686// For example, if the provided value is 6 then health state of deployed applications with HealthState value of 3687// OK (2) and Warning (4) are returned. 3688// 3689// - Default - Default value. Matches any HealthState. The value is zero. 3690// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given 3691// collection of states. The value is 1. 3692// - Ok - Filter that matches input with HealthState value Ok. The value is 2. 3693// - Warning - Filter that matches input with HealthState value Warning. The value is 4. 3694// - Error - Filter that matches input with HealthState value Error. The value is 8. 3695// - All - Filter that matches input with any HealthState value. The value is 65535. 3696// servicesHealthStateFilter - allows filtering of the services health state objects returned in the result of 3697// services health query based on their health state. 3698// The possible values for this parameter include integer value of one of the following health states. 3699// Only services that match the filter are returned. All services are used to evaluate the aggregated health 3700// state. 3701// If not specified, all entries are returned. The state values are flag based enumeration, so the value could 3702// be a combination of these value 3703// obtained using bitwise 'OR' operator. For example, if the provided value is 6 then health state of services 3704// with HealthState value of OK (2) and Warning (4) will be returned. 3705// 3706// - Default - Default value. Matches any HealthState. The value is zero. 3707// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given 3708// collection of states. The value is 1. 3709// - Ok - Filter that matches input with HealthState value Ok. The value is 2. 3710// - Warning - Filter that matches input with HealthState value Warning. The value is 4. 3711// - Error - Filter that matches input with HealthState value Error. The value is 8. 3712// - All - Filter that matches input with any HealthState value. The value is 65535. 3713// excludeHealthStatistics - indicates whether the health statistics should be returned as part of the query 3714// result. False by default. 3715// The statistics show the number of children entities in health state Ok, Warning, and Error. 3716// applicationHealthPolicy - describes the health policies used to evaluate the health of an application or one 3717// of its children. 3718// If not present, the health evaluation uses the health policy from application manifest or the default health 3719// policy. 3720// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 3721// duration that the client is willing to wait for the requested operation to complete. The default value for 3722// this parameter is 60 seconds. 3723func (client BaseClient) GetApplicationHealthUsingPolicy(ctx context.Context, applicationID string, eventsHealthStateFilter *int32, deployedApplicationsHealthStateFilter *int32, servicesHealthStateFilter *int32, excludeHealthStatistics *bool, applicationHealthPolicy *ApplicationHealthPolicy, timeout *int64) (result ApplicationHealth, err error) { 3724 if tracing.IsEnabled() { 3725 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetApplicationHealthUsingPolicy") 3726 defer func() { 3727 sc := -1 3728 if result.Response.Response != nil { 3729 sc = result.Response.Response.StatusCode 3730 } 3731 tracing.EndSpan(ctx, sc, err) 3732 }() 3733 } 3734 if err := validation.Validate([]validation.Validation{ 3735 {TargetValue: timeout, 3736 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 3737 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 3738 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 3739 }}}}}); err != nil { 3740 return result, validation.NewError("servicefabric.BaseClient", "GetApplicationHealthUsingPolicy", err.Error()) 3741 } 3742 3743 req, err := client.GetApplicationHealthUsingPolicyPreparer(ctx, applicationID, eventsHealthStateFilter, deployedApplicationsHealthStateFilter, servicesHealthStateFilter, excludeHealthStatistics, applicationHealthPolicy, timeout) 3744 if err != nil { 3745 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationHealthUsingPolicy", nil, "Failure preparing request") 3746 return 3747 } 3748 3749 resp, err := client.GetApplicationHealthUsingPolicySender(req) 3750 if err != nil { 3751 result.Response = autorest.Response{Response: resp} 3752 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationHealthUsingPolicy", resp, "Failure sending request") 3753 return 3754 } 3755 3756 result, err = client.GetApplicationHealthUsingPolicyResponder(resp) 3757 if err != nil { 3758 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationHealthUsingPolicy", resp, "Failure responding to request") 3759 } 3760 3761 return 3762} 3763 3764// GetApplicationHealthUsingPolicyPreparer prepares the GetApplicationHealthUsingPolicy request. 3765func (client BaseClient) GetApplicationHealthUsingPolicyPreparer(ctx context.Context, applicationID string, eventsHealthStateFilter *int32, deployedApplicationsHealthStateFilter *int32, servicesHealthStateFilter *int32, excludeHealthStatistics *bool, applicationHealthPolicy *ApplicationHealthPolicy, timeout *int64) (*http.Request, error) { 3766 pathParameters := map[string]interface{}{ 3767 "applicationId": applicationID, 3768 } 3769 3770 const APIVersion = "6.0" 3771 queryParameters := map[string]interface{}{ 3772 "api-version": APIVersion, 3773 } 3774 if eventsHealthStateFilter != nil { 3775 queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", *eventsHealthStateFilter) 3776 } else { 3777 queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", 0) 3778 } 3779 if deployedApplicationsHealthStateFilter != nil { 3780 queryParameters["DeployedApplicationsHealthStateFilter"] = autorest.Encode("query", *deployedApplicationsHealthStateFilter) 3781 } else { 3782 queryParameters["DeployedApplicationsHealthStateFilter"] = autorest.Encode("query", 0) 3783 } 3784 if servicesHealthStateFilter != nil { 3785 queryParameters["ServicesHealthStateFilter"] = autorest.Encode("query", *servicesHealthStateFilter) 3786 } else { 3787 queryParameters["ServicesHealthStateFilter"] = autorest.Encode("query", 0) 3788 } 3789 if excludeHealthStatistics != nil { 3790 queryParameters["ExcludeHealthStatistics"] = autorest.Encode("query", *excludeHealthStatistics) 3791 } else { 3792 queryParameters["ExcludeHealthStatistics"] = autorest.Encode("query", false) 3793 } 3794 if timeout != nil { 3795 queryParameters["timeout"] = autorest.Encode("query", *timeout) 3796 } else { 3797 queryParameters["timeout"] = autorest.Encode("query", 60) 3798 } 3799 3800 preparer := autorest.CreatePreparer( 3801 autorest.AsContentType("application/json; charset=utf-8"), 3802 autorest.AsPost(), 3803 autorest.WithBaseURL(client.BaseURI), 3804 autorest.WithPathParameters("/Applications/{applicationId}/$/GetHealth", pathParameters), 3805 autorest.WithQueryParameters(queryParameters)) 3806 if applicationHealthPolicy != nil { 3807 preparer = autorest.DecoratePreparer(preparer, 3808 autorest.WithJSON(applicationHealthPolicy)) 3809 } 3810 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 3811} 3812 3813// GetApplicationHealthUsingPolicySender sends the GetApplicationHealthUsingPolicy request. The method will close the 3814// http.Response Body if it receives an error. 3815func (client BaseClient) GetApplicationHealthUsingPolicySender(req *http.Request) (*http.Response, error) { 3816 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 3817 return autorest.SendWithSender(client, req, sd...) 3818} 3819 3820// GetApplicationHealthUsingPolicyResponder handles the response to the GetApplicationHealthUsingPolicy request. The method always 3821// closes the http.Response Body. 3822func (client BaseClient) GetApplicationHealthUsingPolicyResponder(resp *http.Response) (result ApplicationHealth, err error) { 3823 err = autorest.Respond( 3824 resp, 3825 client.ByInspecting(), 3826 azure.WithErrorUnlessStatusCode(http.StatusOK), 3827 autorest.ByUnmarshallingJSON(&result), 3828 autorest.ByClosing()) 3829 result.Response = autorest.Response{Response: resp} 3830 return 3831} 3832 3833// GetApplicationInfo returns the information about the application that was created or in the process of being created 3834// in the Service Fabric cluster and whose name matches the one specified as the parameter. The response includes the 3835// name, type, status, parameters and other details about the application. 3836// Parameters: 3837// applicationID - the identity of the application. This is typically the full name of the application without 3838// the 'fabric:' URI scheme. 3839// Starting from version 6.0, hierarchical names are delimited with the "~" character. 3840// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" 3841// in 6.0+ and "myapp/app1" in previous versions. 3842// excludeApplicationParameters - the flag that specifies whether application parameters will be excluded from 3843// the result. 3844// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 3845// duration that the client is willing to wait for the requested operation to complete. The default value for 3846// this parameter is 60 seconds. 3847func (client BaseClient) GetApplicationInfo(ctx context.Context, applicationID string, excludeApplicationParameters *bool, timeout *int64) (result ApplicationInfo, err error) { 3848 if tracing.IsEnabled() { 3849 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetApplicationInfo") 3850 defer func() { 3851 sc := -1 3852 if result.Response.Response != nil { 3853 sc = result.Response.Response.StatusCode 3854 } 3855 tracing.EndSpan(ctx, sc, err) 3856 }() 3857 } 3858 if err := validation.Validate([]validation.Validation{ 3859 {TargetValue: timeout, 3860 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 3861 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 3862 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 3863 }}}}}); err != nil { 3864 return result, validation.NewError("servicefabric.BaseClient", "GetApplicationInfo", err.Error()) 3865 } 3866 3867 req, err := client.GetApplicationInfoPreparer(ctx, applicationID, excludeApplicationParameters, timeout) 3868 if err != nil { 3869 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationInfo", nil, "Failure preparing request") 3870 return 3871 } 3872 3873 resp, err := client.GetApplicationInfoSender(req) 3874 if err != nil { 3875 result.Response = autorest.Response{Response: resp} 3876 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationInfo", resp, "Failure sending request") 3877 return 3878 } 3879 3880 result, err = client.GetApplicationInfoResponder(resp) 3881 if err != nil { 3882 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationInfo", resp, "Failure responding to request") 3883 } 3884 3885 return 3886} 3887 3888// GetApplicationInfoPreparer prepares the GetApplicationInfo request. 3889func (client BaseClient) GetApplicationInfoPreparer(ctx context.Context, applicationID string, excludeApplicationParameters *bool, timeout *int64) (*http.Request, error) { 3890 pathParameters := map[string]interface{}{ 3891 "applicationId": applicationID, 3892 } 3893 3894 const APIVersion = "6.0" 3895 queryParameters := map[string]interface{}{ 3896 "api-version": APIVersion, 3897 } 3898 if excludeApplicationParameters != nil { 3899 queryParameters["ExcludeApplicationParameters"] = autorest.Encode("query", *excludeApplicationParameters) 3900 } else { 3901 queryParameters["ExcludeApplicationParameters"] = autorest.Encode("query", false) 3902 } 3903 if timeout != nil { 3904 queryParameters["timeout"] = autorest.Encode("query", *timeout) 3905 } else { 3906 queryParameters["timeout"] = autorest.Encode("query", 60) 3907 } 3908 3909 preparer := autorest.CreatePreparer( 3910 autorest.AsGet(), 3911 autorest.WithBaseURL(client.BaseURI), 3912 autorest.WithPathParameters("/Applications/{applicationId}", pathParameters), 3913 autorest.WithQueryParameters(queryParameters)) 3914 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 3915} 3916 3917// GetApplicationInfoSender sends the GetApplicationInfo request. The method will close the 3918// http.Response Body if it receives an error. 3919func (client BaseClient) GetApplicationInfoSender(req *http.Request) (*http.Response, error) { 3920 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 3921 return autorest.SendWithSender(client, req, sd...) 3922} 3923 3924// GetApplicationInfoResponder handles the response to the GetApplicationInfo request. The method always 3925// closes the http.Response Body. 3926func (client BaseClient) GetApplicationInfoResponder(resp *http.Response) (result ApplicationInfo, err error) { 3927 err = autorest.Respond( 3928 resp, 3929 client.ByInspecting(), 3930 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), 3931 autorest.ByUnmarshallingJSON(&result), 3932 autorest.ByClosing()) 3933 result.Response = autorest.Response{Response: resp} 3934 return 3935} 3936 3937// GetApplicationInfoList gets the information about the applications that were created or in the process of being 3938// created in the Service Fabric cluster and match the specified filters. The response includes the name, type, status, 3939// parameters, and other details about the application. If the applications do not fit in a page, one page of results 3940// is returned as well as a continuation token which can be used to get the next page. Filters ApplicationTypeName and 3941// ApplicationDefinitionKindFilter cannot be specified at the same time. 3942// Parameters: 3943// applicationDefinitionKindFilter - used to filter on ApplicationDefinitionKind which is the mechanism used to 3944// define a Service Fabric application. 3945// - Default - Default value, which performs the same function as selecting "All". The value is 0. 3946// - All - Filter that matches input with any ApplicationDefinitionKind value. The value is 65535. 3947// - ServiceFabricApplicationDescription - Filter that matches input with ApplicationDefinitionKind value 3948// ServiceFabricApplicationDescription. The value is 1. 3949// - Compose - Filter that matches input with ApplicationDefinitionKind value Compose. The value is 2. 3950// applicationTypeName - the application type name used to filter the applications to query for. This value 3951// should not contain the application type version. 3952// excludeApplicationParameters - the flag that specifies whether application parameters will be excluded from 3953// the result. 3954// continuationToken - the continuation token parameter is used to obtain next set of results. A continuation 3955// token with a non empty value is included in the response of the API when the results from the system do not 3956// fit in a single response. When this value is passed to the next API call, the API returns next set of 3957// results. If there are no further results then the continuation token does not contain a value. The value of 3958// this parameter should not be URL encoded. 3959// maxResults - the maximum number of results to be returned as part of the paged queries. This parameter 3960// defines the upper bound on the number of results returned. The results returned can be less than the 3961// specified maximum results if they do not fit in the message as per the max message size restrictions defined 3962// in the configuration. If this parameter is zero or not specified, the paged queries includes as many results 3963// as possible that fit in the return message. 3964// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 3965// duration that the client is willing to wait for the requested operation to complete. The default value for 3966// this parameter is 60 seconds. 3967func (client BaseClient) GetApplicationInfoList(ctx context.Context, applicationDefinitionKindFilter *int32, applicationTypeName string, excludeApplicationParameters *bool, continuationToken string, maxResults *int64, timeout *int64) (result PagedApplicationInfoList, err error) { 3968 if tracing.IsEnabled() { 3969 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetApplicationInfoList") 3970 defer func() { 3971 sc := -1 3972 if result.Response.Response != nil { 3973 sc = result.Response.Response.StatusCode 3974 } 3975 tracing.EndSpan(ctx, sc, err) 3976 }() 3977 } 3978 if err := validation.Validate([]validation.Validation{ 3979 {TargetValue: maxResults, 3980 Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false, 3981 Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}, 3982 {TargetValue: timeout, 3983 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 3984 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 3985 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 3986 }}}}}); err != nil { 3987 return result, validation.NewError("servicefabric.BaseClient", "GetApplicationInfoList", err.Error()) 3988 } 3989 3990 req, err := client.GetApplicationInfoListPreparer(ctx, applicationDefinitionKindFilter, applicationTypeName, excludeApplicationParameters, continuationToken, maxResults, timeout) 3991 if err != nil { 3992 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationInfoList", nil, "Failure preparing request") 3993 return 3994 } 3995 3996 resp, err := client.GetApplicationInfoListSender(req) 3997 if err != nil { 3998 result.Response = autorest.Response{Response: resp} 3999 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationInfoList", resp, "Failure sending request") 4000 return 4001 } 4002 4003 result, err = client.GetApplicationInfoListResponder(resp) 4004 if err != nil { 4005 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationInfoList", resp, "Failure responding to request") 4006 } 4007 4008 return 4009} 4010 4011// GetApplicationInfoListPreparer prepares the GetApplicationInfoList request. 4012func (client BaseClient) GetApplicationInfoListPreparer(ctx context.Context, applicationDefinitionKindFilter *int32, applicationTypeName string, excludeApplicationParameters *bool, continuationToken string, maxResults *int64, timeout *int64) (*http.Request, error) { 4013 const APIVersion = "6.1" 4014 queryParameters := map[string]interface{}{ 4015 "api-version": APIVersion, 4016 } 4017 if applicationDefinitionKindFilter != nil { 4018 queryParameters["ApplicationDefinitionKindFilter"] = autorest.Encode("query", *applicationDefinitionKindFilter) 4019 } else { 4020 queryParameters["ApplicationDefinitionKindFilter"] = autorest.Encode("query", 0) 4021 } 4022 if len(applicationTypeName) > 0 { 4023 queryParameters["ApplicationTypeName"] = autorest.Encode("query", applicationTypeName) 4024 } 4025 if excludeApplicationParameters != nil { 4026 queryParameters["ExcludeApplicationParameters"] = autorest.Encode("query", *excludeApplicationParameters) 4027 } else { 4028 queryParameters["ExcludeApplicationParameters"] = autorest.Encode("query", false) 4029 } 4030 if len(continuationToken) > 0 { 4031 queryParameters["ContinuationToken"] = continuationToken 4032 } 4033 if maxResults != nil { 4034 queryParameters["MaxResults"] = autorest.Encode("query", *maxResults) 4035 } else { 4036 queryParameters["MaxResults"] = autorest.Encode("query", 0) 4037 } 4038 if timeout != nil { 4039 queryParameters["timeout"] = autorest.Encode("query", *timeout) 4040 } else { 4041 queryParameters["timeout"] = autorest.Encode("query", 60) 4042 } 4043 4044 preparer := autorest.CreatePreparer( 4045 autorest.AsGet(), 4046 autorest.WithBaseURL(client.BaseURI), 4047 autorest.WithPath("/Applications"), 4048 autorest.WithQueryParameters(queryParameters)) 4049 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 4050} 4051 4052// GetApplicationInfoListSender sends the GetApplicationInfoList request. The method will close the 4053// http.Response Body if it receives an error. 4054func (client BaseClient) GetApplicationInfoListSender(req *http.Request) (*http.Response, error) { 4055 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 4056 return autorest.SendWithSender(client, req, sd...) 4057} 4058 4059// GetApplicationInfoListResponder handles the response to the GetApplicationInfoList request. The method always 4060// closes the http.Response Body. 4061func (client BaseClient) GetApplicationInfoListResponder(resp *http.Response) (result PagedApplicationInfoList, err error) { 4062 err = autorest.Respond( 4063 resp, 4064 client.ByInspecting(), 4065 azure.WithErrorUnlessStatusCode(http.StatusOK), 4066 autorest.ByUnmarshallingJSON(&result), 4067 autorest.ByClosing()) 4068 result.Response = autorest.Response{Response: resp} 4069 return 4070} 4071 4072// GetApplicationLoadInfo returns the load information about the application that was created or in the process of 4073// being created in the Service Fabric cluster and whose name matches the one specified as the parameter. The response 4074// includes the name, minimum nodes, maximum nodes, the number of nodes the application is occupying currently, and 4075// application load metric information about the application. 4076// Parameters: 4077// applicationID - the identity of the application. This is typically the full name of the application without 4078// the 'fabric:' URI scheme. 4079// Starting from version 6.0, hierarchical names are delimited with the "~" character. 4080// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" 4081// in 6.0+ and "myapp/app1" in previous versions. 4082// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 4083// duration that the client is willing to wait for the requested operation to complete. The default value for 4084// this parameter is 60 seconds. 4085func (client BaseClient) GetApplicationLoadInfo(ctx context.Context, applicationID string, timeout *int64) (result ApplicationLoadInfo, err error) { 4086 if tracing.IsEnabled() { 4087 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetApplicationLoadInfo") 4088 defer func() { 4089 sc := -1 4090 if result.Response.Response != nil { 4091 sc = result.Response.Response.StatusCode 4092 } 4093 tracing.EndSpan(ctx, sc, err) 4094 }() 4095 } 4096 if err := validation.Validate([]validation.Validation{ 4097 {TargetValue: timeout, 4098 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 4099 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 4100 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 4101 }}}}}); err != nil { 4102 return result, validation.NewError("servicefabric.BaseClient", "GetApplicationLoadInfo", err.Error()) 4103 } 4104 4105 req, err := client.GetApplicationLoadInfoPreparer(ctx, applicationID, timeout) 4106 if err != nil { 4107 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationLoadInfo", nil, "Failure preparing request") 4108 return 4109 } 4110 4111 resp, err := client.GetApplicationLoadInfoSender(req) 4112 if err != nil { 4113 result.Response = autorest.Response{Response: resp} 4114 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationLoadInfo", resp, "Failure sending request") 4115 return 4116 } 4117 4118 result, err = client.GetApplicationLoadInfoResponder(resp) 4119 if err != nil { 4120 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationLoadInfo", resp, "Failure responding to request") 4121 } 4122 4123 return 4124} 4125 4126// GetApplicationLoadInfoPreparer prepares the GetApplicationLoadInfo request. 4127func (client BaseClient) GetApplicationLoadInfoPreparer(ctx context.Context, applicationID string, timeout *int64) (*http.Request, error) { 4128 pathParameters := map[string]interface{}{ 4129 "applicationId": applicationID, 4130 } 4131 4132 const APIVersion = "6.0" 4133 queryParameters := map[string]interface{}{ 4134 "api-version": APIVersion, 4135 } 4136 if timeout != nil { 4137 queryParameters["timeout"] = autorest.Encode("query", *timeout) 4138 } else { 4139 queryParameters["timeout"] = autorest.Encode("query", 60) 4140 } 4141 4142 preparer := autorest.CreatePreparer( 4143 autorest.AsGet(), 4144 autorest.WithBaseURL(client.BaseURI), 4145 autorest.WithPathParameters("/Applications/{applicationId}/$/GetLoadInformation", pathParameters), 4146 autorest.WithQueryParameters(queryParameters)) 4147 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 4148} 4149 4150// GetApplicationLoadInfoSender sends the GetApplicationLoadInfo request. The method will close the 4151// http.Response Body if it receives an error. 4152func (client BaseClient) GetApplicationLoadInfoSender(req *http.Request) (*http.Response, error) { 4153 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 4154 return autorest.SendWithSender(client, req, sd...) 4155} 4156 4157// GetApplicationLoadInfoResponder handles the response to the GetApplicationLoadInfo request. The method always 4158// closes the http.Response Body. 4159func (client BaseClient) GetApplicationLoadInfoResponder(resp *http.Response) (result ApplicationLoadInfo, err error) { 4160 err = autorest.Respond( 4161 resp, 4162 client.ByInspecting(), 4163 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), 4164 autorest.ByUnmarshallingJSON(&result), 4165 autorest.ByClosing()) 4166 result.Response = autorest.Response{Response: resp} 4167 return 4168} 4169 4170// GetApplicationManifest gets the manifest describing an application type. The response contains the application 4171// manifest XML as a string. 4172// Parameters: 4173// applicationTypeName - the name of the application type. 4174// applicationTypeVersion - the version of the application type. 4175// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 4176// duration that the client is willing to wait for the requested operation to complete. The default value for 4177// this parameter is 60 seconds. 4178func (client BaseClient) GetApplicationManifest(ctx context.Context, applicationTypeName string, applicationTypeVersion string, timeout *int64) (result ApplicationTypeManifest, err error) { 4179 if tracing.IsEnabled() { 4180 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetApplicationManifest") 4181 defer func() { 4182 sc := -1 4183 if result.Response.Response != nil { 4184 sc = result.Response.Response.StatusCode 4185 } 4186 tracing.EndSpan(ctx, sc, err) 4187 }() 4188 } 4189 if err := validation.Validate([]validation.Validation{ 4190 {TargetValue: timeout, 4191 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 4192 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 4193 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 4194 }}}}}); err != nil { 4195 return result, validation.NewError("servicefabric.BaseClient", "GetApplicationManifest", err.Error()) 4196 } 4197 4198 req, err := client.GetApplicationManifestPreparer(ctx, applicationTypeName, applicationTypeVersion, timeout) 4199 if err != nil { 4200 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationManifest", nil, "Failure preparing request") 4201 return 4202 } 4203 4204 resp, err := client.GetApplicationManifestSender(req) 4205 if err != nil { 4206 result.Response = autorest.Response{Response: resp} 4207 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationManifest", resp, "Failure sending request") 4208 return 4209 } 4210 4211 result, err = client.GetApplicationManifestResponder(resp) 4212 if err != nil { 4213 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationManifest", resp, "Failure responding to request") 4214 } 4215 4216 return 4217} 4218 4219// GetApplicationManifestPreparer prepares the GetApplicationManifest request. 4220func (client BaseClient) GetApplicationManifestPreparer(ctx context.Context, applicationTypeName string, applicationTypeVersion string, timeout *int64) (*http.Request, error) { 4221 pathParameters := map[string]interface{}{ 4222 "applicationTypeName": autorest.Encode("path", applicationTypeName), 4223 } 4224 4225 const APIVersion = "6.0" 4226 queryParameters := map[string]interface{}{ 4227 "api-version": APIVersion, 4228 "ApplicationTypeVersion": autorest.Encode("query", applicationTypeVersion), 4229 } 4230 if timeout != nil { 4231 queryParameters["timeout"] = autorest.Encode("query", *timeout) 4232 } else { 4233 queryParameters["timeout"] = autorest.Encode("query", 60) 4234 } 4235 4236 preparer := autorest.CreatePreparer( 4237 autorest.AsGet(), 4238 autorest.WithBaseURL(client.BaseURI), 4239 autorest.WithPathParameters("/ApplicationTypes/{applicationTypeName}/$/GetApplicationManifest", pathParameters), 4240 autorest.WithQueryParameters(queryParameters)) 4241 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 4242} 4243 4244// GetApplicationManifestSender sends the GetApplicationManifest request. The method will close the 4245// http.Response Body if it receives an error. 4246func (client BaseClient) GetApplicationManifestSender(req *http.Request) (*http.Response, error) { 4247 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 4248 return autorest.SendWithSender(client, req, sd...) 4249} 4250 4251// GetApplicationManifestResponder handles the response to the GetApplicationManifest request. The method always 4252// closes the http.Response Body. 4253func (client BaseClient) GetApplicationManifestResponder(resp *http.Response) (result ApplicationTypeManifest, err error) { 4254 err = autorest.Respond( 4255 resp, 4256 client.ByInspecting(), 4257 azure.WithErrorUnlessStatusCode(http.StatusOK), 4258 autorest.ByUnmarshallingJSON(&result), 4259 autorest.ByClosing()) 4260 result.Response = autorest.Response{Response: resp} 4261 return 4262} 4263 4264// GetApplicationNameInfo gets the name of the application for the specified service. A 404 4265// FABRIC_E_SERVICE_DOES_NOT_EXIST error is returned if a service with the provided service ID does not exist. 4266// Parameters: 4267// serviceID - the identity of the service. This is typically the full name of the service without the 4268// 'fabric:' URI scheme. 4269// Starting from version 6.0, hierarchical names are delimited with the "~" character. 4270// For example, if the service name is "fabric:/myapp/app1/svc1", the service identity would be 4271// "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in previous versions. 4272// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 4273// duration that the client is willing to wait for the requested operation to complete. The default value for 4274// this parameter is 60 seconds. 4275func (client BaseClient) GetApplicationNameInfo(ctx context.Context, serviceID string, timeout *int64) (result ApplicationNameInfo, err error) { 4276 if tracing.IsEnabled() { 4277 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetApplicationNameInfo") 4278 defer func() { 4279 sc := -1 4280 if result.Response.Response != nil { 4281 sc = result.Response.Response.StatusCode 4282 } 4283 tracing.EndSpan(ctx, sc, err) 4284 }() 4285 } 4286 if err := validation.Validate([]validation.Validation{ 4287 {TargetValue: timeout, 4288 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 4289 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 4290 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 4291 }}}}}); err != nil { 4292 return result, validation.NewError("servicefabric.BaseClient", "GetApplicationNameInfo", err.Error()) 4293 } 4294 4295 req, err := client.GetApplicationNameInfoPreparer(ctx, serviceID, timeout) 4296 if err != nil { 4297 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationNameInfo", nil, "Failure preparing request") 4298 return 4299 } 4300 4301 resp, err := client.GetApplicationNameInfoSender(req) 4302 if err != nil { 4303 result.Response = autorest.Response{Response: resp} 4304 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationNameInfo", resp, "Failure sending request") 4305 return 4306 } 4307 4308 result, err = client.GetApplicationNameInfoResponder(resp) 4309 if err != nil { 4310 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationNameInfo", resp, "Failure responding to request") 4311 } 4312 4313 return 4314} 4315 4316// GetApplicationNameInfoPreparer prepares the GetApplicationNameInfo request. 4317func (client BaseClient) GetApplicationNameInfoPreparer(ctx context.Context, serviceID string, timeout *int64) (*http.Request, error) { 4318 pathParameters := map[string]interface{}{ 4319 "serviceId": serviceID, 4320 } 4321 4322 const APIVersion = "6.0" 4323 queryParameters := map[string]interface{}{ 4324 "api-version": APIVersion, 4325 } 4326 if timeout != nil { 4327 queryParameters["timeout"] = autorest.Encode("query", *timeout) 4328 } else { 4329 queryParameters["timeout"] = autorest.Encode("query", 60) 4330 } 4331 4332 preparer := autorest.CreatePreparer( 4333 autorest.AsGet(), 4334 autorest.WithBaseURL(client.BaseURI), 4335 autorest.WithPathParameters("/Services/{serviceId}/$/GetApplicationName", pathParameters), 4336 autorest.WithQueryParameters(queryParameters)) 4337 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 4338} 4339 4340// GetApplicationNameInfoSender sends the GetApplicationNameInfo request. The method will close the 4341// http.Response Body if it receives an error. 4342func (client BaseClient) GetApplicationNameInfoSender(req *http.Request) (*http.Response, error) { 4343 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 4344 return autorest.SendWithSender(client, req, sd...) 4345} 4346 4347// GetApplicationNameInfoResponder handles the response to the GetApplicationNameInfo request. The method always 4348// closes the http.Response Body. 4349func (client BaseClient) GetApplicationNameInfoResponder(resp *http.Response) (result ApplicationNameInfo, err error) { 4350 err = autorest.Respond( 4351 resp, 4352 client.ByInspecting(), 4353 azure.WithErrorUnlessStatusCode(http.StatusOK), 4354 autorest.ByUnmarshallingJSON(&result), 4355 autorest.ByClosing()) 4356 result.Response = autorest.Response{Response: resp} 4357 return 4358} 4359 4360// GetApplicationsEventList the response is list of ApplicationEvent objects. 4361// Parameters: 4362// startTimeUtc - the start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. 4363// endTimeUtc - the end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. 4364// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 4365// duration that the client is willing to wait for the requested operation to complete. The default value for 4366// this parameter is 60 seconds. 4367// eventsTypesFilter - this is a comma separated string specifying the types of FabricEvents that should only 4368// be included in the response. 4369// excludeAnalysisEvents - this param disables the retrieval of AnalysisEvents if true is passed. 4370// skipCorrelationLookup - this param disables the search of CorrelatedEvents information if true is passed. 4371// otherwise the CorrelationEvents get processed and HasCorrelatedEvents field in every FabricEvent gets 4372// populated. 4373func (client BaseClient) GetApplicationsEventList(ctx context.Context, startTimeUtc string, endTimeUtc string, timeout *int64, eventsTypesFilter string, excludeAnalysisEvents *bool, skipCorrelationLookup *bool) (result ListApplicationEvent, err error) { 4374 if tracing.IsEnabled() { 4375 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetApplicationsEventList") 4376 defer func() { 4377 sc := -1 4378 if result.Response.Response != nil { 4379 sc = result.Response.Response.StatusCode 4380 } 4381 tracing.EndSpan(ctx, sc, err) 4382 }() 4383 } 4384 if err := validation.Validate([]validation.Validation{ 4385 {TargetValue: timeout, 4386 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 4387 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 4388 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 4389 }}}}}); err != nil { 4390 return result, validation.NewError("servicefabric.BaseClient", "GetApplicationsEventList", err.Error()) 4391 } 4392 4393 req, err := client.GetApplicationsEventListPreparer(ctx, startTimeUtc, endTimeUtc, timeout, eventsTypesFilter, excludeAnalysisEvents, skipCorrelationLookup) 4394 if err != nil { 4395 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationsEventList", nil, "Failure preparing request") 4396 return 4397 } 4398 4399 resp, err := client.GetApplicationsEventListSender(req) 4400 if err != nil { 4401 result.Response = autorest.Response{Response: resp} 4402 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationsEventList", resp, "Failure sending request") 4403 return 4404 } 4405 4406 result, err = client.GetApplicationsEventListResponder(resp) 4407 if err != nil { 4408 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationsEventList", resp, "Failure responding to request") 4409 } 4410 4411 return 4412} 4413 4414// GetApplicationsEventListPreparer prepares the GetApplicationsEventList request. 4415func (client BaseClient) GetApplicationsEventListPreparer(ctx context.Context, startTimeUtc string, endTimeUtc string, timeout *int64, eventsTypesFilter string, excludeAnalysisEvents *bool, skipCorrelationLookup *bool) (*http.Request, error) { 4416 const APIVersion = "6.2-preview" 4417 queryParameters := map[string]interface{}{ 4418 "api-version": APIVersion, 4419 "EndTimeUtc": autorest.Encode("query", endTimeUtc), 4420 "StartTimeUtc": autorest.Encode("query", startTimeUtc), 4421 } 4422 if timeout != nil { 4423 queryParameters["timeout"] = autorest.Encode("query", *timeout) 4424 } else { 4425 queryParameters["timeout"] = autorest.Encode("query", 60) 4426 } 4427 if len(eventsTypesFilter) > 0 { 4428 queryParameters["EventsTypesFilter"] = autorest.Encode("query", eventsTypesFilter) 4429 } 4430 if excludeAnalysisEvents != nil { 4431 queryParameters["ExcludeAnalysisEvents"] = autorest.Encode("query", *excludeAnalysisEvents) 4432 } 4433 if skipCorrelationLookup != nil { 4434 queryParameters["SkipCorrelationLookup"] = autorest.Encode("query", *skipCorrelationLookup) 4435 } 4436 4437 preparer := autorest.CreatePreparer( 4438 autorest.AsGet(), 4439 autorest.WithBaseURL(client.BaseURI), 4440 autorest.WithPath("/EventsStore/Applications/Events"), 4441 autorest.WithQueryParameters(queryParameters)) 4442 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 4443} 4444 4445// GetApplicationsEventListSender sends the GetApplicationsEventList request. The method will close the 4446// http.Response Body if it receives an error. 4447func (client BaseClient) GetApplicationsEventListSender(req *http.Request) (*http.Response, error) { 4448 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 4449 return autorest.SendWithSender(client, req, sd...) 4450} 4451 4452// GetApplicationsEventListResponder handles the response to the GetApplicationsEventList request. The method always 4453// closes the http.Response Body. 4454func (client BaseClient) GetApplicationsEventListResponder(resp *http.Response) (result ListApplicationEvent, err error) { 4455 err = autorest.Respond( 4456 resp, 4457 client.ByInspecting(), 4458 azure.WithErrorUnlessStatusCode(http.StatusOK), 4459 autorest.ByUnmarshallingJSON(&result), 4460 autorest.ByClosing()) 4461 result.Response = autorest.Response{Response: resp} 4462 return 4463} 4464 4465// GetApplicationTypeInfoList returns the information about the application types that are provisioned or in the 4466// process of being provisioned in the Service Fabric cluster. Each version of an application type is returned as one 4467// application type. The response includes the name, version, status and other details about the application type. This 4468// is a paged query, meaning that if not all of the application types fit in a page, one page of results is returned as 4469// well as a continuation token which can be used to get the next page. For example, if there are 10 application types 4470// but a page only fits the first 3 application types, or if max results is set to 3, then 3 is returned. To access the 4471// rest of the results, retrieve subsequent pages by using the returned continuation token in the next query. An empty 4472// continuation token is returned if there are no subsequent pages. 4473// Parameters: 4474// applicationTypeDefinitionKindFilter - used to filter on ApplicationTypeDefinitionKind which is the mechanism 4475// used to define a Service Fabric application type. 4476// - Default - Default value, which performs the same function as selecting "All". The value is 0. 4477// - All - Filter that matches input with any ApplicationTypeDefinitionKind value. The value is 65535. 4478// - ServiceFabricApplicationPackage - Filter that matches input with ApplicationTypeDefinitionKind value 4479// ServiceFabricApplicationPackage. The value is 1. 4480// - Compose - Filter that matches input with ApplicationTypeDefinitionKind value Compose. The value is 2. 4481// excludeApplicationParameters - the flag that specifies whether application parameters will be excluded from 4482// the result. 4483// continuationToken - the continuation token parameter is used to obtain next set of results. A continuation 4484// token with a non empty value is included in the response of the API when the results from the system do not 4485// fit in a single response. When this value is passed to the next API call, the API returns next set of 4486// results. If there are no further results then the continuation token does not contain a value. The value of 4487// this parameter should not be URL encoded. 4488// maxResults - the maximum number of results to be returned as part of the paged queries. This parameter 4489// defines the upper bound on the number of results returned. The results returned can be less than the 4490// specified maximum results if they do not fit in the message as per the max message size restrictions defined 4491// in the configuration. If this parameter is zero or not specified, the paged queries includes as many results 4492// as possible that fit in the return message. 4493// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 4494// duration that the client is willing to wait for the requested operation to complete. The default value for 4495// this parameter is 60 seconds. 4496func (client BaseClient) GetApplicationTypeInfoList(ctx context.Context, applicationTypeDefinitionKindFilter *int32, excludeApplicationParameters *bool, continuationToken string, maxResults *int64, timeout *int64) (result PagedApplicationTypeInfoList, err error) { 4497 if tracing.IsEnabled() { 4498 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetApplicationTypeInfoList") 4499 defer func() { 4500 sc := -1 4501 if result.Response.Response != nil { 4502 sc = result.Response.Response.StatusCode 4503 } 4504 tracing.EndSpan(ctx, sc, err) 4505 }() 4506 } 4507 if err := validation.Validate([]validation.Validation{ 4508 {TargetValue: maxResults, 4509 Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false, 4510 Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}, 4511 {TargetValue: timeout, 4512 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 4513 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 4514 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 4515 }}}}}); err != nil { 4516 return result, validation.NewError("servicefabric.BaseClient", "GetApplicationTypeInfoList", err.Error()) 4517 } 4518 4519 req, err := client.GetApplicationTypeInfoListPreparer(ctx, applicationTypeDefinitionKindFilter, excludeApplicationParameters, continuationToken, maxResults, timeout) 4520 if err != nil { 4521 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationTypeInfoList", nil, "Failure preparing request") 4522 return 4523 } 4524 4525 resp, err := client.GetApplicationTypeInfoListSender(req) 4526 if err != nil { 4527 result.Response = autorest.Response{Response: resp} 4528 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationTypeInfoList", resp, "Failure sending request") 4529 return 4530 } 4531 4532 result, err = client.GetApplicationTypeInfoListResponder(resp) 4533 if err != nil { 4534 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationTypeInfoList", resp, "Failure responding to request") 4535 } 4536 4537 return 4538} 4539 4540// GetApplicationTypeInfoListPreparer prepares the GetApplicationTypeInfoList request. 4541func (client BaseClient) GetApplicationTypeInfoListPreparer(ctx context.Context, applicationTypeDefinitionKindFilter *int32, excludeApplicationParameters *bool, continuationToken string, maxResults *int64, timeout *int64) (*http.Request, error) { 4542 const APIVersion = "6.0" 4543 queryParameters := map[string]interface{}{ 4544 "api-version": APIVersion, 4545 } 4546 if applicationTypeDefinitionKindFilter != nil { 4547 queryParameters["ApplicationTypeDefinitionKindFilter"] = autorest.Encode("query", *applicationTypeDefinitionKindFilter) 4548 } else { 4549 queryParameters["ApplicationTypeDefinitionKindFilter"] = autorest.Encode("query", 0) 4550 } 4551 if excludeApplicationParameters != nil { 4552 queryParameters["ExcludeApplicationParameters"] = autorest.Encode("query", *excludeApplicationParameters) 4553 } else { 4554 queryParameters["ExcludeApplicationParameters"] = autorest.Encode("query", false) 4555 } 4556 if len(continuationToken) > 0 { 4557 queryParameters["ContinuationToken"] = continuationToken 4558 } 4559 if maxResults != nil { 4560 queryParameters["MaxResults"] = autorest.Encode("query", *maxResults) 4561 } else { 4562 queryParameters["MaxResults"] = autorest.Encode("query", 0) 4563 } 4564 if timeout != nil { 4565 queryParameters["timeout"] = autorest.Encode("query", *timeout) 4566 } else { 4567 queryParameters["timeout"] = autorest.Encode("query", 60) 4568 } 4569 4570 preparer := autorest.CreatePreparer( 4571 autorest.AsGet(), 4572 autorest.WithBaseURL(client.BaseURI), 4573 autorest.WithPath("/ApplicationTypes"), 4574 autorest.WithQueryParameters(queryParameters)) 4575 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 4576} 4577 4578// GetApplicationTypeInfoListSender sends the GetApplicationTypeInfoList request. The method will close the 4579// http.Response Body if it receives an error. 4580func (client BaseClient) GetApplicationTypeInfoListSender(req *http.Request) (*http.Response, error) { 4581 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 4582 return autorest.SendWithSender(client, req, sd...) 4583} 4584 4585// GetApplicationTypeInfoListResponder handles the response to the GetApplicationTypeInfoList request. The method always 4586// closes the http.Response Body. 4587func (client BaseClient) GetApplicationTypeInfoListResponder(resp *http.Response) (result PagedApplicationTypeInfoList, err error) { 4588 err = autorest.Respond( 4589 resp, 4590 client.ByInspecting(), 4591 azure.WithErrorUnlessStatusCode(http.StatusOK), 4592 autorest.ByUnmarshallingJSON(&result), 4593 autorest.ByClosing()) 4594 result.Response = autorest.Response{Response: resp} 4595 return 4596} 4597 4598// GetApplicationTypeInfoListByName returns the information about the application types that are provisioned or in the 4599// process of being provisioned in the Service Fabric cluster. These results are of application types whose name match 4600// exactly the one specified as the parameter, and which comply with the given query parameters. All versions of the 4601// application type matching the application type name are returned, with each version returned as one application 4602// type. The response includes the name, version, status and other details about the application type. This is a paged 4603// query, meaning that if not all of the application types fit in a page, one page of results is returned as well as a 4604// continuation token which can be used to get the next page. For example, if there are 10 application types but a page 4605// only fits the first 3 application types, or if max results is set to 3, then 3 is returned. To access the rest of 4606// the results, retrieve subsequent pages by using the returned continuation token in the next query. An empty 4607// continuation token is returned if there are no subsequent pages. 4608// Parameters: 4609// applicationTypeName - the name of the application type. 4610// applicationTypeVersion - the version of the application type. 4611// excludeApplicationParameters - the flag that specifies whether application parameters will be excluded from 4612// the result. 4613// continuationToken - the continuation token parameter is used to obtain next set of results. A continuation 4614// token with a non empty value is included in the response of the API when the results from the system do not 4615// fit in a single response. When this value is passed to the next API call, the API returns next set of 4616// results. If there are no further results then the continuation token does not contain a value. The value of 4617// this parameter should not be URL encoded. 4618// maxResults - the maximum number of results to be returned as part of the paged queries. This parameter 4619// defines the upper bound on the number of results returned. The results returned can be less than the 4620// specified maximum results if they do not fit in the message as per the max message size restrictions defined 4621// in the configuration. If this parameter is zero or not specified, the paged queries includes as many results 4622// as possible that fit in the return message. 4623// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 4624// duration that the client is willing to wait for the requested operation to complete. The default value for 4625// this parameter is 60 seconds. 4626func (client BaseClient) GetApplicationTypeInfoListByName(ctx context.Context, applicationTypeName string, applicationTypeVersion string, excludeApplicationParameters *bool, continuationToken string, maxResults *int64, timeout *int64) (result PagedApplicationTypeInfoList, err error) { 4627 if tracing.IsEnabled() { 4628 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetApplicationTypeInfoListByName") 4629 defer func() { 4630 sc := -1 4631 if result.Response.Response != nil { 4632 sc = result.Response.Response.StatusCode 4633 } 4634 tracing.EndSpan(ctx, sc, err) 4635 }() 4636 } 4637 if err := validation.Validate([]validation.Validation{ 4638 {TargetValue: maxResults, 4639 Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false, 4640 Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}, 4641 {TargetValue: timeout, 4642 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 4643 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 4644 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 4645 }}}}}); err != nil { 4646 return result, validation.NewError("servicefabric.BaseClient", "GetApplicationTypeInfoListByName", err.Error()) 4647 } 4648 4649 req, err := client.GetApplicationTypeInfoListByNamePreparer(ctx, applicationTypeName, applicationTypeVersion, excludeApplicationParameters, continuationToken, maxResults, timeout) 4650 if err != nil { 4651 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationTypeInfoListByName", nil, "Failure preparing request") 4652 return 4653 } 4654 4655 resp, err := client.GetApplicationTypeInfoListByNameSender(req) 4656 if err != nil { 4657 result.Response = autorest.Response{Response: resp} 4658 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationTypeInfoListByName", resp, "Failure sending request") 4659 return 4660 } 4661 4662 result, err = client.GetApplicationTypeInfoListByNameResponder(resp) 4663 if err != nil { 4664 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationTypeInfoListByName", resp, "Failure responding to request") 4665 } 4666 4667 return 4668} 4669 4670// GetApplicationTypeInfoListByNamePreparer prepares the GetApplicationTypeInfoListByName request. 4671func (client BaseClient) GetApplicationTypeInfoListByNamePreparer(ctx context.Context, applicationTypeName string, applicationTypeVersion string, excludeApplicationParameters *bool, continuationToken string, maxResults *int64, timeout *int64) (*http.Request, error) { 4672 pathParameters := map[string]interface{}{ 4673 "applicationTypeName": autorest.Encode("path", applicationTypeName), 4674 } 4675 4676 const APIVersion = "6.0" 4677 queryParameters := map[string]interface{}{ 4678 "api-version": APIVersion, 4679 } 4680 if len(applicationTypeVersion) > 0 { 4681 queryParameters["ApplicationTypeVersion"] = autorest.Encode("query", applicationTypeVersion) 4682 } 4683 if excludeApplicationParameters != nil { 4684 queryParameters["ExcludeApplicationParameters"] = autorest.Encode("query", *excludeApplicationParameters) 4685 } else { 4686 queryParameters["ExcludeApplicationParameters"] = autorest.Encode("query", false) 4687 } 4688 if len(continuationToken) > 0 { 4689 queryParameters["ContinuationToken"] = continuationToken 4690 } 4691 if maxResults != nil { 4692 queryParameters["MaxResults"] = autorest.Encode("query", *maxResults) 4693 } else { 4694 queryParameters["MaxResults"] = autorest.Encode("query", 0) 4695 } 4696 if timeout != nil { 4697 queryParameters["timeout"] = autorest.Encode("query", *timeout) 4698 } else { 4699 queryParameters["timeout"] = autorest.Encode("query", 60) 4700 } 4701 4702 preparer := autorest.CreatePreparer( 4703 autorest.AsGet(), 4704 autorest.WithBaseURL(client.BaseURI), 4705 autorest.WithPathParameters("/ApplicationTypes/{applicationTypeName}", pathParameters), 4706 autorest.WithQueryParameters(queryParameters)) 4707 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 4708} 4709 4710// GetApplicationTypeInfoListByNameSender sends the GetApplicationTypeInfoListByName request. The method will close the 4711// http.Response Body if it receives an error. 4712func (client BaseClient) GetApplicationTypeInfoListByNameSender(req *http.Request) (*http.Response, error) { 4713 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 4714 return autorest.SendWithSender(client, req, sd...) 4715} 4716 4717// GetApplicationTypeInfoListByNameResponder handles the response to the GetApplicationTypeInfoListByName request. The method always 4718// closes the http.Response Body. 4719func (client BaseClient) GetApplicationTypeInfoListByNameResponder(resp *http.Response) (result PagedApplicationTypeInfoList, err error) { 4720 err = autorest.Respond( 4721 resp, 4722 client.ByInspecting(), 4723 azure.WithErrorUnlessStatusCode(http.StatusOK), 4724 autorest.ByUnmarshallingJSON(&result), 4725 autorest.ByClosing()) 4726 result.Response = autorest.Response{Response: resp} 4727 return 4728} 4729 4730// GetApplicationUpgrade returns information about the state of the latest application upgrade along with details to 4731// aid debugging application health issues. 4732// Parameters: 4733// applicationID - the identity of the application. This is typically the full name of the application without 4734// the 'fabric:' URI scheme. 4735// Starting from version 6.0, hierarchical names are delimited with the "~" character. 4736// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" 4737// in 6.0+ and "myapp/app1" in previous versions. 4738// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 4739// duration that the client is willing to wait for the requested operation to complete. The default value for 4740// this parameter is 60 seconds. 4741func (client BaseClient) GetApplicationUpgrade(ctx context.Context, applicationID string, timeout *int64) (result ApplicationUpgradeProgressInfo, err error) { 4742 if tracing.IsEnabled() { 4743 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetApplicationUpgrade") 4744 defer func() { 4745 sc := -1 4746 if result.Response.Response != nil { 4747 sc = result.Response.Response.StatusCode 4748 } 4749 tracing.EndSpan(ctx, sc, err) 4750 }() 4751 } 4752 if err := validation.Validate([]validation.Validation{ 4753 {TargetValue: timeout, 4754 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 4755 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 4756 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 4757 }}}}}); err != nil { 4758 return result, validation.NewError("servicefabric.BaseClient", "GetApplicationUpgrade", err.Error()) 4759 } 4760 4761 req, err := client.GetApplicationUpgradePreparer(ctx, applicationID, timeout) 4762 if err != nil { 4763 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationUpgrade", nil, "Failure preparing request") 4764 return 4765 } 4766 4767 resp, err := client.GetApplicationUpgradeSender(req) 4768 if err != nil { 4769 result.Response = autorest.Response{Response: resp} 4770 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationUpgrade", resp, "Failure sending request") 4771 return 4772 } 4773 4774 result, err = client.GetApplicationUpgradeResponder(resp) 4775 if err != nil { 4776 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationUpgrade", resp, "Failure responding to request") 4777 } 4778 4779 return 4780} 4781 4782// GetApplicationUpgradePreparer prepares the GetApplicationUpgrade request. 4783func (client BaseClient) GetApplicationUpgradePreparer(ctx context.Context, applicationID string, timeout *int64) (*http.Request, error) { 4784 pathParameters := map[string]interface{}{ 4785 "applicationId": applicationID, 4786 } 4787 4788 const APIVersion = "6.0" 4789 queryParameters := map[string]interface{}{ 4790 "api-version": APIVersion, 4791 } 4792 if timeout != nil { 4793 queryParameters["timeout"] = autorest.Encode("query", *timeout) 4794 } else { 4795 queryParameters["timeout"] = autorest.Encode("query", 60) 4796 } 4797 4798 preparer := autorest.CreatePreparer( 4799 autorest.AsGet(), 4800 autorest.WithBaseURL(client.BaseURI), 4801 autorest.WithPathParameters("/Applications/{applicationId}/$/GetUpgradeProgress", pathParameters), 4802 autorest.WithQueryParameters(queryParameters)) 4803 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 4804} 4805 4806// GetApplicationUpgradeSender sends the GetApplicationUpgrade request. The method will close the 4807// http.Response Body if it receives an error. 4808func (client BaseClient) GetApplicationUpgradeSender(req *http.Request) (*http.Response, error) { 4809 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 4810 return autorest.SendWithSender(client, req, sd...) 4811} 4812 4813// GetApplicationUpgradeResponder handles the response to the GetApplicationUpgrade request. The method always 4814// closes the http.Response Body. 4815func (client BaseClient) GetApplicationUpgradeResponder(resp *http.Response) (result ApplicationUpgradeProgressInfo, err error) { 4816 err = autorest.Respond( 4817 resp, 4818 client.ByInspecting(), 4819 azure.WithErrorUnlessStatusCode(http.StatusOK), 4820 autorest.ByUnmarshallingJSON(&result), 4821 autorest.ByClosing()) 4822 result.Response = autorest.Response{Response: resp} 4823 return 4824} 4825 4826// GetBackupPolicyByName gets a particular backup policy identified by {backupPolicyName} 4827// Parameters: 4828// backupPolicyName - the name of the backup policy. 4829// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 4830// duration that the client is willing to wait for the requested operation to complete. The default value for 4831// this parameter is 60 seconds. 4832func (client BaseClient) GetBackupPolicyByName(ctx context.Context, backupPolicyName string, timeout *int64) (result BackupPolicyDescription, err error) { 4833 if tracing.IsEnabled() { 4834 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetBackupPolicyByName") 4835 defer func() { 4836 sc := -1 4837 if result.Response.Response != nil { 4838 sc = result.Response.Response.StatusCode 4839 } 4840 tracing.EndSpan(ctx, sc, err) 4841 }() 4842 } 4843 if err := validation.Validate([]validation.Validation{ 4844 {TargetValue: timeout, 4845 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 4846 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 4847 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 4848 }}}}}); err != nil { 4849 return result, validation.NewError("servicefabric.BaseClient", "GetBackupPolicyByName", err.Error()) 4850 } 4851 4852 req, err := client.GetBackupPolicyByNamePreparer(ctx, backupPolicyName, timeout) 4853 if err != nil { 4854 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetBackupPolicyByName", nil, "Failure preparing request") 4855 return 4856 } 4857 4858 resp, err := client.GetBackupPolicyByNameSender(req) 4859 if err != nil { 4860 result.Response = autorest.Response{Response: resp} 4861 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetBackupPolicyByName", resp, "Failure sending request") 4862 return 4863 } 4864 4865 result, err = client.GetBackupPolicyByNameResponder(resp) 4866 if err != nil { 4867 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetBackupPolicyByName", resp, "Failure responding to request") 4868 } 4869 4870 return 4871} 4872 4873// GetBackupPolicyByNamePreparer prepares the GetBackupPolicyByName request. 4874func (client BaseClient) GetBackupPolicyByNamePreparer(ctx context.Context, backupPolicyName string, timeout *int64) (*http.Request, error) { 4875 pathParameters := map[string]interface{}{ 4876 "backupPolicyName": autorest.Encode("path", backupPolicyName), 4877 } 4878 4879 const APIVersion = "6.2-preview" 4880 queryParameters := map[string]interface{}{ 4881 "api-version": APIVersion, 4882 } 4883 if timeout != nil { 4884 queryParameters["timeout"] = autorest.Encode("query", *timeout) 4885 } else { 4886 queryParameters["timeout"] = autorest.Encode("query", 60) 4887 } 4888 4889 preparer := autorest.CreatePreparer( 4890 autorest.AsGet(), 4891 autorest.WithBaseURL(client.BaseURI), 4892 autorest.WithPathParameters("/BackupRestore/BackupPolicies/{backupPolicyName}", pathParameters), 4893 autorest.WithQueryParameters(queryParameters)) 4894 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 4895} 4896 4897// GetBackupPolicyByNameSender sends the GetBackupPolicyByName request. The method will close the 4898// http.Response Body if it receives an error. 4899func (client BaseClient) GetBackupPolicyByNameSender(req *http.Request) (*http.Response, error) { 4900 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 4901 return autorest.SendWithSender(client, req, sd...) 4902} 4903 4904// GetBackupPolicyByNameResponder handles the response to the GetBackupPolicyByName request. The method always 4905// closes the http.Response Body. 4906func (client BaseClient) GetBackupPolicyByNameResponder(resp *http.Response) (result BackupPolicyDescription, err error) { 4907 err = autorest.Respond( 4908 resp, 4909 client.ByInspecting(), 4910 azure.WithErrorUnlessStatusCode(http.StatusOK), 4911 autorest.ByUnmarshallingJSON(&result), 4912 autorest.ByClosing()) 4913 result.Response = autorest.Response{Response: resp} 4914 return 4915} 4916 4917// GetBackupPolicyList get a list of all the backup policies configured. 4918// Parameters: 4919// continuationToken - the continuation token parameter is used to obtain next set of results. A continuation 4920// token with a non empty value is included in the response of the API when the results from the system do not 4921// fit in a single response. When this value is passed to the next API call, the API returns next set of 4922// results. If there are no further results then the continuation token does not contain a value. The value of 4923// this parameter should not be URL encoded. 4924// maxResults - the maximum number of results to be returned as part of the paged queries. This parameter 4925// defines the upper bound on the number of results returned. The results returned can be less than the 4926// specified maximum results if they do not fit in the message as per the max message size restrictions defined 4927// in the configuration. If this parameter is zero or not specified, the paged queries includes as many results 4928// as possible that fit in the return message. 4929// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 4930// duration that the client is willing to wait for the requested operation to complete. The default value for 4931// this parameter is 60 seconds. 4932func (client BaseClient) GetBackupPolicyList(ctx context.Context, continuationToken string, maxResults *int64, timeout *int64) (result PagedBackupPolicyDescriptionList, err error) { 4933 if tracing.IsEnabled() { 4934 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetBackupPolicyList") 4935 defer func() { 4936 sc := -1 4937 if result.Response.Response != nil { 4938 sc = result.Response.Response.StatusCode 4939 } 4940 tracing.EndSpan(ctx, sc, err) 4941 }() 4942 } 4943 if err := validation.Validate([]validation.Validation{ 4944 {TargetValue: maxResults, 4945 Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false, 4946 Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}, 4947 {TargetValue: timeout, 4948 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 4949 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 4950 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 4951 }}}}}); err != nil { 4952 return result, validation.NewError("servicefabric.BaseClient", "GetBackupPolicyList", err.Error()) 4953 } 4954 4955 req, err := client.GetBackupPolicyListPreparer(ctx, continuationToken, maxResults, timeout) 4956 if err != nil { 4957 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetBackupPolicyList", nil, "Failure preparing request") 4958 return 4959 } 4960 4961 resp, err := client.GetBackupPolicyListSender(req) 4962 if err != nil { 4963 result.Response = autorest.Response{Response: resp} 4964 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetBackupPolicyList", resp, "Failure sending request") 4965 return 4966 } 4967 4968 result, err = client.GetBackupPolicyListResponder(resp) 4969 if err != nil { 4970 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetBackupPolicyList", resp, "Failure responding to request") 4971 } 4972 4973 return 4974} 4975 4976// GetBackupPolicyListPreparer prepares the GetBackupPolicyList request. 4977func (client BaseClient) GetBackupPolicyListPreparer(ctx context.Context, continuationToken string, maxResults *int64, timeout *int64) (*http.Request, error) { 4978 const APIVersion = "6.2-preview" 4979 queryParameters := map[string]interface{}{ 4980 "api-version": APIVersion, 4981 } 4982 if len(continuationToken) > 0 { 4983 queryParameters["ContinuationToken"] = continuationToken 4984 } 4985 if maxResults != nil { 4986 queryParameters["MaxResults"] = autorest.Encode("query", *maxResults) 4987 } else { 4988 queryParameters["MaxResults"] = autorest.Encode("query", 0) 4989 } 4990 if timeout != nil { 4991 queryParameters["timeout"] = autorest.Encode("query", *timeout) 4992 } else { 4993 queryParameters["timeout"] = autorest.Encode("query", 60) 4994 } 4995 4996 preparer := autorest.CreatePreparer( 4997 autorest.AsGet(), 4998 autorest.WithBaseURL(client.BaseURI), 4999 autorest.WithPath("/BackupRestore/BackupPolicies"), 5000 autorest.WithQueryParameters(queryParameters)) 5001 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 5002} 5003 5004// GetBackupPolicyListSender sends the GetBackupPolicyList request. The method will close the 5005// http.Response Body if it receives an error. 5006func (client BaseClient) GetBackupPolicyListSender(req *http.Request) (*http.Response, error) { 5007 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 5008 return autorest.SendWithSender(client, req, sd...) 5009} 5010 5011// GetBackupPolicyListResponder handles the response to the GetBackupPolicyList request. The method always 5012// closes the http.Response Body. 5013func (client BaseClient) GetBackupPolicyListResponder(resp *http.Response) (result PagedBackupPolicyDescriptionList, err error) { 5014 err = autorest.Respond( 5015 resp, 5016 client.ByInspecting(), 5017 azure.WithErrorUnlessStatusCode(http.StatusOK), 5018 autorest.ByUnmarshallingJSON(&result), 5019 autorest.ByClosing()) 5020 result.Response = autorest.Response{Response: resp} 5021 return 5022} 5023 5024// GetBackupsFromBackupLocation gets the list of backups available for the specified backed up entity (Application, 5025// Service or Partition) at the specified backup location (FileShare or Azure Blob Storage). 5026// Parameters: 5027// getBackupByStorageQueryDescription - describes the filters and backup storage details to be used for 5028// enumerating backups. 5029// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 5030// duration that the client is willing to wait for the requested operation to complete. The default value for 5031// this parameter is 60 seconds. 5032// continuationToken - the continuation token parameter is used to obtain next set of results. A continuation 5033// token with a non empty value is included in the response of the API when the results from the system do not 5034// fit in a single response. When this value is passed to the next API call, the API returns next set of 5035// results. If there are no further results then the continuation token does not contain a value. The value of 5036// this parameter should not be URL encoded. 5037// maxResults - the maximum number of results to be returned as part of the paged queries. This parameter 5038// defines the upper bound on the number of results returned. The results returned can be less than the 5039// specified maximum results if they do not fit in the message as per the max message size restrictions defined 5040// in the configuration. If this parameter is zero or not specified, the paged queries includes as many results 5041// as possible that fit in the return message. 5042func (client BaseClient) GetBackupsFromBackupLocation(ctx context.Context, getBackupByStorageQueryDescription GetBackupByStorageQueryDescription, timeout *int64, continuationToken string, maxResults *int64) (result PagedBackupInfoList, err error) { 5043 if tracing.IsEnabled() { 5044 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetBackupsFromBackupLocation") 5045 defer func() { 5046 sc := -1 5047 if result.Response.Response != nil { 5048 sc = result.Response.Response.StatusCode 5049 } 5050 tracing.EndSpan(ctx, sc, err) 5051 }() 5052 } 5053 if err := validation.Validate([]validation.Validation{ 5054 {TargetValue: timeout, 5055 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 5056 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 5057 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 5058 }}}}, 5059 {TargetValue: maxResults, 5060 Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false, 5061 Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}, 5062 {TargetValue: getBackupByStorageQueryDescription, 5063 Constraints: []validation.Constraint{{Target: "getBackupByStorageQueryDescription.Storage", Name: validation.Null, Rule: true, Chain: nil}, 5064 {Target: "getBackupByStorageQueryDescription.BackupEntity", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { 5065 return result, validation.NewError("servicefabric.BaseClient", "GetBackupsFromBackupLocation", err.Error()) 5066 } 5067 5068 req, err := client.GetBackupsFromBackupLocationPreparer(ctx, getBackupByStorageQueryDescription, timeout, continuationToken, maxResults) 5069 if err != nil { 5070 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetBackupsFromBackupLocation", nil, "Failure preparing request") 5071 return 5072 } 5073 5074 resp, err := client.GetBackupsFromBackupLocationSender(req) 5075 if err != nil { 5076 result.Response = autorest.Response{Response: resp} 5077 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetBackupsFromBackupLocation", resp, "Failure sending request") 5078 return 5079 } 5080 5081 result, err = client.GetBackupsFromBackupLocationResponder(resp) 5082 if err != nil { 5083 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetBackupsFromBackupLocation", resp, "Failure responding to request") 5084 } 5085 5086 return 5087} 5088 5089// GetBackupsFromBackupLocationPreparer prepares the GetBackupsFromBackupLocation request. 5090func (client BaseClient) GetBackupsFromBackupLocationPreparer(ctx context.Context, getBackupByStorageQueryDescription GetBackupByStorageQueryDescription, timeout *int64, continuationToken string, maxResults *int64) (*http.Request, error) { 5091 const APIVersion = "6.2-preview" 5092 queryParameters := map[string]interface{}{ 5093 "api-version": APIVersion, 5094 } 5095 if timeout != nil { 5096 queryParameters["timeout"] = autorest.Encode("query", *timeout) 5097 } else { 5098 queryParameters["timeout"] = autorest.Encode("query", 60) 5099 } 5100 if len(continuationToken) > 0 { 5101 queryParameters["ContinuationToken"] = continuationToken 5102 } 5103 if maxResults != nil { 5104 queryParameters["MaxResults"] = autorest.Encode("query", *maxResults) 5105 } else { 5106 queryParameters["MaxResults"] = autorest.Encode("query", 0) 5107 } 5108 5109 preparer := autorest.CreatePreparer( 5110 autorest.AsContentType("application/json; charset=utf-8"), 5111 autorest.AsPost(), 5112 autorest.WithBaseURL(client.BaseURI), 5113 autorest.WithPath("/BackupRestore/$/GetBackups"), 5114 autorest.WithJSON(getBackupByStorageQueryDescription), 5115 autorest.WithQueryParameters(queryParameters)) 5116 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 5117} 5118 5119// GetBackupsFromBackupLocationSender sends the GetBackupsFromBackupLocation request. The method will close the 5120// http.Response Body if it receives an error. 5121func (client BaseClient) GetBackupsFromBackupLocationSender(req *http.Request) (*http.Response, error) { 5122 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 5123 return autorest.SendWithSender(client, req, sd...) 5124} 5125 5126// GetBackupsFromBackupLocationResponder handles the response to the GetBackupsFromBackupLocation request. The method always 5127// closes the http.Response Body. 5128func (client BaseClient) GetBackupsFromBackupLocationResponder(resp *http.Response) (result PagedBackupInfoList, err error) { 5129 err = autorest.Respond( 5130 resp, 5131 client.ByInspecting(), 5132 azure.WithErrorUnlessStatusCode(http.StatusOK), 5133 autorest.ByUnmarshallingJSON(&result), 5134 autorest.ByClosing()) 5135 result.Response = autorest.Response{Response: resp} 5136 return 5137} 5138 5139// GetChaos get the status of Chaos indicating whether or not Chaos is running, the Chaos parameters used for running 5140// Chaos and the status of the Chaos Schedule. 5141// Parameters: 5142// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 5143// duration that the client is willing to wait for the requested operation to complete. The default value for 5144// this parameter is 60 seconds. 5145func (client BaseClient) GetChaos(ctx context.Context, timeout *int64) (result Chaos, err error) { 5146 if tracing.IsEnabled() { 5147 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetChaos") 5148 defer func() { 5149 sc := -1 5150 if result.Response.Response != nil { 5151 sc = result.Response.Response.StatusCode 5152 } 5153 tracing.EndSpan(ctx, sc, err) 5154 }() 5155 } 5156 if err := validation.Validate([]validation.Validation{ 5157 {TargetValue: timeout, 5158 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 5159 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 5160 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 5161 }}}}}); err != nil { 5162 return result, validation.NewError("servicefabric.BaseClient", "GetChaos", err.Error()) 5163 } 5164 5165 req, err := client.GetChaosPreparer(ctx, timeout) 5166 if err != nil { 5167 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetChaos", nil, "Failure preparing request") 5168 return 5169 } 5170 5171 resp, err := client.GetChaosSender(req) 5172 if err != nil { 5173 result.Response = autorest.Response{Response: resp} 5174 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetChaos", resp, "Failure sending request") 5175 return 5176 } 5177 5178 result, err = client.GetChaosResponder(resp) 5179 if err != nil { 5180 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetChaos", resp, "Failure responding to request") 5181 } 5182 5183 return 5184} 5185 5186// GetChaosPreparer prepares the GetChaos request. 5187func (client BaseClient) GetChaosPreparer(ctx context.Context, timeout *int64) (*http.Request, error) { 5188 const APIVersion = "6.2" 5189 queryParameters := map[string]interface{}{ 5190 "api-version": APIVersion, 5191 } 5192 if timeout != nil { 5193 queryParameters["timeout"] = autorest.Encode("query", *timeout) 5194 } else { 5195 queryParameters["timeout"] = autorest.Encode("query", 60) 5196 } 5197 5198 preparer := autorest.CreatePreparer( 5199 autorest.AsGet(), 5200 autorest.WithBaseURL(client.BaseURI), 5201 autorest.WithPath("/Tools/Chaos"), 5202 autorest.WithQueryParameters(queryParameters)) 5203 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 5204} 5205 5206// GetChaosSender sends the GetChaos request. The method will close the 5207// http.Response Body if it receives an error. 5208func (client BaseClient) GetChaosSender(req *http.Request) (*http.Response, error) { 5209 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 5210 return autorest.SendWithSender(client, req, sd...) 5211} 5212 5213// GetChaosResponder handles the response to the GetChaos request. The method always 5214// closes the http.Response Body. 5215func (client BaseClient) GetChaosResponder(resp *http.Response) (result Chaos, err error) { 5216 err = autorest.Respond( 5217 resp, 5218 client.ByInspecting(), 5219 azure.WithErrorUnlessStatusCode(http.StatusOK), 5220 autorest.ByUnmarshallingJSON(&result), 5221 autorest.ByClosing()) 5222 result.Response = autorest.Response{Response: resp} 5223 return 5224} 5225 5226// GetChaosEvents to get the next segment of the Chaos events, you can specify the ContinuationToken. To get the start 5227// of a new segment of Chaos events, you can specify the time range 5228// through StartTimeUtc and EndTimeUtc. You cannot specify both the ContinuationToken and the time range in the same 5229// call. 5230// When there are more than 100 Chaos events, the Chaos events are returned in multiple segments where a segment 5231// contains no more than 100 Chaos events and to get the next segment you make a call to this API with the continuation 5232// token. 5233// Parameters: 5234// continuationToken - the continuation token parameter is used to obtain next set of results. A continuation 5235// token with a non empty value is included in the response of the API when the results from the system do not 5236// fit in a single response. When this value is passed to the next API call, the API returns next set of 5237// results. If there are no further results then the continuation token does not contain a value. The value of 5238// this parameter should not be URL encoded. 5239// startTimeUtc - the Windows file time representing the start time of the time range for which a Chaos report 5240// is to be generated. Please consult [DateTime.ToFileTimeUtc 5241// Method](https://msdn.microsoft.com/en-us/library/system.datetime.tofiletimeutc(v=vs.110).aspx) for details. 5242// endTimeUtc - the Windows file time representing the end time of the time range for which a Chaos report is 5243// to be generated. Please consult [DateTime.ToFileTimeUtc 5244// Method](https://msdn.microsoft.com/en-us/library/system.datetime.tofiletimeutc(v=vs.110).aspx) for details. 5245// maxResults - the maximum number of results to be returned as part of the paged queries. This parameter 5246// defines the upper bound on the number of results returned. The results returned can be less than the 5247// specified maximum results if they do not fit in the message as per the max message size restrictions defined 5248// in the configuration. If this parameter is zero or not specified, the paged queries includes as many results 5249// as possible that fit in the return message. 5250// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 5251// duration that the client is willing to wait for the requested operation to complete. The default value for 5252// this parameter is 60 seconds. 5253func (client BaseClient) GetChaosEvents(ctx context.Context, continuationToken string, startTimeUtc string, endTimeUtc string, maxResults *int64, timeout *int64) (result ChaosEventsSegment, err error) { 5254 if tracing.IsEnabled() { 5255 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetChaosEvents") 5256 defer func() { 5257 sc := -1 5258 if result.Response.Response != nil { 5259 sc = result.Response.Response.StatusCode 5260 } 5261 tracing.EndSpan(ctx, sc, err) 5262 }() 5263 } 5264 if err := validation.Validate([]validation.Validation{ 5265 {TargetValue: maxResults, 5266 Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false, 5267 Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}, 5268 {TargetValue: timeout, 5269 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 5270 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 5271 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 5272 }}}}}); err != nil { 5273 return result, validation.NewError("servicefabric.BaseClient", "GetChaosEvents", err.Error()) 5274 } 5275 5276 req, err := client.GetChaosEventsPreparer(ctx, continuationToken, startTimeUtc, endTimeUtc, maxResults, timeout) 5277 if err != nil { 5278 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetChaosEvents", nil, "Failure preparing request") 5279 return 5280 } 5281 5282 resp, err := client.GetChaosEventsSender(req) 5283 if err != nil { 5284 result.Response = autorest.Response{Response: resp} 5285 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetChaosEvents", resp, "Failure sending request") 5286 return 5287 } 5288 5289 result, err = client.GetChaosEventsResponder(resp) 5290 if err != nil { 5291 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetChaosEvents", resp, "Failure responding to request") 5292 } 5293 5294 return 5295} 5296 5297// GetChaosEventsPreparer prepares the GetChaosEvents request. 5298func (client BaseClient) GetChaosEventsPreparer(ctx context.Context, continuationToken string, startTimeUtc string, endTimeUtc string, maxResults *int64, timeout *int64) (*http.Request, error) { 5299 const APIVersion = "6.2" 5300 queryParameters := map[string]interface{}{ 5301 "api-version": APIVersion, 5302 } 5303 if len(continuationToken) > 0 { 5304 queryParameters["ContinuationToken"] = continuationToken 5305 } 5306 if len(startTimeUtc) > 0 { 5307 queryParameters["StartTimeUtc"] = autorest.Encode("query", startTimeUtc) 5308 } 5309 if len(endTimeUtc) > 0 { 5310 queryParameters["EndTimeUtc"] = autorest.Encode("query", endTimeUtc) 5311 } 5312 if maxResults != nil { 5313 queryParameters["MaxResults"] = autorest.Encode("query", *maxResults) 5314 } else { 5315 queryParameters["MaxResults"] = autorest.Encode("query", 0) 5316 } 5317 if timeout != nil { 5318 queryParameters["timeout"] = autorest.Encode("query", *timeout) 5319 } else { 5320 queryParameters["timeout"] = autorest.Encode("query", 60) 5321 } 5322 5323 preparer := autorest.CreatePreparer( 5324 autorest.AsGet(), 5325 autorest.WithBaseURL(client.BaseURI), 5326 autorest.WithPath("/Tools/Chaos/Events"), 5327 autorest.WithQueryParameters(queryParameters)) 5328 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 5329} 5330 5331// GetChaosEventsSender sends the GetChaosEvents request. The method will close the 5332// http.Response Body if it receives an error. 5333func (client BaseClient) GetChaosEventsSender(req *http.Request) (*http.Response, error) { 5334 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 5335 return autorest.SendWithSender(client, req, sd...) 5336} 5337 5338// GetChaosEventsResponder handles the response to the GetChaosEvents request. The method always 5339// closes the http.Response Body. 5340func (client BaseClient) GetChaosEventsResponder(resp *http.Response) (result ChaosEventsSegment, err error) { 5341 err = autorest.Respond( 5342 resp, 5343 client.ByInspecting(), 5344 azure.WithErrorUnlessStatusCode(http.StatusOK), 5345 autorest.ByUnmarshallingJSON(&result), 5346 autorest.ByClosing()) 5347 result.Response = autorest.Response{Response: resp} 5348 return 5349} 5350 5351// GetChaosSchedule gets the version of the Chaos Schedule in use and the Chaos Schedule that defines when and how to 5352// run Chaos. 5353func (client BaseClient) GetChaosSchedule(ctx context.Context) (result ChaosScheduleDescription, err error) { 5354 if tracing.IsEnabled() { 5355 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetChaosSchedule") 5356 defer func() { 5357 sc := -1 5358 if result.Response.Response != nil { 5359 sc = result.Response.Response.StatusCode 5360 } 5361 tracing.EndSpan(ctx, sc, err) 5362 }() 5363 } 5364 req, err := client.GetChaosSchedulePreparer(ctx) 5365 if err != nil { 5366 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetChaosSchedule", nil, "Failure preparing request") 5367 return 5368 } 5369 5370 resp, err := client.GetChaosScheduleSender(req) 5371 if err != nil { 5372 result.Response = autorest.Response{Response: resp} 5373 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetChaosSchedule", resp, "Failure sending request") 5374 return 5375 } 5376 5377 result, err = client.GetChaosScheduleResponder(resp) 5378 if err != nil { 5379 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetChaosSchedule", resp, "Failure responding to request") 5380 } 5381 5382 return 5383} 5384 5385// GetChaosSchedulePreparer prepares the GetChaosSchedule request. 5386func (client BaseClient) GetChaosSchedulePreparer(ctx context.Context) (*http.Request, error) { 5387 const APIVersion = "6.2" 5388 queryParameters := map[string]interface{}{ 5389 "api-version": APIVersion, 5390 } 5391 5392 preparer := autorest.CreatePreparer( 5393 autorest.AsGet(), 5394 autorest.WithBaseURL(client.BaseURI), 5395 autorest.WithPath("/Tools/Chaos/Schedule"), 5396 autorest.WithQueryParameters(queryParameters)) 5397 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 5398} 5399 5400// GetChaosScheduleSender sends the GetChaosSchedule request. The method will close the 5401// http.Response Body if it receives an error. 5402func (client BaseClient) GetChaosScheduleSender(req *http.Request) (*http.Response, error) { 5403 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 5404 return autorest.SendWithSender(client, req, sd...) 5405} 5406 5407// GetChaosScheduleResponder handles the response to the GetChaosSchedule request. The method always 5408// closes the http.Response Body. 5409func (client BaseClient) GetChaosScheduleResponder(resp *http.Response) (result ChaosScheduleDescription, err error) { 5410 err = autorest.Respond( 5411 resp, 5412 client.ByInspecting(), 5413 azure.WithErrorUnlessStatusCode(http.StatusOK), 5414 autorest.ByUnmarshallingJSON(&result), 5415 autorest.ByClosing()) 5416 result.Response = autorest.Response{Response: resp} 5417 return 5418} 5419 5420// GetClusterConfiguration get the Service Fabric standalone cluster configuration. The cluster configuration contains 5421// properties of the cluster that include different node types on the cluster, 5422// security configurations, fault and upgrade domain topologies, etc. 5423// Parameters: 5424// configurationAPIVersion - the API version of the Standalone cluster json configuration. 5425// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 5426// duration that the client is willing to wait for the requested operation to complete. The default value for 5427// this parameter is 60 seconds. 5428func (client BaseClient) GetClusterConfiguration(ctx context.Context, configurationAPIVersion string, timeout *int64) (result ClusterConfiguration, err error) { 5429 if tracing.IsEnabled() { 5430 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetClusterConfiguration") 5431 defer func() { 5432 sc := -1 5433 if result.Response.Response != nil { 5434 sc = result.Response.Response.StatusCode 5435 } 5436 tracing.EndSpan(ctx, sc, err) 5437 }() 5438 } 5439 if err := validation.Validate([]validation.Validation{ 5440 {TargetValue: timeout, 5441 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 5442 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 5443 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 5444 }}}}}); err != nil { 5445 return result, validation.NewError("servicefabric.BaseClient", "GetClusterConfiguration", err.Error()) 5446 } 5447 5448 req, err := client.GetClusterConfigurationPreparer(ctx, configurationAPIVersion, timeout) 5449 if err != nil { 5450 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterConfiguration", nil, "Failure preparing request") 5451 return 5452 } 5453 5454 resp, err := client.GetClusterConfigurationSender(req) 5455 if err != nil { 5456 result.Response = autorest.Response{Response: resp} 5457 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterConfiguration", resp, "Failure sending request") 5458 return 5459 } 5460 5461 result, err = client.GetClusterConfigurationResponder(resp) 5462 if err != nil { 5463 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterConfiguration", resp, "Failure responding to request") 5464 } 5465 5466 return 5467} 5468 5469// GetClusterConfigurationPreparer prepares the GetClusterConfiguration request. 5470func (client BaseClient) GetClusterConfigurationPreparer(ctx context.Context, configurationAPIVersion string, timeout *int64) (*http.Request, error) { 5471 const APIVersion = "6.0" 5472 queryParameters := map[string]interface{}{ 5473 "api-version": APIVersion, 5474 "ConfigurationApiVersion": autorest.Encode("query", configurationAPIVersion), 5475 } 5476 if timeout != nil { 5477 queryParameters["timeout"] = autorest.Encode("query", *timeout) 5478 } else { 5479 queryParameters["timeout"] = autorest.Encode("query", 60) 5480 } 5481 5482 preparer := autorest.CreatePreparer( 5483 autorest.AsGet(), 5484 autorest.WithBaseURL(client.BaseURI), 5485 autorest.WithPath("/$/GetClusterConfiguration"), 5486 autorest.WithQueryParameters(queryParameters)) 5487 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 5488} 5489 5490// GetClusterConfigurationSender sends the GetClusterConfiguration request. The method will close the 5491// http.Response Body if it receives an error. 5492func (client BaseClient) GetClusterConfigurationSender(req *http.Request) (*http.Response, error) { 5493 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 5494 return autorest.SendWithSender(client, req, sd...) 5495} 5496 5497// GetClusterConfigurationResponder handles the response to the GetClusterConfiguration request. The method always 5498// closes the http.Response Body. 5499func (client BaseClient) GetClusterConfigurationResponder(resp *http.Response) (result ClusterConfiguration, err error) { 5500 err = autorest.Respond( 5501 resp, 5502 client.ByInspecting(), 5503 azure.WithErrorUnlessStatusCode(http.StatusOK), 5504 autorest.ByUnmarshallingJSON(&result), 5505 autorest.ByClosing()) 5506 result.Response = autorest.Response{Response: resp} 5507 return 5508} 5509 5510// GetClusterConfigurationUpgradeStatus get the cluster configuration upgrade status details of a Service Fabric 5511// standalone cluster. 5512// Parameters: 5513// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 5514// duration that the client is willing to wait for the requested operation to complete. The default value for 5515// this parameter is 60 seconds. 5516func (client BaseClient) GetClusterConfigurationUpgradeStatus(ctx context.Context, timeout *int64) (result ClusterConfigurationUpgradeStatusInfo, err error) { 5517 if tracing.IsEnabled() { 5518 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetClusterConfigurationUpgradeStatus") 5519 defer func() { 5520 sc := -1 5521 if result.Response.Response != nil { 5522 sc = result.Response.Response.StatusCode 5523 } 5524 tracing.EndSpan(ctx, sc, err) 5525 }() 5526 } 5527 if err := validation.Validate([]validation.Validation{ 5528 {TargetValue: timeout, 5529 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 5530 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 5531 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 5532 }}}}}); err != nil { 5533 return result, validation.NewError("servicefabric.BaseClient", "GetClusterConfigurationUpgradeStatus", err.Error()) 5534 } 5535 5536 req, err := client.GetClusterConfigurationUpgradeStatusPreparer(ctx, timeout) 5537 if err != nil { 5538 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterConfigurationUpgradeStatus", nil, "Failure preparing request") 5539 return 5540 } 5541 5542 resp, err := client.GetClusterConfigurationUpgradeStatusSender(req) 5543 if err != nil { 5544 result.Response = autorest.Response{Response: resp} 5545 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterConfigurationUpgradeStatus", resp, "Failure sending request") 5546 return 5547 } 5548 5549 result, err = client.GetClusterConfigurationUpgradeStatusResponder(resp) 5550 if err != nil { 5551 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterConfigurationUpgradeStatus", resp, "Failure responding to request") 5552 } 5553 5554 return 5555} 5556 5557// GetClusterConfigurationUpgradeStatusPreparer prepares the GetClusterConfigurationUpgradeStatus request. 5558func (client BaseClient) GetClusterConfigurationUpgradeStatusPreparer(ctx context.Context, timeout *int64) (*http.Request, error) { 5559 const APIVersion = "6.0" 5560 queryParameters := map[string]interface{}{ 5561 "api-version": APIVersion, 5562 } 5563 if timeout != nil { 5564 queryParameters["timeout"] = autorest.Encode("query", *timeout) 5565 } else { 5566 queryParameters["timeout"] = autorest.Encode("query", 60) 5567 } 5568 5569 preparer := autorest.CreatePreparer( 5570 autorest.AsGet(), 5571 autorest.WithBaseURL(client.BaseURI), 5572 autorest.WithPath("/$/GetClusterConfigurationUpgradeStatus"), 5573 autorest.WithQueryParameters(queryParameters)) 5574 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 5575} 5576 5577// GetClusterConfigurationUpgradeStatusSender sends the GetClusterConfigurationUpgradeStatus request. The method will close the 5578// http.Response Body if it receives an error. 5579func (client BaseClient) GetClusterConfigurationUpgradeStatusSender(req *http.Request) (*http.Response, error) { 5580 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 5581 return autorest.SendWithSender(client, req, sd...) 5582} 5583 5584// GetClusterConfigurationUpgradeStatusResponder handles the response to the GetClusterConfigurationUpgradeStatus request. The method always 5585// closes the http.Response Body. 5586func (client BaseClient) GetClusterConfigurationUpgradeStatusResponder(resp *http.Response) (result ClusterConfigurationUpgradeStatusInfo, err error) { 5587 err = autorest.Respond( 5588 resp, 5589 client.ByInspecting(), 5590 azure.WithErrorUnlessStatusCode(http.StatusOK), 5591 autorest.ByUnmarshallingJSON(&result), 5592 autorest.ByClosing()) 5593 result.Response = autorest.Response{Response: resp} 5594 return 5595} 5596 5597// GetClusterEventList the response is list of ClusterEvent objects. 5598// Parameters: 5599// startTimeUtc - the start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. 5600// endTimeUtc - the end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. 5601// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 5602// duration that the client is willing to wait for the requested operation to complete. The default value for 5603// this parameter is 60 seconds. 5604// eventsTypesFilter - this is a comma separated string specifying the types of FabricEvents that should only 5605// be included in the response. 5606// excludeAnalysisEvents - this param disables the retrieval of AnalysisEvents if true is passed. 5607// skipCorrelationLookup - this param disables the search of CorrelatedEvents information if true is passed. 5608// otherwise the CorrelationEvents get processed and HasCorrelatedEvents field in every FabricEvent gets 5609// populated. 5610func (client BaseClient) GetClusterEventList(ctx context.Context, startTimeUtc string, endTimeUtc string, timeout *int64, eventsTypesFilter string, excludeAnalysisEvents *bool, skipCorrelationLookup *bool) (result ListClusterEvent, err error) { 5611 if tracing.IsEnabled() { 5612 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetClusterEventList") 5613 defer func() { 5614 sc := -1 5615 if result.Response.Response != nil { 5616 sc = result.Response.Response.StatusCode 5617 } 5618 tracing.EndSpan(ctx, sc, err) 5619 }() 5620 } 5621 if err := validation.Validate([]validation.Validation{ 5622 {TargetValue: timeout, 5623 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 5624 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 5625 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 5626 }}}}}); err != nil { 5627 return result, validation.NewError("servicefabric.BaseClient", "GetClusterEventList", err.Error()) 5628 } 5629 5630 req, err := client.GetClusterEventListPreparer(ctx, startTimeUtc, endTimeUtc, timeout, eventsTypesFilter, excludeAnalysisEvents, skipCorrelationLookup) 5631 if err != nil { 5632 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterEventList", nil, "Failure preparing request") 5633 return 5634 } 5635 5636 resp, err := client.GetClusterEventListSender(req) 5637 if err != nil { 5638 result.Response = autorest.Response{Response: resp} 5639 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterEventList", resp, "Failure sending request") 5640 return 5641 } 5642 5643 result, err = client.GetClusterEventListResponder(resp) 5644 if err != nil { 5645 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterEventList", resp, "Failure responding to request") 5646 } 5647 5648 return 5649} 5650 5651// GetClusterEventListPreparer prepares the GetClusterEventList request. 5652func (client BaseClient) GetClusterEventListPreparer(ctx context.Context, startTimeUtc string, endTimeUtc string, timeout *int64, eventsTypesFilter string, excludeAnalysisEvents *bool, skipCorrelationLookup *bool) (*http.Request, error) { 5653 const APIVersion = "6.2-preview" 5654 queryParameters := map[string]interface{}{ 5655 "api-version": APIVersion, 5656 "EndTimeUtc": autorest.Encode("query", endTimeUtc), 5657 "StartTimeUtc": autorest.Encode("query", startTimeUtc), 5658 } 5659 if timeout != nil { 5660 queryParameters["timeout"] = autorest.Encode("query", *timeout) 5661 } else { 5662 queryParameters["timeout"] = autorest.Encode("query", 60) 5663 } 5664 if len(eventsTypesFilter) > 0 { 5665 queryParameters["EventsTypesFilter"] = autorest.Encode("query", eventsTypesFilter) 5666 } 5667 if excludeAnalysisEvents != nil { 5668 queryParameters["ExcludeAnalysisEvents"] = autorest.Encode("query", *excludeAnalysisEvents) 5669 } 5670 if skipCorrelationLookup != nil { 5671 queryParameters["SkipCorrelationLookup"] = autorest.Encode("query", *skipCorrelationLookup) 5672 } 5673 5674 preparer := autorest.CreatePreparer( 5675 autorest.AsGet(), 5676 autorest.WithBaseURL(client.BaseURI), 5677 autorest.WithPath("/EventsStore/Cluster/Events"), 5678 autorest.WithQueryParameters(queryParameters)) 5679 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 5680} 5681 5682// GetClusterEventListSender sends the GetClusterEventList request. The method will close the 5683// http.Response Body if it receives an error. 5684func (client BaseClient) GetClusterEventListSender(req *http.Request) (*http.Response, error) { 5685 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 5686 return autorest.SendWithSender(client, req, sd...) 5687} 5688 5689// GetClusterEventListResponder handles the response to the GetClusterEventList request. The method always 5690// closes the http.Response Body. 5691func (client BaseClient) GetClusterEventListResponder(resp *http.Response) (result ListClusterEvent, err error) { 5692 err = autorest.Respond( 5693 resp, 5694 client.ByInspecting(), 5695 azure.WithErrorUnlessStatusCode(http.StatusOK), 5696 autorest.ByUnmarshallingJSON(&result), 5697 autorest.ByClosing()) 5698 result.Response = autorest.Response{Response: resp} 5699 return 5700} 5701 5702// GetClusterHealth gets the health of a Service Fabric cluster. 5703// Use EventsHealthStateFilter to filter the collection of health events reported on the cluster based on the health 5704// state. 5705// Similarly, use NodesHealthStateFilter and ApplicationsHealthStateFilter to filter the collection of nodes and 5706// applications returned based on their aggregated health state. 5707// Parameters: 5708// nodesHealthStateFilter - allows filtering of the node health state objects returned in the result of cluster 5709// health query 5710// based on their health state. The possible values for this parameter include integer value of one of the 5711// following health states. Only nodes that match the filter are returned. All nodes are used to evaluate the 5712// aggregated health state. 5713// If not specified, all entries are returned. 5714// The state values are flag based enumeration, so the value could be a combination of these values obtained 5715// using bitwise 'OR' operator. 5716// For example, if the provided value is 6 then health state of nodes with HealthState value of OK (2) and 5717// Warning (4) are returned. 5718// 5719// - Default - Default value. Matches any HealthState. The value is zero. 5720// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given 5721// collection of states. The value is 1. 5722// - Ok - Filter that matches input with HealthState value Ok. The value is 2. 5723// - Warning - Filter that matches input with HealthState value Warning. The value is 4. 5724// - Error - Filter that matches input with HealthState value Error. The value is 8. 5725// - All - Filter that matches input with any HealthState value. The value is 65535. 5726// applicationsHealthStateFilter - allows filtering of the application health state objects returned in the 5727// result of cluster health 5728// query based on their health state. 5729// The possible values for this parameter include integer value obtained from members or bitwise operations 5730// on members of HealthStateFilter enumeration. Only applications that match the filter are returned. 5731// All applications are used to evaluate the aggregated health state. If not specified, all entries are 5732// returned. 5733// The state values are flag based enumeration, so the value could be a combination of these values obtained 5734// using bitwise 'OR' operator. 5735// For example, if the provided value is 6 then health state of applications with HealthState value of OK (2) 5736// and Warning (4) are returned. 5737// 5738// - Default - Default value. Matches any HealthState. The value is zero. 5739// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given 5740// collection of states. The value is 1. 5741// - Ok - Filter that matches input with HealthState value Ok. The value is 2. 5742// - Warning - Filter that matches input with HealthState value Warning. The value is 4. 5743// - Error - Filter that matches input with HealthState value Error. The value is 8. 5744// - All - Filter that matches input with any HealthState value. The value is 65535. 5745// eventsHealthStateFilter - allows filtering the collection of HealthEvent objects returned based on health 5746// state. 5747// The possible values for this parameter include integer value of one of the following health states. 5748// Only events that match the filter are returned. All events are used to evaluate the aggregated health state. 5749// If not specified, all entries are returned. The state values are flag based enumeration, so the value could 5750// be a combination of these value obtained using bitwise 'OR' operator. For example, If the provided value is 5751// 6 then all of the events with HealthState value of OK (2) and Warning (4) are returned. 5752// 5753// - Default - Default value. Matches any HealthState. The value is zero. 5754// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given 5755// collection of states. The value is 1. 5756// - Ok - Filter that matches input with HealthState value Ok. The value is 2. 5757// - Warning - Filter that matches input with HealthState value Warning. The value is 4. 5758// - Error - Filter that matches input with HealthState value Error. The value is 8. 5759// - All - Filter that matches input with any HealthState value. The value is 65535. 5760// excludeHealthStatistics - indicates whether the health statistics should be returned as part of the query 5761// result. False by default. 5762// The statistics show the number of children entities in health state Ok, Warning, and Error. 5763// includeSystemApplicationHealthStatistics - indicates whether the health statistics should include the 5764// fabric:/System application health statistics. False by default. 5765// If IncludeSystemApplicationHealthStatistics is set to true, the health statistics include the entities that 5766// belong to the fabric:/System application. 5767// Otherwise, the query result includes health statistics only for user applications. 5768// The health statistics must be included in the query result for this parameter to be applied. 5769// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 5770// duration that the client is willing to wait for the requested operation to complete. The default value for 5771// this parameter is 60 seconds. 5772func (client BaseClient) GetClusterHealth(ctx context.Context, nodesHealthStateFilter *int32, applicationsHealthStateFilter *int32, eventsHealthStateFilter *int32, excludeHealthStatistics *bool, includeSystemApplicationHealthStatistics *bool, timeout *int64) (result ClusterHealth, err error) { 5773 if tracing.IsEnabled() { 5774 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetClusterHealth") 5775 defer func() { 5776 sc := -1 5777 if result.Response.Response != nil { 5778 sc = result.Response.Response.StatusCode 5779 } 5780 tracing.EndSpan(ctx, sc, err) 5781 }() 5782 } 5783 if err := validation.Validate([]validation.Validation{ 5784 {TargetValue: timeout, 5785 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 5786 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 5787 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 5788 }}}}}); err != nil { 5789 return result, validation.NewError("servicefabric.BaseClient", "GetClusterHealth", err.Error()) 5790 } 5791 5792 req, err := client.GetClusterHealthPreparer(ctx, nodesHealthStateFilter, applicationsHealthStateFilter, eventsHealthStateFilter, excludeHealthStatistics, includeSystemApplicationHealthStatistics, timeout) 5793 if err != nil { 5794 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterHealth", nil, "Failure preparing request") 5795 return 5796 } 5797 5798 resp, err := client.GetClusterHealthSender(req) 5799 if err != nil { 5800 result.Response = autorest.Response{Response: resp} 5801 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterHealth", resp, "Failure sending request") 5802 return 5803 } 5804 5805 result, err = client.GetClusterHealthResponder(resp) 5806 if err != nil { 5807 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterHealth", resp, "Failure responding to request") 5808 } 5809 5810 return 5811} 5812 5813// GetClusterHealthPreparer prepares the GetClusterHealth request. 5814func (client BaseClient) GetClusterHealthPreparer(ctx context.Context, nodesHealthStateFilter *int32, applicationsHealthStateFilter *int32, eventsHealthStateFilter *int32, excludeHealthStatistics *bool, includeSystemApplicationHealthStatistics *bool, timeout *int64) (*http.Request, error) { 5815 const APIVersion = "6.0" 5816 queryParameters := map[string]interface{}{ 5817 "api-version": APIVersion, 5818 } 5819 if nodesHealthStateFilter != nil { 5820 queryParameters["NodesHealthStateFilter"] = autorest.Encode("query", *nodesHealthStateFilter) 5821 } else { 5822 queryParameters["NodesHealthStateFilter"] = autorest.Encode("query", 0) 5823 } 5824 if applicationsHealthStateFilter != nil { 5825 queryParameters["ApplicationsHealthStateFilter"] = autorest.Encode("query", *applicationsHealthStateFilter) 5826 } else { 5827 queryParameters["ApplicationsHealthStateFilter"] = autorest.Encode("query", 0) 5828 } 5829 if eventsHealthStateFilter != nil { 5830 queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", *eventsHealthStateFilter) 5831 } else { 5832 queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", 0) 5833 } 5834 if excludeHealthStatistics != nil { 5835 queryParameters["ExcludeHealthStatistics"] = autorest.Encode("query", *excludeHealthStatistics) 5836 } else { 5837 queryParameters["ExcludeHealthStatistics"] = autorest.Encode("query", false) 5838 } 5839 if includeSystemApplicationHealthStatistics != nil { 5840 queryParameters["IncludeSystemApplicationHealthStatistics"] = autorest.Encode("query", *includeSystemApplicationHealthStatistics) 5841 } else { 5842 queryParameters["IncludeSystemApplicationHealthStatistics"] = autorest.Encode("query", false) 5843 } 5844 if timeout != nil { 5845 queryParameters["timeout"] = autorest.Encode("query", *timeout) 5846 } else { 5847 queryParameters["timeout"] = autorest.Encode("query", 60) 5848 } 5849 5850 preparer := autorest.CreatePreparer( 5851 autorest.AsGet(), 5852 autorest.WithBaseURL(client.BaseURI), 5853 autorest.WithPath("/$/GetClusterHealth"), 5854 autorest.WithQueryParameters(queryParameters)) 5855 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 5856} 5857 5858// GetClusterHealthSender sends the GetClusterHealth request. The method will close the 5859// http.Response Body if it receives an error. 5860func (client BaseClient) GetClusterHealthSender(req *http.Request) (*http.Response, error) { 5861 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 5862 return autorest.SendWithSender(client, req, sd...) 5863} 5864 5865// GetClusterHealthResponder handles the response to the GetClusterHealth request. The method always 5866// closes the http.Response Body. 5867func (client BaseClient) GetClusterHealthResponder(resp *http.Response) (result ClusterHealth, err error) { 5868 err = autorest.Respond( 5869 resp, 5870 client.ByInspecting(), 5871 azure.WithErrorUnlessStatusCode(http.StatusOK), 5872 autorest.ByUnmarshallingJSON(&result), 5873 autorest.ByClosing()) 5874 result.Response = autorest.Response{Response: resp} 5875 return 5876} 5877 5878// GetClusterHealthChunk gets the health of a Service Fabric cluster using health chunks. Includes the aggregated 5879// health state of the cluster, but none of the cluster entities. 5880// To expand the cluster health and get the health state of all or some of the entities, use the POST URI and specify 5881// the cluster health chunk query description. 5882// Parameters: 5883// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 5884// duration that the client is willing to wait for the requested operation to complete. The default value for 5885// this parameter is 60 seconds. 5886func (client BaseClient) GetClusterHealthChunk(ctx context.Context, timeout *int64) (result ClusterHealthChunk, err error) { 5887 if tracing.IsEnabled() { 5888 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetClusterHealthChunk") 5889 defer func() { 5890 sc := -1 5891 if result.Response.Response != nil { 5892 sc = result.Response.Response.StatusCode 5893 } 5894 tracing.EndSpan(ctx, sc, err) 5895 }() 5896 } 5897 if err := validation.Validate([]validation.Validation{ 5898 {TargetValue: timeout, 5899 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 5900 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 5901 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 5902 }}}}}); err != nil { 5903 return result, validation.NewError("servicefabric.BaseClient", "GetClusterHealthChunk", err.Error()) 5904 } 5905 5906 req, err := client.GetClusterHealthChunkPreparer(ctx, timeout) 5907 if err != nil { 5908 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterHealthChunk", nil, "Failure preparing request") 5909 return 5910 } 5911 5912 resp, err := client.GetClusterHealthChunkSender(req) 5913 if err != nil { 5914 result.Response = autorest.Response{Response: resp} 5915 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterHealthChunk", resp, "Failure sending request") 5916 return 5917 } 5918 5919 result, err = client.GetClusterHealthChunkResponder(resp) 5920 if err != nil { 5921 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterHealthChunk", resp, "Failure responding to request") 5922 } 5923 5924 return 5925} 5926 5927// GetClusterHealthChunkPreparer prepares the GetClusterHealthChunk request. 5928func (client BaseClient) GetClusterHealthChunkPreparer(ctx context.Context, timeout *int64) (*http.Request, error) { 5929 const APIVersion = "6.0" 5930 queryParameters := map[string]interface{}{ 5931 "api-version": APIVersion, 5932 } 5933 if timeout != nil { 5934 queryParameters["timeout"] = autorest.Encode("query", *timeout) 5935 } else { 5936 queryParameters["timeout"] = autorest.Encode("query", 60) 5937 } 5938 5939 preparer := autorest.CreatePreparer( 5940 autorest.AsGet(), 5941 autorest.WithBaseURL(client.BaseURI), 5942 autorest.WithPath("/$/GetClusterHealthChunk"), 5943 autorest.WithQueryParameters(queryParameters)) 5944 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 5945} 5946 5947// GetClusterHealthChunkSender sends the GetClusterHealthChunk request. The method will close the 5948// http.Response Body if it receives an error. 5949func (client BaseClient) GetClusterHealthChunkSender(req *http.Request) (*http.Response, error) { 5950 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 5951 return autorest.SendWithSender(client, req, sd...) 5952} 5953 5954// GetClusterHealthChunkResponder handles the response to the GetClusterHealthChunk request. The method always 5955// closes the http.Response Body. 5956func (client BaseClient) GetClusterHealthChunkResponder(resp *http.Response) (result ClusterHealthChunk, err error) { 5957 err = autorest.Respond( 5958 resp, 5959 client.ByInspecting(), 5960 azure.WithErrorUnlessStatusCode(http.StatusOK), 5961 autorest.ByUnmarshallingJSON(&result), 5962 autorest.ByClosing()) 5963 result.Response = autorest.Response{Response: resp} 5964 return 5965} 5966 5967// GetClusterHealthChunkUsingPolicyAndAdvancedFilters gets the health of a Service Fabric cluster using health chunks. 5968// The health evaluation is done based on the input cluster health chunk query description. 5969// The query description allows users to specify health policies for evaluating the cluster and its children. 5970// Users can specify very flexible filters to select which cluster entities to return. The selection can be done based 5971// on the entities health state and based on the hierarchy. 5972// The query can return multi-level children of the entities based on the specified filters. For example, it can return 5973// one application with a specified name, and for this application, return 5974// only services that are in Error or Warning, and all partitions and replicas for one of these services. 5975// Parameters: 5976// clusterHealthChunkQueryDescription - describes the cluster and application health policies used to evaluate 5977// the cluster health and the filters to select which cluster entities to be returned. 5978// If the cluster health policy is present, it is used to evaluate the cluster events and the cluster nodes. If 5979// not present, the health evaluation uses the cluster health policy defined in the cluster manifest or the 5980// default cluster health policy. 5981// By default, each application is evaluated using its specific application health policy, defined in the 5982// application manifest, or the default health policy, if no policy is defined in manifest. 5983// If the application health policy map is specified, and it has an entry for an application, the specified 5984// application health policy 5985// is used to evaluate the application health. 5986// Users can specify very flexible filters to select which cluster entities to include in response. The 5987// selection can be done based on the entities health state and based on the hierarchy. 5988// The query can return multi-level children of the entities based on the specified filters. For example, it 5989// can return one application with a specified name, and for this application, return 5990// only services that are in Error or Warning, and all partitions and replicas for one of these services. 5991// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 5992// duration that the client is willing to wait for the requested operation to complete. The default value for 5993// this parameter is 60 seconds. 5994func (client BaseClient) GetClusterHealthChunkUsingPolicyAndAdvancedFilters(ctx context.Context, clusterHealthChunkQueryDescription *ClusterHealthChunkQueryDescription, timeout *int64) (result ClusterHealthChunk, err error) { 5995 if tracing.IsEnabled() { 5996 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetClusterHealthChunkUsingPolicyAndAdvancedFilters") 5997 defer func() { 5998 sc := -1 5999 if result.Response.Response != nil { 6000 sc = result.Response.Response.StatusCode 6001 } 6002 tracing.EndSpan(ctx, sc, err) 6003 }() 6004 } 6005 if err := validation.Validate([]validation.Validation{ 6006 {TargetValue: timeout, 6007 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 6008 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 6009 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 6010 }}}}}); err != nil { 6011 return result, validation.NewError("servicefabric.BaseClient", "GetClusterHealthChunkUsingPolicyAndAdvancedFilters", err.Error()) 6012 } 6013 6014 req, err := client.GetClusterHealthChunkUsingPolicyAndAdvancedFiltersPreparer(ctx, clusterHealthChunkQueryDescription, timeout) 6015 if err != nil { 6016 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterHealthChunkUsingPolicyAndAdvancedFilters", nil, "Failure preparing request") 6017 return 6018 } 6019 6020 resp, err := client.GetClusterHealthChunkUsingPolicyAndAdvancedFiltersSender(req) 6021 if err != nil { 6022 result.Response = autorest.Response{Response: resp} 6023 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterHealthChunkUsingPolicyAndAdvancedFilters", resp, "Failure sending request") 6024 return 6025 } 6026 6027 result, err = client.GetClusterHealthChunkUsingPolicyAndAdvancedFiltersResponder(resp) 6028 if err != nil { 6029 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterHealthChunkUsingPolicyAndAdvancedFilters", resp, "Failure responding to request") 6030 } 6031 6032 return 6033} 6034 6035// GetClusterHealthChunkUsingPolicyAndAdvancedFiltersPreparer prepares the GetClusterHealthChunkUsingPolicyAndAdvancedFilters request. 6036func (client BaseClient) GetClusterHealthChunkUsingPolicyAndAdvancedFiltersPreparer(ctx context.Context, clusterHealthChunkQueryDescription *ClusterHealthChunkQueryDescription, timeout *int64) (*http.Request, error) { 6037 const APIVersion = "6.0" 6038 queryParameters := map[string]interface{}{ 6039 "api-version": APIVersion, 6040 } 6041 if timeout != nil { 6042 queryParameters["timeout"] = autorest.Encode("query", *timeout) 6043 } else { 6044 queryParameters["timeout"] = autorest.Encode("query", 60) 6045 } 6046 6047 preparer := autorest.CreatePreparer( 6048 autorest.AsContentType("application/json; charset=utf-8"), 6049 autorest.AsPost(), 6050 autorest.WithBaseURL(client.BaseURI), 6051 autorest.WithPath("/$/GetClusterHealthChunk"), 6052 autorest.WithQueryParameters(queryParameters)) 6053 if clusterHealthChunkQueryDescription != nil { 6054 preparer = autorest.DecoratePreparer(preparer, 6055 autorest.WithJSON(clusterHealthChunkQueryDescription)) 6056 } 6057 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 6058} 6059 6060// GetClusterHealthChunkUsingPolicyAndAdvancedFiltersSender sends the GetClusterHealthChunkUsingPolicyAndAdvancedFilters request. The method will close the 6061// http.Response Body if it receives an error. 6062func (client BaseClient) GetClusterHealthChunkUsingPolicyAndAdvancedFiltersSender(req *http.Request) (*http.Response, error) { 6063 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 6064 return autorest.SendWithSender(client, req, sd...) 6065} 6066 6067// GetClusterHealthChunkUsingPolicyAndAdvancedFiltersResponder handles the response to the GetClusterHealthChunkUsingPolicyAndAdvancedFilters request. The method always 6068// closes the http.Response Body. 6069func (client BaseClient) GetClusterHealthChunkUsingPolicyAndAdvancedFiltersResponder(resp *http.Response) (result ClusterHealthChunk, err error) { 6070 err = autorest.Respond( 6071 resp, 6072 client.ByInspecting(), 6073 azure.WithErrorUnlessStatusCode(http.StatusOK), 6074 autorest.ByUnmarshallingJSON(&result), 6075 autorest.ByClosing()) 6076 result.Response = autorest.Response{Response: resp} 6077 return 6078} 6079 6080// GetClusterHealthUsingPolicy gets the health of a Service Fabric cluster. 6081// Use EventsHealthStateFilter to filter the collection of health events reported on the cluster based on the health 6082// state. 6083// Similarly, use NodesHealthStateFilter and ApplicationsHealthStateFilter to filter the collection of nodes and 6084// applications returned based on their aggregated health state. 6085// Use ClusterHealthPolicies to override the health policies used to evaluate the health. 6086// Parameters: 6087// nodesHealthStateFilter - allows filtering of the node health state objects returned in the result of cluster 6088// health query 6089// based on their health state. The possible values for this parameter include integer value of one of the 6090// following health states. Only nodes that match the filter are returned. All nodes are used to evaluate the 6091// aggregated health state. 6092// If not specified, all entries are returned. 6093// The state values are flag based enumeration, so the value could be a combination of these values obtained 6094// using bitwise 'OR' operator. 6095// For example, if the provided value is 6 then health state of nodes with HealthState value of OK (2) and 6096// Warning (4) are returned. 6097// 6098// - Default - Default value. Matches any HealthState. The value is zero. 6099// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given 6100// collection of states. The value is 1. 6101// - Ok - Filter that matches input with HealthState value Ok. The value is 2. 6102// - Warning - Filter that matches input with HealthState value Warning. The value is 4. 6103// - Error - Filter that matches input with HealthState value Error. The value is 8. 6104// - All - Filter that matches input with any HealthState value. The value is 65535. 6105// applicationsHealthStateFilter - allows filtering of the application health state objects returned in the 6106// result of cluster health 6107// query based on their health state. 6108// The possible values for this parameter include integer value obtained from members or bitwise operations 6109// on members of HealthStateFilter enumeration. Only applications that match the filter are returned. 6110// All applications are used to evaluate the aggregated health state. If not specified, all entries are 6111// returned. 6112// The state values are flag based enumeration, so the value could be a combination of these values obtained 6113// using bitwise 'OR' operator. 6114// For example, if the provided value is 6 then health state of applications with HealthState value of OK (2) 6115// and Warning (4) are returned. 6116// 6117// - Default - Default value. Matches any HealthState. The value is zero. 6118// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given 6119// collection of states. The value is 1. 6120// - Ok - Filter that matches input with HealthState value Ok. The value is 2. 6121// - Warning - Filter that matches input with HealthState value Warning. The value is 4. 6122// - Error - Filter that matches input with HealthState value Error. The value is 8. 6123// - All - Filter that matches input with any HealthState value. The value is 65535. 6124// eventsHealthStateFilter - allows filtering the collection of HealthEvent objects returned based on health 6125// state. 6126// The possible values for this parameter include integer value of one of the following health states. 6127// Only events that match the filter are returned. All events are used to evaluate the aggregated health state. 6128// If not specified, all entries are returned. The state values are flag based enumeration, so the value could 6129// be a combination of these value obtained using bitwise 'OR' operator. For example, If the provided value is 6130// 6 then all of the events with HealthState value of OK (2) and Warning (4) are returned. 6131// 6132// - Default - Default value. Matches any HealthState. The value is zero. 6133// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given 6134// collection of states. The value is 1. 6135// - Ok - Filter that matches input with HealthState value Ok. The value is 2. 6136// - Warning - Filter that matches input with HealthState value Warning. The value is 4. 6137// - Error - Filter that matches input with HealthState value Error. The value is 8. 6138// - All - Filter that matches input with any HealthState value. The value is 65535. 6139// excludeHealthStatistics - indicates whether the health statistics should be returned as part of the query 6140// result. False by default. 6141// The statistics show the number of children entities in health state Ok, Warning, and Error. 6142// includeSystemApplicationHealthStatistics - indicates whether the health statistics should include the 6143// fabric:/System application health statistics. False by default. 6144// If IncludeSystemApplicationHealthStatistics is set to true, the health statistics include the entities that 6145// belong to the fabric:/System application. 6146// Otherwise, the query result includes health statistics only for user applications. 6147// The health statistics must be included in the query result for this parameter to be applied. 6148// clusterHealthPolicies - describes the health policies used to evaluate the cluster health. 6149// If not present, the health evaluation uses the cluster health policy defined in the cluster manifest or the 6150// default cluster health policy. 6151// By default, each application is evaluated using its specific application health policy, defined in the 6152// application manifest, or the default health policy, if no policy is defined in manifest. 6153// If the application health policy map is specified, and it has an entry for an application, the specified 6154// application health policy 6155// is used to evaluate the application health. 6156// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 6157// duration that the client is willing to wait for the requested operation to complete. The default value for 6158// this parameter is 60 seconds. 6159func (client BaseClient) GetClusterHealthUsingPolicy(ctx context.Context, nodesHealthStateFilter *int32, applicationsHealthStateFilter *int32, eventsHealthStateFilter *int32, excludeHealthStatistics *bool, includeSystemApplicationHealthStatistics *bool, clusterHealthPolicies *ClusterHealthPolicies, timeout *int64) (result ClusterHealth, err error) { 6160 if tracing.IsEnabled() { 6161 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetClusterHealthUsingPolicy") 6162 defer func() { 6163 sc := -1 6164 if result.Response.Response != nil { 6165 sc = result.Response.Response.StatusCode 6166 } 6167 tracing.EndSpan(ctx, sc, err) 6168 }() 6169 } 6170 if err := validation.Validate([]validation.Validation{ 6171 {TargetValue: timeout, 6172 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 6173 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 6174 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 6175 }}}}}); err != nil { 6176 return result, validation.NewError("servicefabric.BaseClient", "GetClusterHealthUsingPolicy", err.Error()) 6177 } 6178 6179 req, err := client.GetClusterHealthUsingPolicyPreparer(ctx, nodesHealthStateFilter, applicationsHealthStateFilter, eventsHealthStateFilter, excludeHealthStatistics, includeSystemApplicationHealthStatistics, clusterHealthPolicies, timeout) 6180 if err != nil { 6181 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterHealthUsingPolicy", nil, "Failure preparing request") 6182 return 6183 } 6184 6185 resp, err := client.GetClusterHealthUsingPolicySender(req) 6186 if err != nil { 6187 result.Response = autorest.Response{Response: resp} 6188 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterHealthUsingPolicy", resp, "Failure sending request") 6189 return 6190 } 6191 6192 result, err = client.GetClusterHealthUsingPolicyResponder(resp) 6193 if err != nil { 6194 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterHealthUsingPolicy", resp, "Failure responding to request") 6195 } 6196 6197 return 6198} 6199 6200// GetClusterHealthUsingPolicyPreparer prepares the GetClusterHealthUsingPolicy request. 6201func (client BaseClient) GetClusterHealthUsingPolicyPreparer(ctx context.Context, nodesHealthStateFilter *int32, applicationsHealthStateFilter *int32, eventsHealthStateFilter *int32, excludeHealthStatistics *bool, includeSystemApplicationHealthStatistics *bool, clusterHealthPolicies *ClusterHealthPolicies, timeout *int64) (*http.Request, error) { 6202 const APIVersion = "6.0" 6203 queryParameters := map[string]interface{}{ 6204 "api-version": APIVersion, 6205 } 6206 if nodesHealthStateFilter != nil { 6207 queryParameters["NodesHealthStateFilter"] = autorest.Encode("query", *nodesHealthStateFilter) 6208 } else { 6209 queryParameters["NodesHealthStateFilter"] = autorest.Encode("query", 0) 6210 } 6211 if applicationsHealthStateFilter != nil { 6212 queryParameters["ApplicationsHealthStateFilter"] = autorest.Encode("query", *applicationsHealthStateFilter) 6213 } else { 6214 queryParameters["ApplicationsHealthStateFilter"] = autorest.Encode("query", 0) 6215 } 6216 if eventsHealthStateFilter != nil { 6217 queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", *eventsHealthStateFilter) 6218 } else { 6219 queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", 0) 6220 } 6221 if excludeHealthStatistics != nil { 6222 queryParameters["ExcludeHealthStatistics"] = autorest.Encode("query", *excludeHealthStatistics) 6223 } else { 6224 queryParameters["ExcludeHealthStatistics"] = autorest.Encode("query", false) 6225 } 6226 if includeSystemApplicationHealthStatistics != nil { 6227 queryParameters["IncludeSystemApplicationHealthStatistics"] = autorest.Encode("query", *includeSystemApplicationHealthStatistics) 6228 } else { 6229 queryParameters["IncludeSystemApplicationHealthStatistics"] = autorest.Encode("query", false) 6230 } 6231 if timeout != nil { 6232 queryParameters["timeout"] = autorest.Encode("query", *timeout) 6233 } else { 6234 queryParameters["timeout"] = autorest.Encode("query", 60) 6235 } 6236 6237 preparer := autorest.CreatePreparer( 6238 autorest.AsContentType("application/json; charset=utf-8"), 6239 autorest.AsPost(), 6240 autorest.WithBaseURL(client.BaseURI), 6241 autorest.WithPath("/$/GetClusterHealth"), 6242 autorest.WithQueryParameters(queryParameters)) 6243 if clusterHealthPolicies != nil { 6244 preparer = autorest.DecoratePreparer(preparer, 6245 autorest.WithJSON(clusterHealthPolicies)) 6246 } 6247 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 6248} 6249 6250// GetClusterHealthUsingPolicySender sends the GetClusterHealthUsingPolicy request. The method will close the 6251// http.Response Body if it receives an error. 6252func (client BaseClient) GetClusterHealthUsingPolicySender(req *http.Request) (*http.Response, error) { 6253 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 6254 return autorest.SendWithSender(client, req, sd...) 6255} 6256 6257// GetClusterHealthUsingPolicyResponder handles the response to the GetClusterHealthUsingPolicy request. The method always 6258// closes the http.Response Body. 6259func (client BaseClient) GetClusterHealthUsingPolicyResponder(resp *http.Response) (result ClusterHealth, err error) { 6260 err = autorest.Respond( 6261 resp, 6262 client.ByInspecting(), 6263 azure.WithErrorUnlessStatusCode(http.StatusOK), 6264 autorest.ByUnmarshallingJSON(&result), 6265 autorest.ByClosing()) 6266 result.Response = autorest.Response{Response: resp} 6267 return 6268} 6269 6270// GetClusterManifest get the Service Fabric cluster manifest. The cluster manifest contains properties of the cluster 6271// that include different node types on the cluster, 6272// security configurations, fault and upgrade domain topologies, etc. 6273// 6274// These properties are specified as part of the ClusterConfig.JSON file while deploying a stand alone cluster. 6275// However, most of the information in the cluster manifest 6276// is generated internally by service fabric during cluster deployment in other deployment scenarios (e.g. when using 6277// azure portal). 6278// 6279// The contents of the cluster manifest are for informational purposes only and users are not expected to take a 6280// dependency on the format of the file contents or its interpretation. 6281// Parameters: 6282// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 6283// duration that the client is willing to wait for the requested operation to complete. The default value for 6284// this parameter is 60 seconds. 6285func (client BaseClient) GetClusterManifest(ctx context.Context, timeout *int64) (result ClusterManifest, err error) { 6286 if tracing.IsEnabled() { 6287 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetClusterManifest") 6288 defer func() { 6289 sc := -1 6290 if result.Response.Response != nil { 6291 sc = result.Response.Response.StatusCode 6292 } 6293 tracing.EndSpan(ctx, sc, err) 6294 }() 6295 } 6296 if err := validation.Validate([]validation.Validation{ 6297 {TargetValue: timeout, 6298 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 6299 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 6300 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 6301 }}}}}); err != nil { 6302 return result, validation.NewError("servicefabric.BaseClient", "GetClusterManifest", err.Error()) 6303 } 6304 6305 req, err := client.GetClusterManifestPreparer(ctx, timeout) 6306 if err != nil { 6307 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterManifest", nil, "Failure preparing request") 6308 return 6309 } 6310 6311 resp, err := client.GetClusterManifestSender(req) 6312 if err != nil { 6313 result.Response = autorest.Response{Response: resp} 6314 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterManifest", resp, "Failure sending request") 6315 return 6316 } 6317 6318 result, err = client.GetClusterManifestResponder(resp) 6319 if err != nil { 6320 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterManifest", resp, "Failure responding to request") 6321 } 6322 6323 return 6324} 6325 6326// GetClusterManifestPreparer prepares the GetClusterManifest request. 6327func (client BaseClient) GetClusterManifestPreparer(ctx context.Context, timeout *int64) (*http.Request, error) { 6328 const APIVersion = "6.0" 6329 queryParameters := map[string]interface{}{ 6330 "api-version": APIVersion, 6331 } 6332 if timeout != nil { 6333 queryParameters["timeout"] = autorest.Encode("query", *timeout) 6334 } else { 6335 queryParameters["timeout"] = autorest.Encode("query", 60) 6336 } 6337 6338 preparer := autorest.CreatePreparer( 6339 autorest.AsGet(), 6340 autorest.WithBaseURL(client.BaseURI), 6341 autorest.WithPath("/$/GetClusterManifest"), 6342 autorest.WithQueryParameters(queryParameters)) 6343 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 6344} 6345 6346// GetClusterManifestSender sends the GetClusterManifest request. The method will close the 6347// http.Response Body if it receives an error. 6348func (client BaseClient) GetClusterManifestSender(req *http.Request) (*http.Response, error) { 6349 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 6350 return autorest.SendWithSender(client, req, sd...) 6351} 6352 6353// GetClusterManifestResponder handles the response to the GetClusterManifest request. The method always 6354// closes the http.Response Body. 6355func (client BaseClient) GetClusterManifestResponder(resp *http.Response) (result ClusterManifest, err error) { 6356 err = autorest.Respond( 6357 resp, 6358 client.ByInspecting(), 6359 azure.WithErrorUnlessStatusCode(http.StatusOK), 6360 autorest.ByUnmarshallingJSON(&result), 6361 autorest.ByClosing()) 6362 result.Response = autorest.Response{Response: resp} 6363 return 6364} 6365 6366// GetClusterUpgradeProgress gets the current progress of the ongoing cluster upgrade. If no upgrade is currently in 6367// progress, gets the last state of the previous cluster upgrade. 6368// Parameters: 6369// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 6370// duration that the client is willing to wait for the requested operation to complete. The default value for 6371// this parameter is 60 seconds. 6372func (client BaseClient) GetClusterUpgradeProgress(ctx context.Context, timeout *int64) (result ClusterUpgradeProgressObject, err error) { 6373 if tracing.IsEnabled() { 6374 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetClusterUpgradeProgress") 6375 defer func() { 6376 sc := -1 6377 if result.Response.Response != nil { 6378 sc = result.Response.Response.StatusCode 6379 } 6380 tracing.EndSpan(ctx, sc, err) 6381 }() 6382 } 6383 if err := validation.Validate([]validation.Validation{ 6384 {TargetValue: timeout, 6385 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 6386 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 6387 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 6388 }}}}}); err != nil { 6389 return result, validation.NewError("servicefabric.BaseClient", "GetClusterUpgradeProgress", err.Error()) 6390 } 6391 6392 req, err := client.GetClusterUpgradeProgressPreparer(ctx, timeout) 6393 if err != nil { 6394 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterUpgradeProgress", nil, "Failure preparing request") 6395 return 6396 } 6397 6398 resp, err := client.GetClusterUpgradeProgressSender(req) 6399 if err != nil { 6400 result.Response = autorest.Response{Response: resp} 6401 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterUpgradeProgress", resp, "Failure sending request") 6402 return 6403 } 6404 6405 result, err = client.GetClusterUpgradeProgressResponder(resp) 6406 if err != nil { 6407 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterUpgradeProgress", resp, "Failure responding to request") 6408 } 6409 6410 return 6411} 6412 6413// GetClusterUpgradeProgressPreparer prepares the GetClusterUpgradeProgress request. 6414func (client BaseClient) GetClusterUpgradeProgressPreparer(ctx context.Context, timeout *int64) (*http.Request, error) { 6415 const APIVersion = "6.0" 6416 queryParameters := map[string]interface{}{ 6417 "api-version": APIVersion, 6418 } 6419 if timeout != nil { 6420 queryParameters["timeout"] = autorest.Encode("query", *timeout) 6421 } else { 6422 queryParameters["timeout"] = autorest.Encode("query", 60) 6423 } 6424 6425 preparer := autorest.CreatePreparer( 6426 autorest.AsGet(), 6427 autorest.WithBaseURL(client.BaseURI), 6428 autorest.WithPath("/$/GetUpgradeProgress"), 6429 autorest.WithQueryParameters(queryParameters)) 6430 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 6431} 6432 6433// GetClusterUpgradeProgressSender sends the GetClusterUpgradeProgress request. The method will close the 6434// http.Response Body if it receives an error. 6435func (client BaseClient) GetClusterUpgradeProgressSender(req *http.Request) (*http.Response, error) { 6436 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 6437 return autorest.SendWithSender(client, req, sd...) 6438} 6439 6440// GetClusterUpgradeProgressResponder handles the response to the GetClusterUpgradeProgress request. The method always 6441// closes the http.Response Body. 6442func (client BaseClient) GetClusterUpgradeProgressResponder(resp *http.Response) (result ClusterUpgradeProgressObject, err error) { 6443 err = autorest.Respond( 6444 resp, 6445 client.ByInspecting(), 6446 azure.WithErrorUnlessStatusCode(http.StatusOK), 6447 autorest.ByUnmarshallingJSON(&result), 6448 autorest.ByClosing()) 6449 result.Response = autorest.Response{Response: resp} 6450 return 6451} 6452 6453// GetComposeDeploymentStatus returns the status of the compose deployment that was created or in the process of being 6454// created in the Service Fabric cluster and whose name matches the one specified as the parameter. The response 6455// includes the name, status and other details about the deployment. 6456// Parameters: 6457// deploymentName - the identity of the deployment. 6458// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 6459// duration that the client is willing to wait for the requested operation to complete. The default value for 6460// this parameter is 60 seconds. 6461func (client BaseClient) GetComposeDeploymentStatus(ctx context.Context, deploymentName string, timeout *int64) (result ComposeDeploymentStatusInfo, err error) { 6462 if tracing.IsEnabled() { 6463 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetComposeDeploymentStatus") 6464 defer func() { 6465 sc := -1 6466 if result.Response.Response != nil { 6467 sc = result.Response.Response.StatusCode 6468 } 6469 tracing.EndSpan(ctx, sc, err) 6470 }() 6471 } 6472 if err := validation.Validate([]validation.Validation{ 6473 {TargetValue: timeout, 6474 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 6475 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 6476 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 6477 }}}}}); err != nil { 6478 return result, validation.NewError("servicefabric.BaseClient", "GetComposeDeploymentStatus", err.Error()) 6479 } 6480 6481 req, err := client.GetComposeDeploymentStatusPreparer(ctx, deploymentName, timeout) 6482 if err != nil { 6483 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetComposeDeploymentStatus", nil, "Failure preparing request") 6484 return 6485 } 6486 6487 resp, err := client.GetComposeDeploymentStatusSender(req) 6488 if err != nil { 6489 result.Response = autorest.Response{Response: resp} 6490 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetComposeDeploymentStatus", resp, "Failure sending request") 6491 return 6492 } 6493 6494 result, err = client.GetComposeDeploymentStatusResponder(resp) 6495 if err != nil { 6496 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetComposeDeploymentStatus", resp, "Failure responding to request") 6497 } 6498 6499 return 6500} 6501 6502// GetComposeDeploymentStatusPreparer prepares the GetComposeDeploymentStatus request. 6503func (client BaseClient) GetComposeDeploymentStatusPreparer(ctx context.Context, deploymentName string, timeout *int64) (*http.Request, error) { 6504 pathParameters := map[string]interface{}{ 6505 "deploymentName": deploymentName, 6506 } 6507 6508 const APIVersion = "6.0-preview" 6509 queryParameters := map[string]interface{}{ 6510 "api-version": APIVersion, 6511 } 6512 if timeout != nil { 6513 queryParameters["timeout"] = autorest.Encode("query", *timeout) 6514 } else { 6515 queryParameters["timeout"] = autorest.Encode("query", 60) 6516 } 6517 6518 preparer := autorest.CreatePreparer( 6519 autorest.AsGet(), 6520 autorest.WithBaseURL(client.BaseURI), 6521 autorest.WithPathParameters("/ComposeDeployments/{deploymentName}", pathParameters), 6522 autorest.WithQueryParameters(queryParameters)) 6523 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 6524} 6525 6526// GetComposeDeploymentStatusSender sends the GetComposeDeploymentStatus request. The method will close the 6527// http.Response Body if it receives an error. 6528func (client BaseClient) GetComposeDeploymentStatusSender(req *http.Request) (*http.Response, error) { 6529 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 6530 return autorest.SendWithSender(client, req, sd...) 6531} 6532 6533// GetComposeDeploymentStatusResponder handles the response to the GetComposeDeploymentStatus request. The method always 6534// closes the http.Response Body. 6535func (client BaseClient) GetComposeDeploymentStatusResponder(resp *http.Response) (result ComposeDeploymentStatusInfo, err error) { 6536 err = autorest.Respond( 6537 resp, 6538 client.ByInspecting(), 6539 azure.WithErrorUnlessStatusCode(http.StatusOK), 6540 autorest.ByUnmarshallingJSON(&result), 6541 autorest.ByClosing()) 6542 result.Response = autorest.Response{Response: resp} 6543 return 6544} 6545 6546// GetComposeDeploymentStatusList gets the status about the compose deployments that were created or in the process of 6547// being created in the Service Fabric cluster. The response includes the name, status and other details about the 6548// compose deployments. If the list of deployments do not fit in a page, one page of results is returned as well as a 6549// continuation token which can be used to get the next page. 6550// Parameters: 6551// continuationToken - the continuation token parameter is used to obtain next set of results. A continuation 6552// token with a non empty value is included in the response of the API when the results from the system do not 6553// fit in a single response. When this value is passed to the next API call, the API returns next set of 6554// results. If there are no further results then the continuation token does not contain a value. The value of 6555// this parameter should not be URL encoded. 6556// maxResults - the maximum number of results to be returned as part of the paged queries. This parameter 6557// defines the upper bound on the number of results returned. The results returned can be less than the 6558// specified maximum results if they do not fit in the message as per the max message size restrictions defined 6559// in the configuration. If this parameter is zero or not specified, the paged queries includes as many results 6560// as possible that fit in the return message. 6561// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 6562// duration that the client is willing to wait for the requested operation to complete. The default value for 6563// this parameter is 60 seconds. 6564func (client BaseClient) GetComposeDeploymentStatusList(ctx context.Context, continuationToken string, maxResults *int64, timeout *int64) (result PagedComposeDeploymentStatusInfoList, err error) { 6565 if tracing.IsEnabled() { 6566 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetComposeDeploymentStatusList") 6567 defer func() { 6568 sc := -1 6569 if result.Response.Response != nil { 6570 sc = result.Response.Response.StatusCode 6571 } 6572 tracing.EndSpan(ctx, sc, err) 6573 }() 6574 } 6575 if err := validation.Validate([]validation.Validation{ 6576 {TargetValue: maxResults, 6577 Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false, 6578 Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}, 6579 {TargetValue: timeout, 6580 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 6581 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 6582 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 6583 }}}}}); err != nil { 6584 return result, validation.NewError("servicefabric.BaseClient", "GetComposeDeploymentStatusList", err.Error()) 6585 } 6586 6587 req, err := client.GetComposeDeploymentStatusListPreparer(ctx, continuationToken, maxResults, timeout) 6588 if err != nil { 6589 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetComposeDeploymentStatusList", nil, "Failure preparing request") 6590 return 6591 } 6592 6593 resp, err := client.GetComposeDeploymentStatusListSender(req) 6594 if err != nil { 6595 result.Response = autorest.Response{Response: resp} 6596 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetComposeDeploymentStatusList", resp, "Failure sending request") 6597 return 6598 } 6599 6600 result, err = client.GetComposeDeploymentStatusListResponder(resp) 6601 if err != nil { 6602 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetComposeDeploymentStatusList", resp, "Failure responding to request") 6603 } 6604 6605 return 6606} 6607 6608// GetComposeDeploymentStatusListPreparer prepares the GetComposeDeploymentStatusList request. 6609func (client BaseClient) GetComposeDeploymentStatusListPreparer(ctx context.Context, continuationToken string, maxResults *int64, timeout *int64) (*http.Request, error) { 6610 const APIVersion = "6.0-preview" 6611 queryParameters := map[string]interface{}{ 6612 "api-version": APIVersion, 6613 } 6614 if len(continuationToken) > 0 { 6615 queryParameters["ContinuationToken"] = continuationToken 6616 } 6617 if maxResults != nil { 6618 queryParameters["MaxResults"] = autorest.Encode("query", *maxResults) 6619 } else { 6620 queryParameters["MaxResults"] = autorest.Encode("query", 0) 6621 } 6622 if timeout != nil { 6623 queryParameters["timeout"] = autorest.Encode("query", *timeout) 6624 } else { 6625 queryParameters["timeout"] = autorest.Encode("query", 60) 6626 } 6627 6628 preparer := autorest.CreatePreparer( 6629 autorest.AsGet(), 6630 autorest.WithBaseURL(client.BaseURI), 6631 autorest.WithPath("/ComposeDeployments"), 6632 autorest.WithQueryParameters(queryParameters)) 6633 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 6634} 6635 6636// GetComposeDeploymentStatusListSender sends the GetComposeDeploymentStatusList request. The method will close the 6637// http.Response Body if it receives an error. 6638func (client BaseClient) GetComposeDeploymentStatusListSender(req *http.Request) (*http.Response, error) { 6639 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 6640 return autorest.SendWithSender(client, req, sd...) 6641} 6642 6643// GetComposeDeploymentStatusListResponder handles the response to the GetComposeDeploymentStatusList request. The method always 6644// closes the http.Response Body. 6645func (client BaseClient) GetComposeDeploymentStatusListResponder(resp *http.Response) (result PagedComposeDeploymentStatusInfoList, err error) { 6646 err = autorest.Respond( 6647 resp, 6648 client.ByInspecting(), 6649 azure.WithErrorUnlessStatusCode(http.StatusOK), 6650 autorest.ByUnmarshallingJSON(&result), 6651 autorest.ByClosing()) 6652 result.Response = autorest.Response{Response: resp} 6653 return 6654} 6655 6656// GetComposeDeploymentUpgradeProgress returns the information about the state of the compose deployment upgrade along 6657// with details to aid debugging application health issues. 6658// Parameters: 6659// deploymentName - the identity of the deployment. 6660// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 6661// duration that the client is willing to wait for the requested operation to complete. The default value for 6662// this parameter is 60 seconds. 6663func (client BaseClient) GetComposeDeploymentUpgradeProgress(ctx context.Context, deploymentName string, timeout *int64) (result ComposeDeploymentUpgradeProgressInfo, err error) { 6664 if tracing.IsEnabled() { 6665 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetComposeDeploymentUpgradeProgress") 6666 defer func() { 6667 sc := -1 6668 if result.Response.Response != nil { 6669 sc = result.Response.Response.StatusCode 6670 } 6671 tracing.EndSpan(ctx, sc, err) 6672 }() 6673 } 6674 if err := validation.Validate([]validation.Validation{ 6675 {TargetValue: timeout, 6676 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 6677 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 6678 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 6679 }}}}}); err != nil { 6680 return result, validation.NewError("servicefabric.BaseClient", "GetComposeDeploymentUpgradeProgress", err.Error()) 6681 } 6682 6683 req, err := client.GetComposeDeploymentUpgradeProgressPreparer(ctx, deploymentName, timeout) 6684 if err != nil { 6685 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetComposeDeploymentUpgradeProgress", nil, "Failure preparing request") 6686 return 6687 } 6688 6689 resp, err := client.GetComposeDeploymentUpgradeProgressSender(req) 6690 if err != nil { 6691 result.Response = autorest.Response{Response: resp} 6692 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetComposeDeploymentUpgradeProgress", resp, "Failure sending request") 6693 return 6694 } 6695 6696 result, err = client.GetComposeDeploymentUpgradeProgressResponder(resp) 6697 if err != nil { 6698 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetComposeDeploymentUpgradeProgress", resp, "Failure responding to request") 6699 } 6700 6701 return 6702} 6703 6704// GetComposeDeploymentUpgradeProgressPreparer prepares the GetComposeDeploymentUpgradeProgress request. 6705func (client BaseClient) GetComposeDeploymentUpgradeProgressPreparer(ctx context.Context, deploymentName string, timeout *int64) (*http.Request, error) { 6706 pathParameters := map[string]interface{}{ 6707 "deploymentName": deploymentName, 6708 } 6709 6710 const APIVersion = "6.0-preview" 6711 queryParameters := map[string]interface{}{ 6712 "api-version": APIVersion, 6713 } 6714 if timeout != nil { 6715 queryParameters["timeout"] = autorest.Encode("query", *timeout) 6716 } else { 6717 queryParameters["timeout"] = autorest.Encode("query", 60) 6718 } 6719 6720 preparer := autorest.CreatePreparer( 6721 autorest.AsGet(), 6722 autorest.WithBaseURL(client.BaseURI), 6723 autorest.WithPathParameters("/ComposeDeployments/{deploymentName}/$/GetUpgradeProgress", pathParameters), 6724 autorest.WithQueryParameters(queryParameters)) 6725 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 6726} 6727 6728// GetComposeDeploymentUpgradeProgressSender sends the GetComposeDeploymentUpgradeProgress request. The method will close the 6729// http.Response Body if it receives an error. 6730func (client BaseClient) GetComposeDeploymentUpgradeProgressSender(req *http.Request) (*http.Response, error) { 6731 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 6732 return autorest.SendWithSender(client, req, sd...) 6733} 6734 6735// GetComposeDeploymentUpgradeProgressResponder handles the response to the GetComposeDeploymentUpgradeProgress request. The method always 6736// closes the http.Response Body. 6737func (client BaseClient) GetComposeDeploymentUpgradeProgressResponder(resp *http.Response) (result ComposeDeploymentUpgradeProgressInfo, err error) { 6738 err = autorest.Respond( 6739 resp, 6740 client.ByInspecting(), 6741 azure.WithErrorUnlessStatusCode(http.StatusOK), 6742 autorest.ByUnmarshallingJSON(&result), 6743 autorest.ByClosing()) 6744 result.Response = autorest.Response{Response: resp} 6745 return 6746} 6747 6748// GetContainerLogsDeployedOnNode gets the container logs for container deployed on a Service Fabric node for the given 6749// code package. 6750// Parameters: 6751// nodeName - the name of the node. 6752// applicationID - the identity of the application. This is typically the full name of the application without 6753// the 'fabric:' URI scheme. 6754// Starting from version 6.0, hierarchical names are delimited with the "~" character. 6755// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" 6756// in 6.0+ and "myapp/app1" in previous versions. 6757// serviceManifestName - the name of a service manifest registered as part of an application type in a Service 6758// Fabric cluster. 6759// codePackageName - the name of code package specified in service manifest registered as part of an 6760// application type in a Service Fabric cluster. 6761// tail - number of lines to show from the end of the logs. Default is 100. 'all' to show the complete logs. 6762// previous - specifies whether to get container logs from exited/dead containers of the code package instance. 6763// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 6764// duration that the client is willing to wait for the requested operation to complete. The default value for 6765// this parameter is 60 seconds. 6766func (client BaseClient) GetContainerLogsDeployedOnNode(ctx context.Context, nodeName string, applicationID string, serviceManifestName string, codePackageName string, tail string, previous *bool, timeout *int64) (result ContainerLogs, err error) { 6767 if tracing.IsEnabled() { 6768 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetContainerLogsDeployedOnNode") 6769 defer func() { 6770 sc := -1 6771 if result.Response.Response != nil { 6772 sc = result.Response.Response.StatusCode 6773 } 6774 tracing.EndSpan(ctx, sc, err) 6775 }() 6776 } 6777 if err := validation.Validate([]validation.Validation{ 6778 {TargetValue: timeout, 6779 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 6780 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 6781 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 6782 }}}}}); err != nil { 6783 return result, validation.NewError("servicefabric.BaseClient", "GetContainerLogsDeployedOnNode", err.Error()) 6784 } 6785 6786 req, err := client.GetContainerLogsDeployedOnNodePreparer(ctx, nodeName, applicationID, serviceManifestName, codePackageName, tail, previous, timeout) 6787 if err != nil { 6788 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetContainerLogsDeployedOnNode", nil, "Failure preparing request") 6789 return 6790 } 6791 6792 resp, err := client.GetContainerLogsDeployedOnNodeSender(req) 6793 if err != nil { 6794 result.Response = autorest.Response{Response: resp} 6795 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetContainerLogsDeployedOnNode", resp, "Failure sending request") 6796 return 6797 } 6798 6799 result, err = client.GetContainerLogsDeployedOnNodeResponder(resp) 6800 if err != nil { 6801 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetContainerLogsDeployedOnNode", resp, "Failure responding to request") 6802 } 6803 6804 return 6805} 6806 6807// GetContainerLogsDeployedOnNodePreparer prepares the GetContainerLogsDeployedOnNode request. 6808func (client BaseClient) GetContainerLogsDeployedOnNodePreparer(ctx context.Context, nodeName string, applicationID string, serviceManifestName string, codePackageName string, tail string, previous *bool, timeout *int64) (*http.Request, error) { 6809 pathParameters := map[string]interface{}{ 6810 "applicationId": applicationID, 6811 "nodeName": autorest.Encode("path", nodeName), 6812 } 6813 6814 const APIVersion = "6.2" 6815 queryParameters := map[string]interface{}{ 6816 "api-version": APIVersion, 6817 "CodePackageName": autorest.Encode("query", codePackageName), 6818 "ServiceManifestName": autorest.Encode("query", serviceManifestName), 6819 } 6820 if len(tail) > 0 { 6821 queryParameters["Tail"] = autorest.Encode("query", tail) 6822 } 6823 if previous != nil { 6824 queryParameters["Previous"] = autorest.Encode("query", *previous) 6825 } else { 6826 queryParameters["Previous"] = autorest.Encode("query", false) 6827 } 6828 if timeout != nil { 6829 queryParameters["timeout"] = autorest.Encode("query", *timeout) 6830 } else { 6831 queryParameters["timeout"] = autorest.Encode("query", 60) 6832 } 6833 6834 preparer := autorest.CreatePreparer( 6835 autorest.AsGet(), 6836 autorest.WithBaseURL(client.BaseURI), 6837 autorest.WithPathParameters("/Nodes/{nodeName}/$/GetApplications/{applicationId}/$/GetCodePackages/$/ContainerLogs", pathParameters), 6838 autorest.WithQueryParameters(queryParameters)) 6839 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 6840} 6841 6842// GetContainerLogsDeployedOnNodeSender sends the GetContainerLogsDeployedOnNode request. The method will close the 6843// http.Response Body if it receives an error. 6844func (client BaseClient) GetContainerLogsDeployedOnNodeSender(req *http.Request) (*http.Response, error) { 6845 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 6846 return autorest.SendWithSender(client, req, sd...) 6847} 6848 6849// GetContainerLogsDeployedOnNodeResponder handles the response to the GetContainerLogsDeployedOnNode request. The method always 6850// closes the http.Response Body. 6851func (client BaseClient) GetContainerLogsDeployedOnNodeResponder(resp *http.Response) (result ContainerLogs, err error) { 6852 err = autorest.Respond( 6853 resp, 6854 client.ByInspecting(), 6855 azure.WithErrorUnlessStatusCode(http.StatusOK), 6856 autorest.ByUnmarshallingJSON(&result), 6857 autorest.ByClosing()) 6858 result.Response = autorest.Response{Response: resp} 6859 return 6860} 6861 6862// GetContainersEventList the response is list of ContainerInstanceEvent objects. 6863// Parameters: 6864// startTimeUtc - the start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. 6865// endTimeUtc - the end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. 6866// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 6867// duration that the client is willing to wait for the requested operation to complete. The default value for 6868// this parameter is 60 seconds. 6869// eventsTypesFilter - this is a comma separated string specifying the types of FabricEvents that should only 6870// be included in the response. 6871// excludeAnalysisEvents - this param disables the retrieval of AnalysisEvents if true is passed. 6872// skipCorrelationLookup - this param disables the search of CorrelatedEvents information if true is passed. 6873// otherwise the CorrelationEvents get processed and HasCorrelatedEvents field in every FabricEvent gets 6874// populated. 6875func (client BaseClient) GetContainersEventList(ctx context.Context, startTimeUtc string, endTimeUtc string, timeout *int64, eventsTypesFilter string, excludeAnalysisEvents *bool, skipCorrelationLookup *bool) (result ListContainerInstanceEvent, err error) { 6876 if tracing.IsEnabled() { 6877 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetContainersEventList") 6878 defer func() { 6879 sc := -1 6880 if result.Response.Response != nil { 6881 sc = result.Response.Response.StatusCode 6882 } 6883 tracing.EndSpan(ctx, sc, err) 6884 }() 6885 } 6886 if err := validation.Validate([]validation.Validation{ 6887 {TargetValue: timeout, 6888 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 6889 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 6890 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 6891 }}}}}); err != nil { 6892 return result, validation.NewError("servicefabric.BaseClient", "GetContainersEventList", err.Error()) 6893 } 6894 6895 req, err := client.GetContainersEventListPreparer(ctx, startTimeUtc, endTimeUtc, timeout, eventsTypesFilter, excludeAnalysisEvents, skipCorrelationLookup) 6896 if err != nil { 6897 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetContainersEventList", nil, "Failure preparing request") 6898 return 6899 } 6900 6901 resp, err := client.GetContainersEventListSender(req) 6902 if err != nil { 6903 result.Response = autorest.Response{Response: resp} 6904 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetContainersEventList", resp, "Failure sending request") 6905 return 6906 } 6907 6908 result, err = client.GetContainersEventListResponder(resp) 6909 if err != nil { 6910 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetContainersEventList", resp, "Failure responding to request") 6911 } 6912 6913 return 6914} 6915 6916// GetContainersEventListPreparer prepares the GetContainersEventList request. 6917func (client BaseClient) GetContainersEventListPreparer(ctx context.Context, startTimeUtc string, endTimeUtc string, timeout *int64, eventsTypesFilter string, excludeAnalysisEvents *bool, skipCorrelationLookup *bool) (*http.Request, error) { 6918 const APIVersion = "6.2-preview" 6919 queryParameters := map[string]interface{}{ 6920 "api-version": APIVersion, 6921 "EndTimeUtc": autorest.Encode("query", endTimeUtc), 6922 "StartTimeUtc": autorest.Encode("query", startTimeUtc), 6923 } 6924 if timeout != nil { 6925 queryParameters["timeout"] = autorest.Encode("query", *timeout) 6926 } else { 6927 queryParameters["timeout"] = autorest.Encode("query", 60) 6928 } 6929 if len(eventsTypesFilter) > 0 { 6930 queryParameters["EventsTypesFilter"] = autorest.Encode("query", eventsTypesFilter) 6931 } 6932 if excludeAnalysisEvents != nil { 6933 queryParameters["ExcludeAnalysisEvents"] = autorest.Encode("query", *excludeAnalysisEvents) 6934 } 6935 if skipCorrelationLookup != nil { 6936 queryParameters["SkipCorrelationLookup"] = autorest.Encode("query", *skipCorrelationLookup) 6937 } 6938 6939 preparer := autorest.CreatePreparer( 6940 autorest.AsGet(), 6941 autorest.WithBaseURL(client.BaseURI), 6942 autorest.WithPath("/EventsStore/Containers/Events"), 6943 autorest.WithQueryParameters(queryParameters)) 6944 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 6945} 6946 6947// GetContainersEventListSender sends the GetContainersEventList request. The method will close the 6948// http.Response Body if it receives an error. 6949func (client BaseClient) GetContainersEventListSender(req *http.Request) (*http.Response, error) { 6950 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 6951 return autorest.SendWithSender(client, req, sd...) 6952} 6953 6954// GetContainersEventListResponder handles the response to the GetContainersEventList request. The method always 6955// closes the http.Response Body. 6956func (client BaseClient) GetContainersEventListResponder(resp *http.Response) (result ListContainerInstanceEvent, err error) { 6957 err = autorest.Respond( 6958 resp, 6959 client.ByInspecting(), 6960 azure.WithErrorUnlessStatusCode(http.StatusOK), 6961 autorest.ByUnmarshallingJSON(&result.Value), 6962 autorest.ByClosing()) 6963 result.Response = autorest.Response{Response: resp} 6964 return 6965} 6966 6967// GetCorrelatedEventList the response is list of FabricEvents. 6968// Parameters: 6969// eventInstanceID - the EventInstanceId. 6970// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 6971// duration that the client is willing to wait for the requested operation to complete. The default value for 6972// this parameter is 60 seconds. 6973func (client BaseClient) GetCorrelatedEventList(ctx context.Context, eventInstanceID string, timeout *int64) (result ListFabricEvent, err error) { 6974 if tracing.IsEnabled() { 6975 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetCorrelatedEventList") 6976 defer func() { 6977 sc := -1 6978 if result.Response.Response != nil { 6979 sc = result.Response.Response.StatusCode 6980 } 6981 tracing.EndSpan(ctx, sc, err) 6982 }() 6983 } 6984 if err := validation.Validate([]validation.Validation{ 6985 {TargetValue: timeout, 6986 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 6987 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 6988 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 6989 }}}}}); err != nil { 6990 return result, validation.NewError("servicefabric.BaseClient", "GetCorrelatedEventList", err.Error()) 6991 } 6992 6993 req, err := client.GetCorrelatedEventListPreparer(ctx, eventInstanceID, timeout) 6994 if err != nil { 6995 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetCorrelatedEventList", nil, "Failure preparing request") 6996 return 6997 } 6998 6999 resp, err := client.GetCorrelatedEventListSender(req) 7000 if err != nil { 7001 result.Response = autorest.Response{Response: resp} 7002 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetCorrelatedEventList", resp, "Failure sending request") 7003 return 7004 } 7005 7006 result, err = client.GetCorrelatedEventListResponder(resp) 7007 if err != nil { 7008 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetCorrelatedEventList", resp, "Failure responding to request") 7009 } 7010 7011 return 7012} 7013 7014// GetCorrelatedEventListPreparer prepares the GetCorrelatedEventList request. 7015func (client BaseClient) GetCorrelatedEventListPreparer(ctx context.Context, eventInstanceID string, timeout *int64) (*http.Request, error) { 7016 pathParameters := map[string]interface{}{ 7017 "eventInstanceId": autorest.Encode("path", eventInstanceID), 7018 } 7019 7020 const APIVersion = "6.2-preview" 7021 queryParameters := map[string]interface{}{ 7022 "api-version": APIVersion, 7023 } 7024 if timeout != nil { 7025 queryParameters["timeout"] = autorest.Encode("query", *timeout) 7026 } else { 7027 queryParameters["timeout"] = autorest.Encode("query", 60) 7028 } 7029 7030 preparer := autorest.CreatePreparer( 7031 autorest.AsGet(), 7032 autorest.WithBaseURL(client.BaseURI), 7033 autorest.WithPathParameters("/EventsStore/CorrelatedEvents/{eventInstanceId}/$/Events", pathParameters), 7034 autorest.WithQueryParameters(queryParameters)) 7035 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 7036} 7037 7038// GetCorrelatedEventListSender sends the GetCorrelatedEventList request. The method will close the 7039// http.Response Body if it receives an error. 7040func (client BaseClient) GetCorrelatedEventListSender(req *http.Request) (*http.Response, error) { 7041 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 7042 return autorest.SendWithSender(client, req, sd...) 7043} 7044 7045// GetCorrelatedEventListResponder handles the response to the GetCorrelatedEventList request. The method always 7046// closes the http.Response Body. 7047func (client BaseClient) GetCorrelatedEventListResponder(resp *http.Response) (result ListFabricEvent, err error) { 7048 err = autorest.Respond( 7049 resp, 7050 client.ByInspecting(), 7051 azure.WithErrorUnlessStatusCode(http.StatusOK), 7052 autorest.ByUnmarshallingJSON(&result), 7053 autorest.ByClosing()) 7054 result.Response = autorest.Response{Response: resp} 7055 return 7056} 7057 7058// GetDataLossProgress gets the progress of a data loss operation started with StartDataLoss, using the OperationId. 7059// Parameters: 7060// serviceID - the identity of the service. This is typically the full name of the service without the 7061// 'fabric:' URI scheme. 7062// Starting from version 6.0, hierarchical names are delimited with the "~" character. 7063// For example, if the service name is "fabric:/myapp/app1/svc1", the service identity would be 7064// "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in previous versions. 7065// partitionID - the identity of the partition. 7066// operationID - a GUID that identifies a call of this API. This is passed into the corresponding GetProgress 7067// API 7068// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 7069// duration that the client is willing to wait for the requested operation to complete. The default value for 7070// this parameter is 60 seconds. 7071func (client BaseClient) GetDataLossProgress(ctx context.Context, serviceID string, partitionID uuid.UUID, operationID uuid.UUID, timeout *int64) (result PartitionDataLossProgress, err error) { 7072 if tracing.IsEnabled() { 7073 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetDataLossProgress") 7074 defer func() { 7075 sc := -1 7076 if result.Response.Response != nil { 7077 sc = result.Response.Response.StatusCode 7078 } 7079 tracing.EndSpan(ctx, sc, err) 7080 }() 7081 } 7082 if err := validation.Validate([]validation.Validation{ 7083 {TargetValue: timeout, 7084 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 7085 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 7086 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 7087 }}}}}); err != nil { 7088 return result, validation.NewError("servicefabric.BaseClient", "GetDataLossProgress", err.Error()) 7089 } 7090 7091 req, err := client.GetDataLossProgressPreparer(ctx, serviceID, partitionID, operationID, timeout) 7092 if err != nil { 7093 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDataLossProgress", nil, "Failure preparing request") 7094 return 7095 } 7096 7097 resp, err := client.GetDataLossProgressSender(req) 7098 if err != nil { 7099 result.Response = autorest.Response{Response: resp} 7100 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDataLossProgress", resp, "Failure sending request") 7101 return 7102 } 7103 7104 result, err = client.GetDataLossProgressResponder(resp) 7105 if err != nil { 7106 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDataLossProgress", resp, "Failure responding to request") 7107 } 7108 7109 return 7110} 7111 7112// GetDataLossProgressPreparer prepares the GetDataLossProgress request. 7113func (client BaseClient) GetDataLossProgressPreparer(ctx context.Context, serviceID string, partitionID uuid.UUID, operationID uuid.UUID, timeout *int64) (*http.Request, error) { 7114 pathParameters := map[string]interface{}{ 7115 "partitionId": partitionID, 7116 "serviceId": serviceID, 7117 } 7118 7119 const APIVersion = "6.0" 7120 queryParameters := map[string]interface{}{ 7121 "api-version": APIVersion, 7122 "OperationId": autorest.Encode("query", operationID), 7123 } 7124 if timeout != nil { 7125 queryParameters["timeout"] = autorest.Encode("query", *timeout) 7126 } else { 7127 queryParameters["timeout"] = autorest.Encode("query", 60) 7128 } 7129 7130 preparer := autorest.CreatePreparer( 7131 autorest.AsGet(), 7132 autorest.WithBaseURL(client.BaseURI), 7133 autorest.WithPathParameters("/Faults/Services/{serviceId}/$/GetPartitions/{partitionId}/$/GetDataLossProgress", pathParameters), 7134 autorest.WithQueryParameters(queryParameters)) 7135 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 7136} 7137 7138// GetDataLossProgressSender sends the GetDataLossProgress request. The method will close the 7139// http.Response Body if it receives an error. 7140func (client BaseClient) GetDataLossProgressSender(req *http.Request) (*http.Response, error) { 7141 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 7142 return autorest.SendWithSender(client, req, sd...) 7143} 7144 7145// GetDataLossProgressResponder handles the response to the GetDataLossProgress request. The method always 7146// closes the http.Response Body. 7147func (client BaseClient) GetDataLossProgressResponder(resp *http.Response) (result PartitionDataLossProgress, err error) { 7148 err = autorest.Respond( 7149 resp, 7150 client.ByInspecting(), 7151 azure.WithErrorUnlessStatusCode(http.StatusOK), 7152 autorest.ByUnmarshallingJSON(&result), 7153 autorest.ByClosing()) 7154 result.Response = autorest.Response{Response: resp} 7155 return 7156} 7157 7158// GetDeployedApplicationHealth gets the information about health of an application deployed on a Service Fabric node. 7159// Use EventsHealthStateFilter to optionally filter for the collection of HealthEvent objects reported on the deployed 7160// application based on health state. Use DeployedServicePackagesHealthStateFilter to optionally filter for 7161// DeployedServicePackageHealth children based on health state. 7162// Parameters: 7163// nodeName - the name of the node. 7164// applicationID - the identity of the application. This is typically the full name of the application without 7165// the 'fabric:' URI scheme. 7166// Starting from version 6.0, hierarchical names are delimited with the "~" character. 7167// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" 7168// in 6.0+ and "myapp/app1" in previous versions. 7169// eventsHealthStateFilter - allows filtering the collection of HealthEvent objects returned based on health 7170// state. 7171// The possible values for this parameter include integer value of one of the following health states. 7172// Only events that match the filter are returned. All events are used to evaluate the aggregated health state. 7173// If not specified, all entries are returned. The state values are flag based enumeration, so the value could 7174// be a combination of these value obtained using bitwise 'OR' operator. For example, If the provided value is 7175// 6 then all of the events with HealthState value of OK (2) and Warning (4) are returned. 7176// 7177// - Default - Default value. Matches any HealthState. The value is zero. 7178// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given 7179// collection of states. The value is 1. 7180// - Ok - Filter that matches input with HealthState value Ok. The value is 2. 7181// - Warning - Filter that matches input with HealthState value Warning. The value is 4. 7182// - Error - Filter that matches input with HealthState value Error. The value is 8. 7183// - All - Filter that matches input with any HealthState value. The value is 65535. 7184// deployedServicePackagesHealthStateFilter - allows filtering of the deployed service package health state 7185// objects returned in the result of deployed application health query based on their health state. 7186// The possible values for this parameter include integer value of one of the following health states. 7187// Only deployed service packages that match the filter are returned. All deployed service packages are used to 7188// evaluate the aggregated health state of the deployed application. 7189// If not specified, all entries are returned. 7190// The state values are flag based enumeration, so the value can be a combination of these value obtained using 7191// bitwise 'OR' operator. 7192// For example, if the provided value is 6 then health state of service packages with HealthState value of OK 7193// (2) and Warning (4) are returned. 7194// 7195// - Default - Default value. Matches any HealthState. The value is zero. 7196// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given 7197// collection of states. The value is 1. 7198// - Ok - Filter that matches input with HealthState value Ok. The value is 2. 7199// - Warning - Filter that matches input with HealthState value Warning. The value is 4. 7200// - Error - Filter that matches input with HealthState value Error. The value is 8. 7201// - All - Filter that matches input with any HealthState value. The value is 65535. 7202// excludeHealthStatistics - indicates whether the health statistics should be returned as part of the query 7203// result. False by default. 7204// The statistics show the number of children entities in health state Ok, Warning, and Error. 7205// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 7206// duration that the client is willing to wait for the requested operation to complete. The default value for 7207// this parameter is 60 seconds. 7208func (client BaseClient) GetDeployedApplicationHealth(ctx context.Context, nodeName string, applicationID string, eventsHealthStateFilter *int32, deployedServicePackagesHealthStateFilter *int32, excludeHealthStatistics *bool, timeout *int64) (result DeployedApplicationHealth, err error) { 7209 if tracing.IsEnabled() { 7210 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetDeployedApplicationHealth") 7211 defer func() { 7212 sc := -1 7213 if result.Response.Response != nil { 7214 sc = result.Response.Response.StatusCode 7215 } 7216 tracing.EndSpan(ctx, sc, err) 7217 }() 7218 } 7219 if err := validation.Validate([]validation.Validation{ 7220 {TargetValue: timeout, 7221 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 7222 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 7223 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 7224 }}}}}); err != nil { 7225 return result, validation.NewError("servicefabric.BaseClient", "GetDeployedApplicationHealth", err.Error()) 7226 } 7227 7228 req, err := client.GetDeployedApplicationHealthPreparer(ctx, nodeName, applicationID, eventsHealthStateFilter, deployedServicePackagesHealthStateFilter, excludeHealthStatistics, timeout) 7229 if err != nil { 7230 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedApplicationHealth", nil, "Failure preparing request") 7231 return 7232 } 7233 7234 resp, err := client.GetDeployedApplicationHealthSender(req) 7235 if err != nil { 7236 result.Response = autorest.Response{Response: resp} 7237 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedApplicationHealth", resp, "Failure sending request") 7238 return 7239 } 7240 7241 result, err = client.GetDeployedApplicationHealthResponder(resp) 7242 if err != nil { 7243 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedApplicationHealth", resp, "Failure responding to request") 7244 } 7245 7246 return 7247} 7248 7249// GetDeployedApplicationHealthPreparer prepares the GetDeployedApplicationHealth request. 7250func (client BaseClient) GetDeployedApplicationHealthPreparer(ctx context.Context, nodeName string, applicationID string, eventsHealthStateFilter *int32, deployedServicePackagesHealthStateFilter *int32, excludeHealthStatistics *bool, timeout *int64) (*http.Request, error) { 7251 pathParameters := map[string]interface{}{ 7252 "applicationId": applicationID, 7253 "nodeName": autorest.Encode("path", nodeName), 7254 } 7255 7256 const APIVersion = "6.0" 7257 queryParameters := map[string]interface{}{ 7258 "api-version": APIVersion, 7259 } 7260 if eventsHealthStateFilter != nil { 7261 queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", *eventsHealthStateFilter) 7262 } else { 7263 queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", 0) 7264 } 7265 if deployedServicePackagesHealthStateFilter != nil { 7266 queryParameters["DeployedServicePackagesHealthStateFilter"] = autorest.Encode("query", *deployedServicePackagesHealthStateFilter) 7267 } else { 7268 queryParameters["DeployedServicePackagesHealthStateFilter"] = autorest.Encode("query", 0) 7269 } 7270 if excludeHealthStatistics != nil { 7271 queryParameters["ExcludeHealthStatistics"] = autorest.Encode("query", *excludeHealthStatistics) 7272 } else { 7273 queryParameters["ExcludeHealthStatistics"] = autorest.Encode("query", false) 7274 } 7275 if timeout != nil { 7276 queryParameters["timeout"] = autorest.Encode("query", *timeout) 7277 } else { 7278 queryParameters["timeout"] = autorest.Encode("query", 60) 7279 } 7280 7281 preparer := autorest.CreatePreparer( 7282 autorest.AsGet(), 7283 autorest.WithBaseURL(client.BaseURI), 7284 autorest.WithPathParameters("/Nodes/{nodeName}/$/GetApplications/{applicationId}/$/GetHealth", pathParameters), 7285 autorest.WithQueryParameters(queryParameters)) 7286 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 7287} 7288 7289// GetDeployedApplicationHealthSender sends the GetDeployedApplicationHealth request. The method will close the 7290// http.Response Body if it receives an error. 7291func (client BaseClient) GetDeployedApplicationHealthSender(req *http.Request) (*http.Response, error) { 7292 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 7293 return autorest.SendWithSender(client, req, sd...) 7294} 7295 7296// GetDeployedApplicationHealthResponder handles the response to the GetDeployedApplicationHealth request. The method always 7297// closes the http.Response Body. 7298func (client BaseClient) GetDeployedApplicationHealthResponder(resp *http.Response) (result DeployedApplicationHealth, err error) { 7299 err = autorest.Respond( 7300 resp, 7301 client.ByInspecting(), 7302 azure.WithErrorUnlessStatusCode(http.StatusOK), 7303 autorest.ByUnmarshallingJSON(&result), 7304 autorest.ByClosing()) 7305 result.Response = autorest.Response{Response: resp} 7306 return 7307} 7308 7309// GetDeployedApplicationHealthUsingPolicy gets the information about health of an application deployed on a Service 7310// Fabric node using the specified policy. Use EventsHealthStateFilter to optionally filter for the collection of 7311// HealthEvent objects reported on the deployed application based on health state. Use 7312// DeployedServicePackagesHealthStateFilter to optionally filter for DeployedServicePackageHealth children based on 7313// health state. Use ApplicationHealthPolicy to optionally override the health policies used to evaluate the health. 7314// This API only uses 'ConsiderWarningAsError' field of the ApplicationHealthPolicy. The rest of the fields are ignored 7315// while evaluating the health of the deployed application. 7316// Parameters: 7317// nodeName - the name of the node. 7318// applicationID - the identity of the application. This is typically the full name of the application without 7319// the 'fabric:' URI scheme. 7320// Starting from version 6.0, hierarchical names are delimited with the "~" character. 7321// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" 7322// in 6.0+ and "myapp/app1" in previous versions. 7323// eventsHealthStateFilter - allows filtering the collection of HealthEvent objects returned based on health 7324// state. 7325// The possible values for this parameter include integer value of one of the following health states. 7326// Only events that match the filter are returned. All events are used to evaluate the aggregated health state. 7327// If not specified, all entries are returned. The state values are flag based enumeration, so the value could 7328// be a combination of these value obtained using bitwise 'OR' operator. For example, If the provided value is 7329// 6 then all of the events with HealthState value of OK (2) and Warning (4) are returned. 7330// 7331// - Default - Default value. Matches any HealthState. The value is zero. 7332// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given 7333// collection of states. The value is 1. 7334// - Ok - Filter that matches input with HealthState value Ok. The value is 2. 7335// - Warning - Filter that matches input with HealthState value Warning. The value is 4. 7336// - Error - Filter that matches input with HealthState value Error. The value is 8. 7337// - All - Filter that matches input with any HealthState value. The value is 65535. 7338// deployedServicePackagesHealthStateFilter - allows filtering of the deployed service package health state 7339// objects returned in the result of deployed application health query based on their health state. 7340// The possible values for this parameter include integer value of one of the following health states. 7341// Only deployed service packages that match the filter are returned. All deployed service packages are used to 7342// evaluate the aggregated health state of the deployed application. 7343// If not specified, all entries are returned. 7344// The state values are flag based enumeration, so the value can be a combination of these value obtained using 7345// bitwise 'OR' operator. 7346// For example, if the provided value is 6 then health state of service packages with HealthState value of OK 7347// (2) and Warning (4) are returned. 7348// 7349// - Default - Default value. Matches any HealthState. The value is zero. 7350// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given 7351// collection of states. The value is 1. 7352// - Ok - Filter that matches input with HealthState value Ok. The value is 2. 7353// - Warning - Filter that matches input with HealthState value Warning. The value is 4. 7354// - Error - Filter that matches input with HealthState value Error. The value is 8. 7355// - All - Filter that matches input with any HealthState value. The value is 65535. 7356// applicationHealthPolicy - describes the health policies used to evaluate the health of an application or one 7357// of its children. 7358// If not present, the health evaluation uses the health policy from application manifest or the default health 7359// policy. 7360// excludeHealthStatistics - indicates whether the health statistics should be returned as part of the query 7361// result. False by default. 7362// The statistics show the number of children entities in health state Ok, Warning, and Error. 7363// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 7364// duration that the client is willing to wait for the requested operation to complete. The default value for 7365// this parameter is 60 seconds. 7366func (client BaseClient) GetDeployedApplicationHealthUsingPolicy(ctx context.Context, nodeName string, applicationID string, eventsHealthStateFilter *int32, deployedServicePackagesHealthStateFilter *int32, applicationHealthPolicy *ApplicationHealthPolicy, excludeHealthStatistics *bool, timeout *int64) (result DeployedApplicationHealth, err error) { 7367 if tracing.IsEnabled() { 7368 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetDeployedApplicationHealthUsingPolicy") 7369 defer func() { 7370 sc := -1 7371 if result.Response.Response != nil { 7372 sc = result.Response.Response.StatusCode 7373 } 7374 tracing.EndSpan(ctx, sc, err) 7375 }() 7376 } 7377 if err := validation.Validate([]validation.Validation{ 7378 {TargetValue: timeout, 7379 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 7380 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 7381 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 7382 }}}}}); err != nil { 7383 return result, validation.NewError("servicefabric.BaseClient", "GetDeployedApplicationHealthUsingPolicy", err.Error()) 7384 } 7385 7386 req, err := client.GetDeployedApplicationHealthUsingPolicyPreparer(ctx, nodeName, applicationID, eventsHealthStateFilter, deployedServicePackagesHealthStateFilter, applicationHealthPolicy, excludeHealthStatistics, timeout) 7387 if err != nil { 7388 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedApplicationHealthUsingPolicy", nil, "Failure preparing request") 7389 return 7390 } 7391 7392 resp, err := client.GetDeployedApplicationHealthUsingPolicySender(req) 7393 if err != nil { 7394 result.Response = autorest.Response{Response: resp} 7395 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedApplicationHealthUsingPolicy", resp, "Failure sending request") 7396 return 7397 } 7398 7399 result, err = client.GetDeployedApplicationHealthUsingPolicyResponder(resp) 7400 if err != nil { 7401 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedApplicationHealthUsingPolicy", resp, "Failure responding to request") 7402 } 7403 7404 return 7405} 7406 7407// GetDeployedApplicationHealthUsingPolicyPreparer prepares the GetDeployedApplicationHealthUsingPolicy request. 7408func (client BaseClient) GetDeployedApplicationHealthUsingPolicyPreparer(ctx context.Context, nodeName string, applicationID string, eventsHealthStateFilter *int32, deployedServicePackagesHealthStateFilter *int32, applicationHealthPolicy *ApplicationHealthPolicy, excludeHealthStatistics *bool, timeout *int64) (*http.Request, error) { 7409 pathParameters := map[string]interface{}{ 7410 "applicationId": applicationID, 7411 "nodeName": autorest.Encode("path", nodeName), 7412 } 7413 7414 const APIVersion = "6.0" 7415 queryParameters := map[string]interface{}{ 7416 "api-version": APIVersion, 7417 } 7418 if eventsHealthStateFilter != nil { 7419 queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", *eventsHealthStateFilter) 7420 } else { 7421 queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", 0) 7422 } 7423 if deployedServicePackagesHealthStateFilter != nil { 7424 queryParameters["DeployedServicePackagesHealthStateFilter"] = autorest.Encode("query", *deployedServicePackagesHealthStateFilter) 7425 } else { 7426 queryParameters["DeployedServicePackagesHealthStateFilter"] = autorest.Encode("query", 0) 7427 } 7428 if excludeHealthStatistics != nil { 7429 queryParameters["ExcludeHealthStatistics"] = autorest.Encode("query", *excludeHealthStatistics) 7430 } else { 7431 queryParameters["ExcludeHealthStatistics"] = autorest.Encode("query", false) 7432 } 7433 if timeout != nil { 7434 queryParameters["timeout"] = autorest.Encode("query", *timeout) 7435 } else { 7436 queryParameters["timeout"] = autorest.Encode("query", 60) 7437 } 7438 7439 preparer := autorest.CreatePreparer( 7440 autorest.AsContentType("application/json; charset=utf-8"), 7441 autorest.AsPost(), 7442 autorest.WithBaseURL(client.BaseURI), 7443 autorest.WithPathParameters("/Nodes/{nodeName}/$/GetApplications/{applicationId}/$/GetHealth", pathParameters), 7444 autorest.WithQueryParameters(queryParameters)) 7445 if applicationHealthPolicy != nil { 7446 preparer = autorest.DecoratePreparer(preparer, 7447 autorest.WithJSON(applicationHealthPolicy)) 7448 } 7449 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 7450} 7451 7452// GetDeployedApplicationHealthUsingPolicySender sends the GetDeployedApplicationHealthUsingPolicy request. The method will close the 7453// http.Response Body if it receives an error. 7454func (client BaseClient) GetDeployedApplicationHealthUsingPolicySender(req *http.Request) (*http.Response, error) { 7455 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 7456 return autorest.SendWithSender(client, req, sd...) 7457} 7458 7459// GetDeployedApplicationHealthUsingPolicyResponder handles the response to the GetDeployedApplicationHealthUsingPolicy request. The method always 7460// closes the http.Response Body. 7461func (client BaseClient) GetDeployedApplicationHealthUsingPolicyResponder(resp *http.Response) (result DeployedApplicationHealth, err error) { 7462 err = autorest.Respond( 7463 resp, 7464 client.ByInspecting(), 7465 azure.WithErrorUnlessStatusCode(http.StatusOK), 7466 autorest.ByUnmarshallingJSON(&result), 7467 autorest.ByClosing()) 7468 result.Response = autorest.Response{Response: resp} 7469 return 7470} 7471 7472// GetDeployedApplicationInfo gets the information about an application deployed on a Service Fabric node. This query 7473// returns system application information if the application ID provided is for system application. Results encompass 7474// deployed applications in active, activating, and downloading states. This query requires that the node name 7475// corresponds to a node on the cluster. The query fails if the provided node name does not point to any active Service 7476// Fabric nodes on the cluster. 7477// Parameters: 7478// nodeName - the name of the node. 7479// applicationID - the identity of the application. This is typically the full name of the application without 7480// the 'fabric:' URI scheme. 7481// Starting from version 6.0, hierarchical names are delimited with the "~" character. 7482// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" 7483// in 6.0+ and "myapp/app1" in previous versions. 7484// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 7485// duration that the client is willing to wait for the requested operation to complete. The default value for 7486// this parameter is 60 seconds. 7487// includeHealthState - include the health state of an entity. 7488// If this parameter is false or not specified, then the health state returned is "Unknown". 7489// When set to true, the query goes in parallel to the node and the health system service before the results 7490// are merged. 7491// As a result, the query is more expensive and may take a longer time. 7492func (client BaseClient) GetDeployedApplicationInfo(ctx context.Context, nodeName string, applicationID string, timeout *int64, includeHealthState *bool) (result DeployedApplicationInfo, err error) { 7493 if tracing.IsEnabled() { 7494 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetDeployedApplicationInfo") 7495 defer func() { 7496 sc := -1 7497 if result.Response.Response != nil { 7498 sc = result.Response.Response.StatusCode 7499 } 7500 tracing.EndSpan(ctx, sc, err) 7501 }() 7502 } 7503 if err := validation.Validate([]validation.Validation{ 7504 {TargetValue: timeout, 7505 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 7506 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 7507 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 7508 }}}}}); err != nil { 7509 return result, validation.NewError("servicefabric.BaseClient", "GetDeployedApplicationInfo", err.Error()) 7510 } 7511 7512 req, err := client.GetDeployedApplicationInfoPreparer(ctx, nodeName, applicationID, timeout, includeHealthState) 7513 if err != nil { 7514 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedApplicationInfo", nil, "Failure preparing request") 7515 return 7516 } 7517 7518 resp, err := client.GetDeployedApplicationInfoSender(req) 7519 if err != nil { 7520 result.Response = autorest.Response{Response: resp} 7521 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedApplicationInfo", resp, "Failure sending request") 7522 return 7523 } 7524 7525 result, err = client.GetDeployedApplicationInfoResponder(resp) 7526 if err != nil { 7527 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedApplicationInfo", resp, "Failure responding to request") 7528 } 7529 7530 return 7531} 7532 7533// GetDeployedApplicationInfoPreparer prepares the GetDeployedApplicationInfo request. 7534func (client BaseClient) GetDeployedApplicationInfoPreparer(ctx context.Context, nodeName string, applicationID string, timeout *int64, includeHealthState *bool) (*http.Request, error) { 7535 pathParameters := map[string]interface{}{ 7536 "applicationId": applicationID, 7537 "nodeName": autorest.Encode("path", nodeName), 7538 } 7539 7540 const APIVersion = "6.1" 7541 queryParameters := map[string]interface{}{ 7542 "api-version": APIVersion, 7543 } 7544 if timeout != nil { 7545 queryParameters["timeout"] = autorest.Encode("query", *timeout) 7546 } else { 7547 queryParameters["timeout"] = autorest.Encode("query", 60) 7548 } 7549 if includeHealthState != nil { 7550 queryParameters["IncludeHealthState"] = autorest.Encode("query", *includeHealthState) 7551 } else { 7552 queryParameters["IncludeHealthState"] = autorest.Encode("query", false) 7553 } 7554 7555 preparer := autorest.CreatePreparer( 7556 autorest.AsGet(), 7557 autorest.WithBaseURL(client.BaseURI), 7558 autorest.WithPathParameters("/Nodes/{nodeName}/$/GetApplications/{applicationId}", pathParameters), 7559 autorest.WithQueryParameters(queryParameters)) 7560 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 7561} 7562 7563// GetDeployedApplicationInfoSender sends the GetDeployedApplicationInfo request. The method will close the 7564// http.Response Body if it receives an error. 7565func (client BaseClient) GetDeployedApplicationInfoSender(req *http.Request) (*http.Response, error) { 7566 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 7567 return autorest.SendWithSender(client, req, sd...) 7568} 7569 7570// GetDeployedApplicationInfoResponder handles the response to the GetDeployedApplicationInfo request. The method always 7571// closes the http.Response Body. 7572func (client BaseClient) GetDeployedApplicationInfoResponder(resp *http.Response) (result DeployedApplicationInfo, err error) { 7573 err = autorest.Respond( 7574 resp, 7575 client.ByInspecting(), 7576 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), 7577 autorest.ByUnmarshallingJSON(&result), 7578 autorest.ByClosing()) 7579 result.Response = autorest.Response{Response: resp} 7580 return 7581} 7582 7583// GetDeployedApplicationInfoList gets the list of applications deployed on a Service Fabric node. The results do not 7584// include information about deployed system applications unless explicitly queried for by ID. Results encompass 7585// deployed applications in active, activating, and downloading states. This query requires that the node name 7586// corresponds to a node on the cluster. The query fails if the provided node name does not point to any active Service 7587// Fabric nodes on the cluster. 7588// Parameters: 7589// nodeName - the name of the node. 7590// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 7591// duration that the client is willing to wait for the requested operation to complete. The default value for 7592// this parameter is 60 seconds. 7593// includeHealthState - include the health state of an entity. 7594// If this parameter is false or not specified, then the health state returned is "Unknown". 7595// When set to true, the query goes in parallel to the node and the health system service before the results 7596// are merged. 7597// As a result, the query is more expensive and may take a longer time. 7598// continuationToken - the continuation token parameter is used to obtain next set of results. A continuation 7599// token with a non empty value is included in the response of the API when the results from the system do not 7600// fit in a single response. When this value is passed to the next API call, the API returns next set of 7601// results. If there are no further results then the continuation token does not contain a value. The value of 7602// this parameter should not be URL encoded. 7603// maxResults - the maximum number of results to be returned as part of the paged queries. This parameter 7604// defines the upper bound on the number of results returned. The results returned can be less than the 7605// specified maximum results if they do not fit in the message as per the max message size restrictions defined 7606// in the configuration. If this parameter is zero or not specified, the paged queries includes as many results 7607// as possible that fit in the return message. 7608func (client BaseClient) GetDeployedApplicationInfoList(ctx context.Context, nodeName string, timeout *int64, includeHealthState *bool, continuationToken string, maxResults *int64) (result PagedDeployedApplicationInfoList, err error) { 7609 if tracing.IsEnabled() { 7610 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetDeployedApplicationInfoList") 7611 defer func() { 7612 sc := -1 7613 if result.Response.Response != nil { 7614 sc = result.Response.Response.StatusCode 7615 } 7616 tracing.EndSpan(ctx, sc, err) 7617 }() 7618 } 7619 if err := validation.Validate([]validation.Validation{ 7620 {TargetValue: timeout, 7621 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 7622 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 7623 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 7624 }}}}, 7625 {TargetValue: maxResults, 7626 Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false, 7627 Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}}); err != nil { 7628 return result, validation.NewError("servicefabric.BaseClient", "GetDeployedApplicationInfoList", err.Error()) 7629 } 7630 7631 req, err := client.GetDeployedApplicationInfoListPreparer(ctx, nodeName, timeout, includeHealthState, continuationToken, maxResults) 7632 if err != nil { 7633 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedApplicationInfoList", nil, "Failure preparing request") 7634 return 7635 } 7636 7637 resp, err := client.GetDeployedApplicationInfoListSender(req) 7638 if err != nil { 7639 result.Response = autorest.Response{Response: resp} 7640 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedApplicationInfoList", resp, "Failure sending request") 7641 return 7642 } 7643 7644 result, err = client.GetDeployedApplicationInfoListResponder(resp) 7645 if err != nil { 7646 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedApplicationInfoList", resp, "Failure responding to request") 7647 } 7648 7649 return 7650} 7651 7652// GetDeployedApplicationInfoListPreparer prepares the GetDeployedApplicationInfoList request. 7653func (client BaseClient) GetDeployedApplicationInfoListPreparer(ctx context.Context, nodeName string, timeout *int64, includeHealthState *bool, continuationToken string, maxResults *int64) (*http.Request, error) { 7654 pathParameters := map[string]interface{}{ 7655 "nodeName": autorest.Encode("path", nodeName), 7656 } 7657 7658 const APIVersion = "6.1" 7659 queryParameters := map[string]interface{}{ 7660 "api-version": APIVersion, 7661 } 7662 if timeout != nil { 7663 queryParameters["timeout"] = autorest.Encode("query", *timeout) 7664 } else { 7665 queryParameters["timeout"] = autorest.Encode("query", 60) 7666 } 7667 if includeHealthState != nil { 7668 queryParameters["IncludeHealthState"] = autorest.Encode("query", *includeHealthState) 7669 } else { 7670 queryParameters["IncludeHealthState"] = autorest.Encode("query", false) 7671 } 7672 if len(continuationToken) > 0 { 7673 queryParameters["ContinuationToken"] = continuationToken 7674 } 7675 if maxResults != nil { 7676 queryParameters["MaxResults"] = autorest.Encode("query", *maxResults) 7677 } else { 7678 queryParameters["MaxResults"] = autorest.Encode("query", 0) 7679 } 7680 7681 preparer := autorest.CreatePreparer( 7682 autorest.AsGet(), 7683 autorest.WithBaseURL(client.BaseURI), 7684 autorest.WithPathParameters("/Nodes/{nodeName}/$/GetApplications", pathParameters), 7685 autorest.WithQueryParameters(queryParameters)) 7686 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 7687} 7688 7689// GetDeployedApplicationInfoListSender sends the GetDeployedApplicationInfoList request. The method will close the 7690// http.Response Body if it receives an error. 7691func (client BaseClient) GetDeployedApplicationInfoListSender(req *http.Request) (*http.Response, error) { 7692 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 7693 return autorest.SendWithSender(client, req, sd...) 7694} 7695 7696// GetDeployedApplicationInfoListResponder handles the response to the GetDeployedApplicationInfoList request. The method always 7697// closes the http.Response Body. 7698func (client BaseClient) GetDeployedApplicationInfoListResponder(resp *http.Response) (result PagedDeployedApplicationInfoList, err error) { 7699 err = autorest.Respond( 7700 resp, 7701 client.ByInspecting(), 7702 azure.WithErrorUnlessStatusCode(http.StatusOK), 7703 autorest.ByUnmarshallingJSON(&result), 7704 autorest.ByClosing()) 7705 result.Response = autorest.Response{Response: resp} 7706 return 7707} 7708 7709// GetDeployedCodePackageInfoList gets the list of code packages deployed on a Service Fabric node for the given 7710// application. 7711// Parameters: 7712// nodeName - the name of the node. 7713// applicationID - the identity of the application. This is typically the full name of the application without 7714// the 'fabric:' URI scheme. 7715// Starting from version 6.0, hierarchical names are delimited with the "~" character. 7716// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" 7717// in 6.0+ and "myapp/app1" in previous versions. 7718// serviceManifestName - the name of a service manifest registered as part of an application type in a Service 7719// Fabric cluster. 7720// codePackageName - the name of code package specified in service manifest registered as part of an 7721// application type in a Service Fabric cluster. 7722// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 7723// duration that the client is willing to wait for the requested operation to complete. The default value for 7724// this parameter is 60 seconds. 7725func (client BaseClient) GetDeployedCodePackageInfoList(ctx context.Context, nodeName string, applicationID string, serviceManifestName string, codePackageName string, timeout *int64) (result ListDeployedCodePackageInfo, err error) { 7726 if tracing.IsEnabled() { 7727 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetDeployedCodePackageInfoList") 7728 defer func() { 7729 sc := -1 7730 if result.Response.Response != nil { 7731 sc = result.Response.Response.StatusCode 7732 } 7733 tracing.EndSpan(ctx, sc, err) 7734 }() 7735 } 7736 if err := validation.Validate([]validation.Validation{ 7737 {TargetValue: timeout, 7738 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 7739 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 7740 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 7741 }}}}}); err != nil { 7742 return result, validation.NewError("servicefabric.BaseClient", "GetDeployedCodePackageInfoList", err.Error()) 7743 } 7744 7745 req, err := client.GetDeployedCodePackageInfoListPreparer(ctx, nodeName, applicationID, serviceManifestName, codePackageName, timeout) 7746 if err != nil { 7747 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedCodePackageInfoList", nil, "Failure preparing request") 7748 return 7749 } 7750 7751 resp, err := client.GetDeployedCodePackageInfoListSender(req) 7752 if err != nil { 7753 result.Response = autorest.Response{Response: resp} 7754 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedCodePackageInfoList", resp, "Failure sending request") 7755 return 7756 } 7757 7758 result, err = client.GetDeployedCodePackageInfoListResponder(resp) 7759 if err != nil { 7760 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedCodePackageInfoList", resp, "Failure responding to request") 7761 } 7762 7763 return 7764} 7765 7766// GetDeployedCodePackageInfoListPreparer prepares the GetDeployedCodePackageInfoList request. 7767func (client BaseClient) GetDeployedCodePackageInfoListPreparer(ctx context.Context, nodeName string, applicationID string, serviceManifestName string, codePackageName string, timeout *int64) (*http.Request, error) { 7768 pathParameters := map[string]interface{}{ 7769 "applicationId": applicationID, 7770 "nodeName": autorest.Encode("path", nodeName), 7771 } 7772 7773 const APIVersion = "6.0" 7774 queryParameters := map[string]interface{}{ 7775 "api-version": APIVersion, 7776 } 7777 if len(serviceManifestName) > 0 { 7778 queryParameters["ServiceManifestName"] = autorest.Encode("query", serviceManifestName) 7779 } 7780 if len(codePackageName) > 0 { 7781 queryParameters["CodePackageName"] = autorest.Encode("query", codePackageName) 7782 } 7783 if timeout != nil { 7784 queryParameters["timeout"] = autorest.Encode("query", *timeout) 7785 } else { 7786 queryParameters["timeout"] = autorest.Encode("query", 60) 7787 } 7788 7789 preparer := autorest.CreatePreparer( 7790 autorest.AsGet(), 7791 autorest.WithBaseURL(client.BaseURI), 7792 autorest.WithPathParameters("/Nodes/{nodeName}/$/GetApplications/{applicationId}/$/GetCodePackages", pathParameters), 7793 autorest.WithQueryParameters(queryParameters)) 7794 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 7795} 7796 7797// GetDeployedCodePackageInfoListSender sends the GetDeployedCodePackageInfoList request. The method will close the 7798// http.Response Body if it receives an error. 7799func (client BaseClient) GetDeployedCodePackageInfoListSender(req *http.Request) (*http.Response, error) { 7800 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 7801 return autorest.SendWithSender(client, req, sd...) 7802} 7803 7804// GetDeployedCodePackageInfoListResponder handles the response to the GetDeployedCodePackageInfoList request. The method always 7805// closes the http.Response Body. 7806func (client BaseClient) GetDeployedCodePackageInfoListResponder(resp *http.Response) (result ListDeployedCodePackageInfo, err error) { 7807 err = autorest.Respond( 7808 resp, 7809 client.ByInspecting(), 7810 azure.WithErrorUnlessStatusCode(http.StatusOK), 7811 autorest.ByUnmarshallingJSON(&result.Value), 7812 autorest.ByClosing()) 7813 result.Response = autorest.Response{Response: resp} 7814 return 7815} 7816 7817// GetDeployedServicePackageHealth gets the information about health of service package for a specific application 7818// deployed on a Service Fabric node. Use EventsHealthStateFilter to optionally filter for the collection of 7819// HealthEvent objects reported on the deployed service package based on health state. 7820// Parameters: 7821// nodeName - the name of the node. 7822// applicationID - the identity of the application. This is typically the full name of the application without 7823// the 'fabric:' URI scheme. 7824// Starting from version 6.0, hierarchical names are delimited with the "~" character. 7825// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" 7826// in 6.0+ and "myapp/app1" in previous versions. 7827// servicePackageName - the name of the service package. 7828// eventsHealthStateFilter - allows filtering the collection of HealthEvent objects returned based on health 7829// state. 7830// The possible values for this parameter include integer value of one of the following health states. 7831// Only events that match the filter are returned. All events are used to evaluate the aggregated health state. 7832// If not specified, all entries are returned. The state values are flag based enumeration, so the value could 7833// be a combination of these value obtained using bitwise 'OR' operator. For example, If the provided value is 7834// 6 then all of the events with HealthState value of OK (2) and Warning (4) are returned. 7835// 7836// - Default - Default value. Matches any HealthState. The value is zero. 7837// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given 7838// collection of states. The value is 1. 7839// - Ok - Filter that matches input with HealthState value Ok. The value is 2. 7840// - Warning - Filter that matches input with HealthState value Warning. The value is 4. 7841// - Error - Filter that matches input with HealthState value Error. The value is 8. 7842// - All - Filter that matches input with any HealthState value. The value is 65535. 7843// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 7844// duration that the client is willing to wait for the requested operation to complete. The default value for 7845// this parameter is 60 seconds. 7846func (client BaseClient) GetDeployedServicePackageHealth(ctx context.Context, nodeName string, applicationID string, servicePackageName string, eventsHealthStateFilter *int32, timeout *int64) (result DeployedServicePackageHealth, err error) { 7847 if tracing.IsEnabled() { 7848 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetDeployedServicePackageHealth") 7849 defer func() { 7850 sc := -1 7851 if result.Response.Response != nil { 7852 sc = result.Response.Response.StatusCode 7853 } 7854 tracing.EndSpan(ctx, sc, err) 7855 }() 7856 } 7857 if err := validation.Validate([]validation.Validation{ 7858 {TargetValue: timeout, 7859 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 7860 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 7861 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 7862 }}}}}); err != nil { 7863 return result, validation.NewError("servicefabric.BaseClient", "GetDeployedServicePackageHealth", err.Error()) 7864 } 7865 7866 req, err := client.GetDeployedServicePackageHealthPreparer(ctx, nodeName, applicationID, servicePackageName, eventsHealthStateFilter, timeout) 7867 if err != nil { 7868 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServicePackageHealth", nil, "Failure preparing request") 7869 return 7870 } 7871 7872 resp, err := client.GetDeployedServicePackageHealthSender(req) 7873 if err != nil { 7874 result.Response = autorest.Response{Response: resp} 7875 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServicePackageHealth", resp, "Failure sending request") 7876 return 7877 } 7878 7879 result, err = client.GetDeployedServicePackageHealthResponder(resp) 7880 if err != nil { 7881 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServicePackageHealth", resp, "Failure responding to request") 7882 } 7883 7884 return 7885} 7886 7887// GetDeployedServicePackageHealthPreparer prepares the GetDeployedServicePackageHealth request. 7888func (client BaseClient) GetDeployedServicePackageHealthPreparer(ctx context.Context, nodeName string, applicationID string, servicePackageName string, eventsHealthStateFilter *int32, timeout *int64) (*http.Request, error) { 7889 pathParameters := map[string]interface{}{ 7890 "applicationId": applicationID, 7891 "nodeName": autorest.Encode("path", nodeName), 7892 "servicePackageName": servicePackageName, 7893 } 7894 7895 const APIVersion = "6.0" 7896 queryParameters := map[string]interface{}{ 7897 "api-version": APIVersion, 7898 } 7899 if eventsHealthStateFilter != nil { 7900 queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", *eventsHealthStateFilter) 7901 } else { 7902 queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", 0) 7903 } 7904 if timeout != nil { 7905 queryParameters["timeout"] = autorest.Encode("query", *timeout) 7906 } else { 7907 queryParameters["timeout"] = autorest.Encode("query", 60) 7908 } 7909 7910 preparer := autorest.CreatePreparer( 7911 autorest.AsGet(), 7912 autorest.WithBaseURL(client.BaseURI), 7913 autorest.WithPathParameters("/Nodes/{nodeName}/$/GetApplications/{applicationId}/$/GetServicePackages/{servicePackageName}/$/GetHealth", pathParameters), 7914 autorest.WithQueryParameters(queryParameters)) 7915 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 7916} 7917 7918// GetDeployedServicePackageHealthSender sends the GetDeployedServicePackageHealth request. The method will close the 7919// http.Response Body if it receives an error. 7920func (client BaseClient) GetDeployedServicePackageHealthSender(req *http.Request) (*http.Response, error) { 7921 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 7922 return autorest.SendWithSender(client, req, sd...) 7923} 7924 7925// GetDeployedServicePackageHealthResponder handles the response to the GetDeployedServicePackageHealth request. The method always 7926// closes the http.Response Body. 7927func (client BaseClient) GetDeployedServicePackageHealthResponder(resp *http.Response) (result DeployedServicePackageHealth, err error) { 7928 err = autorest.Respond( 7929 resp, 7930 client.ByInspecting(), 7931 azure.WithErrorUnlessStatusCode(http.StatusOK), 7932 autorest.ByUnmarshallingJSON(&result), 7933 autorest.ByClosing()) 7934 result.Response = autorest.Response{Response: resp} 7935 return 7936} 7937 7938// GetDeployedServicePackageHealthUsingPolicy gets the information about health of an service package for a specific 7939// application deployed on a Service Fabric node. using the specified policy. Use EventsHealthStateFilter to optionally 7940// filter for the collection of HealthEvent objects reported on the deployed service package based on health state. Use 7941// ApplicationHealthPolicy to optionally override the health policies used to evaluate the health. This API only uses 7942// 'ConsiderWarningAsError' field of the ApplicationHealthPolicy. The rest of the fields are ignored while evaluating 7943// the health of the deployed service package. 7944// Parameters: 7945// nodeName - the name of the node. 7946// applicationID - the identity of the application. This is typically the full name of the application without 7947// the 'fabric:' URI scheme. 7948// Starting from version 6.0, hierarchical names are delimited with the "~" character. 7949// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" 7950// in 6.0+ and "myapp/app1" in previous versions. 7951// servicePackageName - the name of the service package. 7952// eventsHealthStateFilter - allows filtering the collection of HealthEvent objects returned based on health 7953// state. 7954// The possible values for this parameter include integer value of one of the following health states. 7955// Only events that match the filter are returned. All events are used to evaluate the aggregated health state. 7956// If not specified, all entries are returned. The state values are flag based enumeration, so the value could 7957// be a combination of these value obtained using bitwise 'OR' operator. For example, If the provided value is 7958// 6 then all of the events with HealthState value of OK (2) and Warning (4) are returned. 7959// 7960// - Default - Default value. Matches any HealthState. The value is zero. 7961// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given 7962// collection of states. The value is 1. 7963// - Ok - Filter that matches input with HealthState value Ok. The value is 2. 7964// - Warning - Filter that matches input with HealthState value Warning. The value is 4. 7965// - Error - Filter that matches input with HealthState value Error. The value is 8. 7966// - All - Filter that matches input with any HealthState value. The value is 65535. 7967// applicationHealthPolicy - describes the health policies used to evaluate the health of an application or one 7968// of its children. 7969// If not present, the health evaluation uses the health policy from application manifest or the default health 7970// policy. 7971// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 7972// duration that the client is willing to wait for the requested operation to complete. The default value for 7973// this parameter is 60 seconds. 7974func (client BaseClient) GetDeployedServicePackageHealthUsingPolicy(ctx context.Context, nodeName string, applicationID string, servicePackageName string, eventsHealthStateFilter *int32, applicationHealthPolicy *ApplicationHealthPolicy, timeout *int64) (result DeployedServicePackageHealth, err error) { 7975 if tracing.IsEnabled() { 7976 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetDeployedServicePackageHealthUsingPolicy") 7977 defer func() { 7978 sc := -1 7979 if result.Response.Response != nil { 7980 sc = result.Response.Response.StatusCode 7981 } 7982 tracing.EndSpan(ctx, sc, err) 7983 }() 7984 } 7985 if err := validation.Validate([]validation.Validation{ 7986 {TargetValue: timeout, 7987 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 7988 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 7989 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 7990 }}}}}); err != nil { 7991 return result, validation.NewError("servicefabric.BaseClient", "GetDeployedServicePackageHealthUsingPolicy", err.Error()) 7992 } 7993 7994 req, err := client.GetDeployedServicePackageHealthUsingPolicyPreparer(ctx, nodeName, applicationID, servicePackageName, eventsHealthStateFilter, applicationHealthPolicy, timeout) 7995 if err != nil { 7996 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServicePackageHealthUsingPolicy", nil, "Failure preparing request") 7997 return 7998 } 7999 8000 resp, err := client.GetDeployedServicePackageHealthUsingPolicySender(req) 8001 if err != nil { 8002 result.Response = autorest.Response{Response: resp} 8003 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServicePackageHealthUsingPolicy", resp, "Failure sending request") 8004 return 8005 } 8006 8007 result, err = client.GetDeployedServicePackageHealthUsingPolicyResponder(resp) 8008 if err != nil { 8009 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServicePackageHealthUsingPolicy", resp, "Failure responding to request") 8010 } 8011 8012 return 8013} 8014 8015// GetDeployedServicePackageHealthUsingPolicyPreparer prepares the GetDeployedServicePackageHealthUsingPolicy request. 8016func (client BaseClient) GetDeployedServicePackageHealthUsingPolicyPreparer(ctx context.Context, nodeName string, applicationID string, servicePackageName string, eventsHealthStateFilter *int32, applicationHealthPolicy *ApplicationHealthPolicy, timeout *int64) (*http.Request, error) { 8017 pathParameters := map[string]interface{}{ 8018 "applicationId": applicationID, 8019 "nodeName": autorest.Encode("path", nodeName), 8020 "servicePackageName": servicePackageName, 8021 } 8022 8023 const APIVersion = "6.0" 8024 queryParameters := map[string]interface{}{ 8025 "api-version": APIVersion, 8026 } 8027 if eventsHealthStateFilter != nil { 8028 queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", *eventsHealthStateFilter) 8029 } else { 8030 queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", 0) 8031 } 8032 if timeout != nil { 8033 queryParameters["timeout"] = autorest.Encode("query", *timeout) 8034 } else { 8035 queryParameters["timeout"] = autorest.Encode("query", 60) 8036 } 8037 8038 preparer := autorest.CreatePreparer( 8039 autorest.AsContentType("application/json; charset=utf-8"), 8040 autorest.AsPost(), 8041 autorest.WithBaseURL(client.BaseURI), 8042 autorest.WithPathParameters("/Nodes/{nodeName}/$/GetApplications/{applicationId}/$/GetServicePackages/{servicePackageName}/$/GetHealth", pathParameters), 8043 autorest.WithQueryParameters(queryParameters)) 8044 if applicationHealthPolicy != nil { 8045 preparer = autorest.DecoratePreparer(preparer, 8046 autorest.WithJSON(applicationHealthPolicy)) 8047 } 8048 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 8049} 8050 8051// GetDeployedServicePackageHealthUsingPolicySender sends the GetDeployedServicePackageHealthUsingPolicy request. The method will close the 8052// http.Response Body if it receives an error. 8053func (client BaseClient) GetDeployedServicePackageHealthUsingPolicySender(req *http.Request) (*http.Response, error) { 8054 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 8055 return autorest.SendWithSender(client, req, sd...) 8056} 8057 8058// GetDeployedServicePackageHealthUsingPolicyResponder handles the response to the GetDeployedServicePackageHealthUsingPolicy request. The method always 8059// closes the http.Response Body. 8060func (client BaseClient) GetDeployedServicePackageHealthUsingPolicyResponder(resp *http.Response) (result DeployedServicePackageHealth, err error) { 8061 err = autorest.Respond( 8062 resp, 8063 client.ByInspecting(), 8064 azure.WithErrorUnlessStatusCode(http.StatusOK), 8065 autorest.ByUnmarshallingJSON(&result), 8066 autorest.ByClosing()) 8067 result.Response = autorest.Response{Response: resp} 8068 return 8069} 8070 8071// GetDeployedServicePackageInfoList returns the information about the service packages deployed on a Service Fabric 8072// node for the given application. 8073// Parameters: 8074// nodeName - the name of the node. 8075// applicationID - the identity of the application. This is typically the full name of the application without 8076// the 'fabric:' URI scheme. 8077// Starting from version 6.0, hierarchical names are delimited with the "~" character. 8078// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" 8079// in 6.0+ and "myapp/app1" in previous versions. 8080// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 8081// duration that the client is willing to wait for the requested operation to complete. The default value for 8082// this parameter is 60 seconds. 8083func (client BaseClient) GetDeployedServicePackageInfoList(ctx context.Context, nodeName string, applicationID string, timeout *int64) (result ListDeployedServicePackageInfo, err error) { 8084 if tracing.IsEnabled() { 8085 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetDeployedServicePackageInfoList") 8086 defer func() { 8087 sc := -1 8088 if result.Response.Response != nil { 8089 sc = result.Response.Response.StatusCode 8090 } 8091 tracing.EndSpan(ctx, sc, err) 8092 }() 8093 } 8094 if err := validation.Validate([]validation.Validation{ 8095 {TargetValue: timeout, 8096 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 8097 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 8098 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 8099 }}}}}); err != nil { 8100 return result, validation.NewError("servicefabric.BaseClient", "GetDeployedServicePackageInfoList", err.Error()) 8101 } 8102 8103 req, err := client.GetDeployedServicePackageInfoListPreparer(ctx, nodeName, applicationID, timeout) 8104 if err != nil { 8105 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServicePackageInfoList", nil, "Failure preparing request") 8106 return 8107 } 8108 8109 resp, err := client.GetDeployedServicePackageInfoListSender(req) 8110 if err != nil { 8111 result.Response = autorest.Response{Response: resp} 8112 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServicePackageInfoList", resp, "Failure sending request") 8113 return 8114 } 8115 8116 result, err = client.GetDeployedServicePackageInfoListResponder(resp) 8117 if err != nil { 8118 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServicePackageInfoList", resp, "Failure responding to request") 8119 } 8120 8121 return 8122} 8123 8124// GetDeployedServicePackageInfoListPreparer prepares the GetDeployedServicePackageInfoList request. 8125func (client BaseClient) GetDeployedServicePackageInfoListPreparer(ctx context.Context, nodeName string, applicationID string, timeout *int64) (*http.Request, error) { 8126 pathParameters := map[string]interface{}{ 8127 "applicationId": applicationID, 8128 "nodeName": autorest.Encode("path", nodeName), 8129 } 8130 8131 const APIVersion = "6.0" 8132 queryParameters := map[string]interface{}{ 8133 "api-version": APIVersion, 8134 } 8135 if timeout != nil { 8136 queryParameters["timeout"] = autorest.Encode("query", *timeout) 8137 } else { 8138 queryParameters["timeout"] = autorest.Encode("query", 60) 8139 } 8140 8141 preparer := autorest.CreatePreparer( 8142 autorest.AsGet(), 8143 autorest.WithBaseURL(client.BaseURI), 8144 autorest.WithPathParameters("/Nodes/{nodeName}/$/GetApplications/{applicationId}/$/GetServicePackages", pathParameters), 8145 autorest.WithQueryParameters(queryParameters)) 8146 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 8147} 8148 8149// GetDeployedServicePackageInfoListSender sends the GetDeployedServicePackageInfoList request. The method will close the 8150// http.Response Body if it receives an error. 8151func (client BaseClient) GetDeployedServicePackageInfoListSender(req *http.Request) (*http.Response, error) { 8152 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 8153 return autorest.SendWithSender(client, req, sd...) 8154} 8155 8156// GetDeployedServicePackageInfoListResponder handles the response to the GetDeployedServicePackageInfoList request. The method always 8157// closes the http.Response Body. 8158func (client BaseClient) GetDeployedServicePackageInfoListResponder(resp *http.Response) (result ListDeployedServicePackageInfo, err error) { 8159 err = autorest.Respond( 8160 resp, 8161 client.ByInspecting(), 8162 azure.WithErrorUnlessStatusCode(http.StatusOK), 8163 autorest.ByUnmarshallingJSON(&result.Value), 8164 autorest.ByClosing()) 8165 result.Response = autorest.Response{Response: resp} 8166 return 8167} 8168 8169// GetDeployedServicePackageInfoListByName returns the information about the service packages deployed on a Service 8170// Fabric node for the given application. These results are of service packages whose name match exactly the service 8171// package name specified as the parameter. 8172// Parameters: 8173// nodeName - the name of the node. 8174// applicationID - the identity of the application. This is typically the full name of the application without 8175// the 'fabric:' URI scheme. 8176// Starting from version 6.0, hierarchical names are delimited with the "~" character. 8177// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" 8178// in 6.0+ and "myapp/app1" in previous versions. 8179// servicePackageName - the name of the service package. 8180// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 8181// duration that the client is willing to wait for the requested operation to complete. The default value for 8182// this parameter is 60 seconds. 8183func (client BaseClient) GetDeployedServicePackageInfoListByName(ctx context.Context, nodeName string, applicationID string, servicePackageName string, timeout *int64) (result ListDeployedServicePackageInfo, err error) { 8184 if tracing.IsEnabled() { 8185 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetDeployedServicePackageInfoListByName") 8186 defer func() { 8187 sc := -1 8188 if result.Response.Response != nil { 8189 sc = result.Response.Response.StatusCode 8190 } 8191 tracing.EndSpan(ctx, sc, err) 8192 }() 8193 } 8194 if err := validation.Validate([]validation.Validation{ 8195 {TargetValue: timeout, 8196 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 8197 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 8198 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 8199 }}}}}); err != nil { 8200 return result, validation.NewError("servicefabric.BaseClient", "GetDeployedServicePackageInfoListByName", err.Error()) 8201 } 8202 8203 req, err := client.GetDeployedServicePackageInfoListByNamePreparer(ctx, nodeName, applicationID, servicePackageName, timeout) 8204 if err != nil { 8205 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServicePackageInfoListByName", nil, "Failure preparing request") 8206 return 8207 } 8208 8209 resp, err := client.GetDeployedServicePackageInfoListByNameSender(req) 8210 if err != nil { 8211 result.Response = autorest.Response{Response: resp} 8212 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServicePackageInfoListByName", resp, "Failure sending request") 8213 return 8214 } 8215 8216 result, err = client.GetDeployedServicePackageInfoListByNameResponder(resp) 8217 if err != nil { 8218 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServicePackageInfoListByName", resp, "Failure responding to request") 8219 } 8220 8221 return 8222} 8223 8224// GetDeployedServicePackageInfoListByNamePreparer prepares the GetDeployedServicePackageInfoListByName request. 8225func (client BaseClient) GetDeployedServicePackageInfoListByNamePreparer(ctx context.Context, nodeName string, applicationID string, servicePackageName string, timeout *int64) (*http.Request, error) { 8226 pathParameters := map[string]interface{}{ 8227 "applicationId": applicationID, 8228 "nodeName": autorest.Encode("path", nodeName), 8229 "servicePackageName": servicePackageName, 8230 } 8231 8232 const APIVersion = "6.0" 8233 queryParameters := map[string]interface{}{ 8234 "api-version": APIVersion, 8235 } 8236 if timeout != nil { 8237 queryParameters["timeout"] = autorest.Encode("query", *timeout) 8238 } else { 8239 queryParameters["timeout"] = autorest.Encode("query", 60) 8240 } 8241 8242 preparer := autorest.CreatePreparer( 8243 autorest.AsGet(), 8244 autorest.WithBaseURL(client.BaseURI), 8245 autorest.WithPathParameters("/Nodes/{nodeName}/$/GetApplications/{applicationId}/$/GetServicePackages/{servicePackageName}", pathParameters), 8246 autorest.WithQueryParameters(queryParameters)) 8247 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 8248} 8249 8250// GetDeployedServicePackageInfoListByNameSender sends the GetDeployedServicePackageInfoListByName request. The method will close the 8251// http.Response Body if it receives an error. 8252func (client BaseClient) GetDeployedServicePackageInfoListByNameSender(req *http.Request) (*http.Response, error) { 8253 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 8254 return autorest.SendWithSender(client, req, sd...) 8255} 8256 8257// GetDeployedServicePackageInfoListByNameResponder handles the response to the GetDeployedServicePackageInfoListByName request. The method always 8258// closes the http.Response Body. 8259func (client BaseClient) GetDeployedServicePackageInfoListByNameResponder(resp *http.Response) (result ListDeployedServicePackageInfo, err error) { 8260 err = autorest.Respond( 8261 resp, 8262 client.ByInspecting(), 8263 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), 8264 autorest.ByUnmarshallingJSON(&result.Value), 8265 autorest.ByClosing()) 8266 result.Response = autorest.Response{Response: resp} 8267 return 8268} 8269 8270// GetDeployedServiceReplicaDetailInfo gets the details of the replica deployed on a Service Fabric node. The 8271// information include service kind, service name, current service operation, current service operation start date 8272// time, partition ID, replica/instance ID, reported load, and other information. 8273// Parameters: 8274// nodeName - the name of the node. 8275// partitionID - the identity of the partition. 8276// replicaID - the identifier of the replica. 8277// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 8278// duration that the client is willing to wait for the requested operation to complete. The default value for 8279// this parameter is 60 seconds. 8280func (client BaseClient) GetDeployedServiceReplicaDetailInfo(ctx context.Context, nodeName string, partitionID uuid.UUID, replicaID string, timeout *int64) (result DeployedServiceReplicaDetailInfoModel, err error) { 8281 if tracing.IsEnabled() { 8282 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetDeployedServiceReplicaDetailInfo") 8283 defer func() { 8284 sc := -1 8285 if result.Response.Response != nil { 8286 sc = result.Response.Response.StatusCode 8287 } 8288 tracing.EndSpan(ctx, sc, err) 8289 }() 8290 } 8291 if err := validation.Validate([]validation.Validation{ 8292 {TargetValue: timeout, 8293 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 8294 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 8295 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 8296 }}}}}); err != nil { 8297 return result, validation.NewError("servicefabric.BaseClient", "GetDeployedServiceReplicaDetailInfo", err.Error()) 8298 } 8299 8300 req, err := client.GetDeployedServiceReplicaDetailInfoPreparer(ctx, nodeName, partitionID, replicaID, timeout) 8301 if err != nil { 8302 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServiceReplicaDetailInfo", nil, "Failure preparing request") 8303 return 8304 } 8305 8306 resp, err := client.GetDeployedServiceReplicaDetailInfoSender(req) 8307 if err != nil { 8308 result.Response = autorest.Response{Response: resp} 8309 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServiceReplicaDetailInfo", resp, "Failure sending request") 8310 return 8311 } 8312 8313 result, err = client.GetDeployedServiceReplicaDetailInfoResponder(resp) 8314 if err != nil { 8315 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServiceReplicaDetailInfo", resp, "Failure responding to request") 8316 } 8317 8318 return 8319} 8320 8321// GetDeployedServiceReplicaDetailInfoPreparer prepares the GetDeployedServiceReplicaDetailInfo request. 8322func (client BaseClient) GetDeployedServiceReplicaDetailInfoPreparer(ctx context.Context, nodeName string, partitionID uuid.UUID, replicaID string, timeout *int64) (*http.Request, error) { 8323 pathParameters := map[string]interface{}{ 8324 "nodeName": autorest.Encode("path", nodeName), 8325 "partitionId": partitionID, 8326 "replicaId": replicaID, 8327 } 8328 8329 const APIVersion = "6.0" 8330 queryParameters := map[string]interface{}{ 8331 "api-version": APIVersion, 8332 } 8333 if timeout != nil { 8334 queryParameters["timeout"] = autorest.Encode("query", *timeout) 8335 } else { 8336 queryParameters["timeout"] = autorest.Encode("query", 60) 8337 } 8338 8339 preparer := autorest.CreatePreparer( 8340 autorest.AsGet(), 8341 autorest.WithBaseURL(client.BaseURI), 8342 autorest.WithPathParameters("/Nodes/{nodeName}/$/GetPartitions/{partitionId}/$/GetReplicas/{replicaId}/$/GetDetail", pathParameters), 8343 autorest.WithQueryParameters(queryParameters)) 8344 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 8345} 8346 8347// GetDeployedServiceReplicaDetailInfoSender sends the GetDeployedServiceReplicaDetailInfo request. The method will close the 8348// http.Response Body if it receives an error. 8349func (client BaseClient) GetDeployedServiceReplicaDetailInfoSender(req *http.Request) (*http.Response, error) { 8350 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 8351 return autorest.SendWithSender(client, req, sd...) 8352} 8353 8354// GetDeployedServiceReplicaDetailInfoResponder handles the response to the GetDeployedServiceReplicaDetailInfo request. The method always 8355// closes the http.Response Body. 8356func (client BaseClient) GetDeployedServiceReplicaDetailInfoResponder(resp *http.Response) (result DeployedServiceReplicaDetailInfoModel, err error) { 8357 err = autorest.Respond( 8358 resp, 8359 client.ByInspecting(), 8360 azure.WithErrorUnlessStatusCode(http.StatusOK), 8361 autorest.ByUnmarshallingJSON(&result), 8362 autorest.ByClosing()) 8363 result.Response = autorest.Response{Response: resp} 8364 return 8365} 8366 8367// GetDeployedServiceReplicaDetailInfoByPartitionID gets the details of the replica deployed on a Service Fabric node. 8368// The information include service kind, service name, current service operation, current service operation start date 8369// time, partition ID, replica/instance ID, reported load, and other information. 8370// Parameters: 8371// nodeName - the name of the node. 8372// partitionID - the identity of the partition. 8373// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 8374// duration that the client is willing to wait for the requested operation to complete. The default value for 8375// this parameter is 60 seconds. 8376func (client BaseClient) GetDeployedServiceReplicaDetailInfoByPartitionID(ctx context.Context, nodeName string, partitionID uuid.UUID, timeout *int64) (result DeployedServiceReplicaDetailInfoModel, err error) { 8377 if tracing.IsEnabled() { 8378 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetDeployedServiceReplicaDetailInfoByPartitionID") 8379 defer func() { 8380 sc := -1 8381 if result.Response.Response != nil { 8382 sc = result.Response.Response.StatusCode 8383 } 8384 tracing.EndSpan(ctx, sc, err) 8385 }() 8386 } 8387 if err := validation.Validate([]validation.Validation{ 8388 {TargetValue: timeout, 8389 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 8390 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 8391 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 8392 }}}}}); err != nil { 8393 return result, validation.NewError("servicefabric.BaseClient", "GetDeployedServiceReplicaDetailInfoByPartitionID", err.Error()) 8394 } 8395 8396 req, err := client.GetDeployedServiceReplicaDetailInfoByPartitionIDPreparer(ctx, nodeName, partitionID, timeout) 8397 if err != nil { 8398 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServiceReplicaDetailInfoByPartitionID", nil, "Failure preparing request") 8399 return 8400 } 8401 8402 resp, err := client.GetDeployedServiceReplicaDetailInfoByPartitionIDSender(req) 8403 if err != nil { 8404 result.Response = autorest.Response{Response: resp} 8405 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServiceReplicaDetailInfoByPartitionID", resp, "Failure sending request") 8406 return 8407 } 8408 8409 result, err = client.GetDeployedServiceReplicaDetailInfoByPartitionIDResponder(resp) 8410 if err != nil { 8411 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServiceReplicaDetailInfoByPartitionID", resp, "Failure responding to request") 8412 } 8413 8414 return 8415} 8416 8417// GetDeployedServiceReplicaDetailInfoByPartitionIDPreparer prepares the GetDeployedServiceReplicaDetailInfoByPartitionID request. 8418func (client BaseClient) GetDeployedServiceReplicaDetailInfoByPartitionIDPreparer(ctx context.Context, nodeName string, partitionID uuid.UUID, timeout *int64) (*http.Request, error) { 8419 pathParameters := map[string]interface{}{ 8420 "nodeName": autorest.Encode("path", nodeName), 8421 "partitionId": partitionID, 8422 } 8423 8424 const APIVersion = "6.0" 8425 queryParameters := map[string]interface{}{ 8426 "api-version": APIVersion, 8427 } 8428 if timeout != nil { 8429 queryParameters["timeout"] = autorest.Encode("query", *timeout) 8430 } else { 8431 queryParameters["timeout"] = autorest.Encode("query", 60) 8432 } 8433 8434 preparer := autorest.CreatePreparer( 8435 autorest.AsGet(), 8436 autorest.WithBaseURL(client.BaseURI), 8437 autorest.WithPathParameters("/Nodes/{nodeName}/$/GetPartitions/{partitionId}/$/GetReplicas", pathParameters), 8438 autorest.WithQueryParameters(queryParameters)) 8439 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 8440} 8441 8442// GetDeployedServiceReplicaDetailInfoByPartitionIDSender sends the GetDeployedServiceReplicaDetailInfoByPartitionID request. The method will close the 8443// http.Response Body if it receives an error. 8444func (client BaseClient) GetDeployedServiceReplicaDetailInfoByPartitionIDSender(req *http.Request) (*http.Response, error) { 8445 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 8446 return autorest.SendWithSender(client, req, sd...) 8447} 8448 8449// GetDeployedServiceReplicaDetailInfoByPartitionIDResponder handles the response to the GetDeployedServiceReplicaDetailInfoByPartitionID request. The method always 8450// closes the http.Response Body. 8451func (client BaseClient) GetDeployedServiceReplicaDetailInfoByPartitionIDResponder(resp *http.Response) (result DeployedServiceReplicaDetailInfoModel, err error) { 8452 err = autorest.Respond( 8453 resp, 8454 client.ByInspecting(), 8455 azure.WithErrorUnlessStatusCode(http.StatusOK), 8456 autorest.ByUnmarshallingJSON(&result), 8457 autorest.ByClosing()) 8458 result.Response = autorest.Response{Response: resp} 8459 return 8460} 8461 8462// GetDeployedServiceReplicaInfoList gets the list containing the information about replicas deployed on a Service 8463// Fabric node. The information include partition ID, replica ID, status of the replica, name of the service, name of 8464// the service type, and other information. Use PartitionId or ServiceManifestName query parameters to return 8465// information about the deployed replicas matching the specified values for those parameters. 8466// Parameters: 8467// nodeName - the name of the node. 8468// applicationID - the identity of the application. This is typically the full name of the application without 8469// the 'fabric:' URI scheme. 8470// Starting from version 6.0, hierarchical names are delimited with the "~" character. 8471// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" 8472// in 6.0+ and "myapp/app1" in previous versions. 8473// partitionID - the identity of the partition. 8474// serviceManifestName - the name of a service manifest registered as part of an application type in a Service 8475// Fabric cluster. 8476// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 8477// duration that the client is willing to wait for the requested operation to complete. The default value for 8478// this parameter is 60 seconds. 8479func (client BaseClient) GetDeployedServiceReplicaInfoList(ctx context.Context, nodeName string, applicationID string, partitionID *uuid.UUID, serviceManifestName string, timeout *int64) (result ListDeployedServiceReplicaInfo, err error) { 8480 if tracing.IsEnabled() { 8481 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetDeployedServiceReplicaInfoList") 8482 defer func() { 8483 sc := -1 8484 if result.Response.Response != nil { 8485 sc = result.Response.Response.StatusCode 8486 } 8487 tracing.EndSpan(ctx, sc, err) 8488 }() 8489 } 8490 if err := validation.Validate([]validation.Validation{ 8491 {TargetValue: timeout, 8492 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 8493 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 8494 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 8495 }}}}}); err != nil { 8496 return result, validation.NewError("servicefabric.BaseClient", "GetDeployedServiceReplicaInfoList", err.Error()) 8497 } 8498 8499 req, err := client.GetDeployedServiceReplicaInfoListPreparer(ctx, nodeName, applicationID, partitionID, serviceManifestName, timeout) 8500 if err != nil { 8501 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServiceReplicaInfoList", nil, "Failure preparing request") 8502 return 8503 } 8504 8505 resp, err := client.GetDeployedServiceReplicaInfoListSender(req) 8506 if err != nil { 8507 result.Response = autorest.Response{Response: resp} 8508 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServiceReplicaInfoList", resp, "Failure sending request") 8509 return 8510 } 8511 8512 result, err = client.GetDeployedServiceReplicaInfoListResponder(resp) 8513 if err != nil { 8514 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServiceReplicaInfoList", resp, "Failure responding to request") 8515 } 8516 8517 return 8518} 8519 8520// GetDeployedServiceReplicaInfoListPreparer prepares the GetDeployedServiceReplicaInfoList request. 8521func (client BaseClient) GetDeployedServiceReplicaInfoListPreparer(ctx context.Context, nodeName string, applicationID string, partitionID *uuid.UUID, serviceManifestName string, timeout *int64) (*http.Request, error) { 8522 pathParameters := map[string]interface{}{ 8523 "applicationId": applicationID, 8524 "nodeName": autorest.Encode("path", nodeName), 8525 } 8526 8527 const APIVersion = "6.0" 8528 queryParameters := map[string]interface{}{ 8529 "api-version": APIVersion, 8530 } 8531 if partitionID != nil { 8532 queryParameters["PartitionId"] = autorest.Encode("query", *partitionID) 8533 } 8534 if len(serviceManifestName) > 0 { 8535 queryParameters["ServiceManifestName"] = autorest.Encode("query", serviceManifestName) 8536 } 8537 if timeout != nil { 8538 queryParameters["timeout"] = autorest.Encode("query", *timeout) 8539 } else { 8540 queryParameters["timeout"] = autorest.Encode("query", 60) 8541 } 8542 8543 preparer := autorest.CreatePreparer( 8544 autorest.AsGet(), 8545 autorest.WithBaseURL(client.BaseURI), 8546 autorest.WithPathParameters("/Nodes/{nodeName}/$/GetApplications/{applicationId}/$/GetReplicas", pathParameters), 8547 autorest.WithQueryParameters(queryParameters)) 8548 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 8549} 8550 8551// GetDeployedServiceReplicaInfoListSender sends the GetDeployedServiceReplicaInfoList request. The method will close the 8552// http.Response Body if it receives an error. 8553func (client BaseClient) GetDeployedServiceReplicaInfoListSender(req *http.Request) (*http.Response, error) { 8554 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 8555 return autorest.SendWithSender(client, req, sd...) 8556} 8557 8558// GetDeployedServiceReplicaInfoListResponder handles the response to the GetDeployedServiceReplicaInfoList request. The method always 8559// closes the http.Response Body. 8560func (client BaseClient) GetDeployedServiceReplicaInfoListResponder(resp *http.Response) (result ListDeployedServiceReplicaInfo, err error) { 8561 err = autorest.Respond( 8562 resp, 8563 client.ByInspecting(), 8564 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), 8565 autorest.ByUnmarshallingJSON(&result), 8566 autorest.ByClosing()) 8567 result.Response = autorest.Response{Response: resp} 8568 return 8569} 8570 8571// GetDeployedServiceTypeInfoByName gets the list containing the information about a specific service type from the 8572// applications deployed on a node in a Service Fabric cluster. The response includes the name of the service type, its 8573// registration status, the code package that registered it and activation ID of the service package. Each entry 8574// represents one activation of a service type, differentiated by the activation ID. 8575// Parameters: 8576// nodeName - the name of the node. 8577// applicationID - the identity of the application. This is typically the full name of the application without 8578// the 'fabric:' URI scheme. 8579// Starting from version 6.0, hierarchical names are delimited with the "~" character. 8580// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" 8581// in 6.0+ and "myapp/app1" in previous versions. 8582// serviceTypeName - specifies the name of a Service Fabric service type. 8583// serviceManifestName - the name of the service manifest to filter the list of deployed service type 8584// information. If specified, the response will only contain the information about service types that are 8585// defined in this service manifest. 8586// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 8587// duration that the client is willing to wait for the requested operation to complete. The default value for 8588// this parameter is 60 seconds. 8589func (client BaseClient) GetDeployedServiceTypeInfoByName(ctx context.Context, nodeName string, applicationID string, serviceTypeName string, serviceManifestName string, timeout *int64) (result ListDeployedServiceTypeInfo, err error) { 8590 if tracing.IsEnabled() { 8591 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetDeployedServiceTypeInfoByName") 8592 defer func() { 8593 sc := -1 8594 if result.Response.Response != nil { 8595 sc = result.Response.Response.StatusCode 8596 } 8597 tracing.EndSpan(ctx, sc, err) 8598 }() 8599 } 8600 if err := validation.Validate([]validation.Validation{ 8601 {TargetValue: timeout, 8602 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 8603 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 8604 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 8605 }}}}}); err != nil { 8606 return result, validation.NewError("servicefabric.BaseClient", "GetDeployedServiceTypeInfoByName", err.Error()) 8607 } 8608 8609 req, err := client.GetDeployedServiceTypeInfoByNamePreparer(ctx, nodeName, applicationID, serviceTypeName, serviceManifestName, timeout) 8610 if err != nil { 8611 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServiceTypeInfoByName", nil, "Failure preparing request") 8612 return 8613 } 8614 8615 resp, err := client.GetDeployedServiceTypeInfoByNameSender(req) 8616 if err != nil { 8617 result.Response = autorest.Response{Response: resp} 8618 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServiceTypeInfoByName", resp, "Failure sending request") 8619 return 8620 } 8621 8622 result, err = client.GetDeployedServiceTypeInfoByNameResponder(resp) 8623 if err != nil { 8624 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServiceTypeInfoByName", resp, "Failure responding to request") 8625 } 8626 8627 return 8628} 8629 8630// GetDeployedServiceTypeInfoByNamePreparer prepares the GetDeployedServiceTypeInfoByName request. 8631func (client BaseClient) GetDeployedServiceTypeInfoByNamePreparer(ctx context.Context, nodeName string, applicationID string, serviceTypeName string, serviceManifestName string, timeout *int64) (*http.Request, error) { 8632 pathParameters := map[string]interface{}{ 8633 "applicationId": applicationID, 8634 "nodeName": autorest.Encode("path", nodeName), 8635 "serviceTypeName": serviceTypeName, 8636 } 8637 8638 const APIVersion = "6.0" 8639 queryParameters := map[string]interface{}{ 8640 "api-version": APIVersion, 8641 } 8642 if len(serviceManifestName) > 0 { 8643 queryParameters["ServiceManifestName"] = autorest.Encode("query", serviceManifestName) 8644 } 8645 if timeout != nil { 8646 queryParameters["timeout"] = autorest.Encode("query", *timeout) 8647 } else { 8648 queryParameters["timeout"] = autorest.Encode("query", 60) 8649 } 8650 8651 preparer := autorest.CreatePreparer( 8652 autorest.AsGet(), 8653 autorest.WithBaseURL(client.BaseURI), 8654 autorest.WithPathParameters("/Nodes/{nodeName}/$/GetApplications/{applicationId}/$/GetServiceTypes/{serviceTypeName}", pathParameters), 8655 autorest.WithQueryParameters(queryParameters)) 8656 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 8657} 8658 8659// GetDeployedServiceTypeInfoByNameSender sends the GetDeployedServiceTypeInfoByName request. The method will close the 8660// http.Response Body if it receives an error. 8661func (client BaseClient) GetDeployedServiceTypeInfoByNameSender(req *http.Request) (*http.Response, error) { 8662 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 8663 return autorest.SendWithSender(client, req, sd...) 8664} 8665 8666// GetDeployedServiceTypeInfoByNameResponder handles the response to the GetDeployedServiceTypeInfoByName request. The method always 8667// closes the http.Response Body. 8668func (client BaseClient) GetDeployedServiceTypeInfoByNameResponder(resp *http.Response) (result ListDeployedServiceTypeInfo, err error) { 8669 err = autorest.Respond( 8670 resp, 8671 client.ByInspecting(), 8672 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), 8673 autorest.ByUnmarshallingJSON(&result.Value), 8674 autorest.ByClosing()) 8675 result.Response = autorest.Response{Response: resp} 8676 return 8677} 8678 8679// GetDeployedServiceTypeInfoList gets the list containing the information about service types from the applications 8680// deployed on a node in a Service Fabric cluster. The response includes the name of the service type, its registration 8681// status, the code package that registered it and activation ID of the service package. 8682// Parameters: 8683// nodeName - the name of the node. 8684// applicationID - the identity of the application. This is typically the full name of the application without 8685// the 'fabric:' URI scheme. 8686// Starting from version 6.0, hierarchical names are delimited with the "~" character. 8687// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" 8688// in 6.0+ and "myapp/app1" in previous versions. 8689// serviceManifestName - the name of the service manifest to filter the list of deployed service type 8690// information. If specified, the response will only contain the information about service types that are 8691// defined in this service manifest. 8692// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 8693// duration that the client is willing to wait for the requested operation to complete. The default value for 8694// this parameter is 60 seconds. 8695func (client BaseClient) GetDeployedServiceTypeInfoList(ctx context.Context, nodeName string, applicationID string, serviceManifestName string, timeout *int64) (result ListDeployedServiceTypeInfo, err error) { 8696 if tracing.IsEnabled() { 8697 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetDeployedServiceTypeInfoList") 8698 defer func() { 8699 sc := -1 8700 if result.Response.Response != nil { 8701 sc = result.Response.Response.StatusCode 8702 } 8703 tracing.EndSpan(ctx, sc, err) 8704 }() 8705 } 8706 if err := validation.Validate([]validation.Validation{ 8707 {TargetValue: timeout, 8708 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 8709 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 8710 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 8711 }}}}}); err != nil { 8712 return result, validation.NewError("servicefabric.BaseClient", "GetDeployedServiceTypeInfoList", err.Error()) 8713 } 8714 8715 req, err := client.GetDeployedServiceTypeInfoListPreparer(ctx, nodeName, applicationID, serviceManifestName, timeout) 8716 if err != nil { 8717 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServiceTypeInfoList", nil, "Failure preparing request") 8718 return 8719 } 8720 8721 resp, err := client.GetDeployedServiceTypeInfoListSender(req) 8722 if err != nil { 8723 result.Response = autorest.Response{Response: resp} 8724 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServiceTypeInfoList", resp, "Failure sending request") 8725 return 8726 } 8727 8728 result, err = client.GetDeployedServiceTypeInfoListResponder(resp) 8729 if err != nil { 8730 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServiceTypeInfoList", resp, "Failure responding to request") 8731 } 8732 8733 return 8734} 8735 8736// GetDeployedServiceTypeInfoListPreparer prepares the GetDeployedServiceTypeInfoList request. 8737func (client BaseClient) GetDeployedServiceTypeInfoListPreparer(ctx context.Context, nodeName string, applicationID string, serviceManifestName string, timeout *int64) (*http.Request, error) { 8738 pathParameters := map[string]interface{}{ 8739 "applicationId": applicationID, 8740 "nodeName": autorest.Encode("path", nodeName), 8741 } 8742 8743 const APIVersion = "6.0" 8744 queryParameters := map[string]interface{}{ 8745 "api-version": APIVersion, 8746 } 8747 if len(serviceManifestName) > 0 { 8748 queryParameters["ServiceManifestName"] = autorest.Encode("query", serviceManifestName) 8749 } 8750 if timeout != nil { 8751 queryParameters["timeout"] = autorest.Encode("query", *timeout) 8752 } else { 8753 queryParameters["timeout"] = autorest.Encode("query", 60) 8754 } 8755 8756 preparer := autorest.CreatePreparer( 8757 autorest.AsGet(), 8758 autorest.WithBaseURL(client.BaseURI), 8759 autorest.WithPathParameters("/Nodes/{nodeName}/$/GetApplications/{applicationId}/$/GetServiceTypes", pathParameters), 8760 autorest.WithQueryParameters(queryParameters)) 8761 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 8762} 8763 8764// GetDeployedServiceTypeInfoListSender sends the GetDeployedServiceTypeInfoList request. The method will close the 8765// http.Response Body if it receives an error. 8766func (client BaseClient) GetDeployedServiceTypeInfoListSender(req *http.Request) (*http.Response, error) { 8767 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 8768 return autorest.SendWithSender(client, req, sd...) 8769} 8770 8771// GetDeployedServiceTypeInfoListResponder handles the response to the GetDeployedServiceTypeInfoList request. The method always 8772// closes the http.Response Body. 8773func (client BaseClient) GetDeployedServiceTypeInfoListResponder(resp *http.Response) (result ListDeployedServiceTypeInfo, err error) { 8774 err = autorest.Respond( 8775 resp, 8776 client.ByInspecting(), 8777 azure.WithErrorUnlessStatusCode(http.StatusOK), 8778 autorest.ByUnmarshallingJSON(&result.Value), 8779 autorest.ByClosing()) 8780 result.Response = autorest.Response{Response: resp} 8781 return 8782} 8783 8784// GetFaultOperationList gets the a list of user-induced fault operations filtered by provided input. 8785// Parameters: 8786// typeFilter - used to filter on OperationType for user-induced operations. 8787// 65535 - select all 8788// 1 - select PartitionDataLoss. 8789// 2 - select PartitionQuorumLoss. 8790// 4 - select PartitionRestart. 8791// 8 - select NodeTransition. 8792// stateFilter - used to filter on OperationState's for user-induced operations. 8793// 65535 - select All 8794// 1 - select Running 8795// 2 - select RollingBack 8796// 8 - select Completed 8797// 16 - select Faulted 8798// 32 - select Cancelled 8799// 64 - select ForceCancelled 8800// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 8801// duration that the client is willing to wait for the requested operation to complete. The default value for 8802// this parameter is 60 seconds. 8803func (client BaseClient) GetFaultOperationList(ctx context.Context, typeFilter int32, stateFilter int32, timeout *int64) (result ListOperationStatus, err error) { 8804 if tracing.IsEnabled() { 8805 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetFaultOperationList") 8806 defer func() { 8807 sc := -1 8808 if result.Response.Response != nil { 8809 sc = result.Response.Response.StatusCode 8810 } 8811 tracing.EndSpan(ctx, sc, err) 8812 }() 8813 } 8814 if err := validation.Validate([]validation.Validation{ 8815 {TargetValue: timeout, 8816 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 8817 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 8818 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 8819 }}}}}); err != nil { 8820 return result, validation.NewError("servicefabric.BaseClient", "GetFaultOperationList", err.Error()) 8821 } 8822 8823 req, err := client.GetFaultOperationListPreparer(ctx, typeFilter, stateFilter, timeout) 8824 if err != nil { 8825 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetFaultOperationList", nil, "Failure preparing request") 8826 return 8827 } 8828 8829 resp, err := client.GetFaultOperationListSender(req) 8830 if err != nil { 8831 result.Response = autorest.Response{Response: resp} 8832 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetFaultOperationList", resp, "Failure sending request") 8833 return 8834 } 8835 8836 result, err = client.GetFaultOperationListResponder(resp) 8837 if err != nil { 8838 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetFaultOperationList", resp, "Failure responding to request") 8839 } 8840 8841 return 8842} 8843 8844// GetFaultOperationListPreparer prepares the GetFaultOperationList request. 8845func (client BaseClient) GetFaultOperationListPreparer(ctx context.Context, typeFilter int32, stateFilter int32, timeout *int64) (*http.Request, error) { 8846 const APIVersion = "6.0" 8847 queryParameters := map[string]interface{}{ 8848 "api-version": APIVersion, 8849 "StateFilter": autorest.Encode("query", stateFilter), 8850 "TypeFilter": autorest.Encode("query", typeFilter), 8851 } 8852 if timeout != nil { 8853 queryParameters["timeout"] = autorest.Encode("query", *timeout) 8854 } else { 8855 queryParameters["timeout"] = autorest.Encode("query", 60) 8856 } 8857 8858 preparer := autorest.CreatePreparer( 8859 autorest.AsGet(), 8860 autorest.WithBaseURL(client.BaseURI), 8861 autorest.WithPath("/Faults/"), 8862 autorest.WithQueryParameters(queryParameters)) 8863 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 8864} 8865 8866// GetFaultOperationListSender sends the GetFaultOperationList request. The method will close the 8867// http.Response Body if it receives an error. 8868func (client BaseClient) GetFaultOperationListSender(req *http.Request) (*http.Response, error) { 8869 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 8870 return autorest.SendWithSender(client, req, sd...) 8871} 8872 8873// GetFaultOperationListResponder handles the response to the GetFaultOperationList request. The method always 8874// closes the http.Response Body. 8875func (client BaseClient) GetFaultOperationListResponder(resp *http.Response) (result ListOperationStatus, err error) { 8876 err = autorest.Respond( 8877 resp, 8878 client.ByInspecting(), 8879 azure.WithErrorUnlessStatusCode(http.StatusOK), 8880 autorest.ByUnmarshallingJSON(&result.Value), 8881 autorest.ByClosing()) 8882 result.Response = autorest.Response{Response: resp} 8883 return 8884} 8885 8886// GetImageStoreContent returns the information about the image store content at the specified contentPath relative to 8887// the root of the image store. 8888// Parameters: 8889// contentPath - relative path to file or folder in the image store from its root. 8890// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 8891// duration that the client is willing to wait for the requested operation to complete. The default value for 8892// this parameter is 60 seconds. 8893func (client BaseClient) GetImageStoreContent(ctx context.Context, contentPath string, timeout *int64) (result ImageStoreContent, err error) { 8894 if tracing.IsEnabled() { 8895 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetImageStoreContent") 8896 defer func() { 8897 sc := -1 8898 if result.Response.Response != nil { 8899 sc = result.Response.Response.StatusCode 8900 } 8901 tracing.EndSpan(ctx, sc, err) 8902 }() 8903 } 8904 if err := validation.Validate([]validation.Validation{ 8905 {TargetValue: timeout, 8906 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 8907 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 8908 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 8909 }}}}}); err != nil { 8910 return result, validation.NewError("servicefabric.BaseClient", "GetImageStoreContent", err.Error()) 8911 } 8912 8913 req, err := client.GetImageStoreContentPreparer(ctx, contentPath, timeout) 8914 if err != nil { 8915 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetImageStoreContent", nil, "Failure preparing request") 8916 return 8917 } 8918 8919 resp, err := client.GetImageStoreContentSender(req) 8920 if err != nil { 8921 result.Response = autorest.Response{Response: resp} 8922 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetImageStoreContent", resp, "Failure sending request") 8923 return 8924 } 8925 8926 result, err = client.GetImageStoreContentResponder(resp) 8927 if err != nil { 8928 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetImageStoreContent", resp, "Failure responding to request") 8929 } 8930 8931 return 8932} 8933 8934// GetImageStoreContentPreparer prepares the GetImageStoreContent request. 8935func (client BaseClient) GetImageStoreContentPreparer(ctx context.Context, contentPath string, timeout *int64) (*http.Request, error) { 8936 pathParameters := map[string]interface{}{ 8937 "contentPath": autorest.Encode("path", contentPath), 8938 } 8939 8940 const APIVersion = "6.2" 8941 queryParameters := map[string]interface{}{ 8942 "api-version": APIVersion, 8943 } 8944 if timeout != nil { 8945 queryParameters["timeout"] = autorest.Encode("query", *timeout) 8946 } else { 8947 queryParameters["timeout"] = autorest.Encode("query", 60) 8948 } 8949 8950 preparer := autorest.CreatePreparer( 8951 autorest.AsGet(), 8952 autorest.WithBaseURL(client.BaseURI), 8953 autorest.WithPathParameters("/ImageStore/{contentPath}", pathParameters), 8954 autorest.WithQueryParameters(queryParameters)) 8955 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 8956} 8957 8958// GetImageStoreContentSender sends the GetImageStoreContent request. The method will close the 8959// http.Response Body if it receives an error. 8960func (client BaseClient) GetImageStoreContentSender(req *http.Request) (*http.Response, error) { 8961 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 8962 return autorest.SendWithSender(client, req, sd...) 8963} 8964 8965// GetImageStoreContentResponder handles the response to the GetImageStoreContent request. The method always 8966// closes the http.Response Body. 8967func (client BaseClient) GetImageStoreContentResponder(resp *http.Response) (result ImageStoreContent, err error) { 8968 err = autorest.Respond( 8969 resp, 8970 client.ByInspecting(), 8971 azure.WithErrorUnlessStatusCode(http.StatusOK), 8972 autorest.ByUnmarshallingJSON(&result), 8973 autorest.ByClosing()) 8974 result.Response = autorest.Response{Response: resp} 8975 return 8976} 8977 8978// GetImageStoreRootContent returns the information about the image store content at the root of the image store. 8979// Parameters: 8980// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 8981// duration that the client is willing to wait for the requested operation to complete. The default value for 8982// this parameter is 60 seconds. 8983func (client BaseClient) GetImageStoreRootContent(ctx context.Context, timeout *int64) (result ImageStoreContent, err error) { 8984 if tracing.IsEnabled() { 8985 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetImageStoreRootContent") 8986 defer func() { 8987 sc := -1 8988 if result.Response.Response != nil { 8989 sc = result.Response.Response.StatusCode 8990 } 8991 tracing.EndSpan(ctx, sc, err) 8992 }() 8993 } 8994 if err := validation.Validate([]validation.Validation{ 8995 {TargetValue: timeout, 8996 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 8997 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 8998 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 8999 }}}}}); err != nil { 9000 return result, validation.NewError("servicefabric.BaseClient", "GetImageStoreRootContent", err.Error()) 9001 } 9002 9003 req, err := client.GetImageStoreRootContentPreparer(ctx, timeout) 9004 if err != nil { 9005 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetImageStoreRootContent", nil, "Failure preparing request") 9006 return 9007 } 9008 9009 resp, err := client.GetImageStoreRootContentSender(req) 9010 if err != nil { 9011 result.Response = autorest.Response{Response: resp} 9012 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetImageStoreRootContent", resp, "Failure sending request") 9013 return 9014 } 9015 9016 result, err = client.GetImageStoreRootContentResponder(resp) 9017 if err != nil { 9018 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetImageStoreRootContent", resp, "Failure responding to request") 9019 } 9020 9021 return 9022} 9023 9024// GetImageStoreRootContentPreparer prepares the GetImageStoreRootContent request. 9025func (client BaseClient) GetImageStoreRootContentPreparer(ctx context.Context, timeout *int64) (*http.Request, error) { 9026 const APIVersion = "6.0" 9027 queryParameters := map[string]interface{}{ 9028 "api-version": APIVersion, 9029 } 9030 if timeout != nil { 9031 queryParameters["timeout"] = autorest.Encode("query", *timeout) 9032 } else { 9033 queryParameters["timeout"] = autorest.Encode("query", 60) 9034 } 9035 9036 preparer := autorest.CreatePreparer( 9037 autorest.AsGet(), 9038 autorest.WithBaseURL(client.BaseURI), 9039 autorest.WithPath("/ImageStore"), 9040 autorest.WithQueryParameters(queryParameters)) 9041 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 9042} 9043 9044// GetImageStoreRootContentSender sends the GetImageStoreRootContent request. The method will close the 9045// http.Response Body if it receives an error. 9046func (client BaseClient) GetImageStoreRootContentSender(req *http.Request) (*http.Response, error) { 9047 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 9048 return autorest.SendWithSender(client, req, sd...) 9049} 9050 9051// GetImageStoreRootContentResponder handles the response to the GetImageStoreRootContent request. The method always 9052// closes the http.Response Body. 9053func (client BaseClient) GetImageStoreRootContentResponder(resp *http.Response) (result ImageStoreContent, err error) { 9054 err = autorest.Respond( 9055 resp, 9056 client.ByInspecting(), 9057 azure.WithErrorUnlessStatusCode(http.StatusOK), 9058 autorest.ByUnmarshallingJSON(&result), 9059 autorest.ByClosing()) 9060 result.Response = autorest.Response{Response: resp} 9061 return 9062} 9063 9064// GetImageStoreUploadSessionByID gets the image store upload session identified by the given ID. User can query the 9065// upload session at any time during uploading. 9066// Parameters: 9067// sessionID - a GUID generated by the user for a file uploading. It identifies an image store upload session 9068// which keeps track of all file chunks until it is committed. 9069// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 9070// duration that the client is willing to wait for the requested operation to complete. The default value for 9071// this parameter is 60 seconds. 9072func (client BaseClient) GetImageStoreUploadSessionByID(ctx context.Context, sessionID uuid.UUID, timeout *int64) (result UploadSession, err error) { 9073 if tracing.IsEnabled() { 9074 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetImageStoreUploadSessionByID") 9075 defer func() { 9076 sc := -1 9077 if result.Response.Response != nil { 9078 sc = result.Response.Response.StatusCode 9079 } 9080 tracing.EndSpan(ctx, sc, err) 9081 }() 9082 } 9083 if err := validation.Validate([]validation.Validation{ 9084 {TargetValue: timeout, 9085 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 9086 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 9087 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 9088 }}}}}); err != nil { 9089 return result, validation.NewError("servicefabric.BaseClient", "GetImageStoreUploadSessionByID", err.Error()) 9090 } 9091 9092 req, err := client.GetImageStoreUploadSessionByIDPreparer(ctx, sessionID, timeout) 9093 if err != nil { 9094 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetImageStoreUploadSessionByID", nil, "Failure preparing request") 9095 return 9096 } 9097 9098 resp, err := client.GetImageStoreUploadSessionByIDSender(req) 9099 if err != nil { 9100 result.Response = autorest.Response{Response: resp} 9101 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetImageStoreUploadSessionByID", resp, "Failure sending request") 9102 return 9103 } 9104 9105 result, err = client.GetImageStoreUploadSessionByIDResponder(resp) 9106 if err != nil { 9107 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetImageStoreUploadSessionByID", resp, "Failure responding to request") 9108 } 9109 9110 return 9111} 9112 9113// GetImageStoreUploadSessionByIDPreparer prepares the GetImageStoreUploadSessionByID request. 9114func (client BaseClient) GetImageStoreUploadSessionByIDPreparer(ctx context.Context, sessionID uuid.UUID, timeout *int64) (*http.Request, error) { 9115 const APIVersion = "6.0" 9116 queryParameters := map[string]interface{}{ 9117 "api-version": APIVersion, 9118 "session-id": autorest.Encode("query", sessionID), 9119 } 9120 if timeout != nil { 9121 queryParameters["timeout"] = autorest.Encode("query", *timeout) 9122 } else { 9123 queryParameters["timeout"] = autorest.Encode("query", 60) 9124 } 9125 9126 preparer := autorest.CreatePreparer( 9127 autorest.AsGet(), 9128 autorest.WithBaseURL(client.BaseURI), 9129 autorest.WithPath("/ImageStore/$/GetUploadSession"), 9130 autorest.WithQueryParameters(queryParameters)) 9131 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 9132} 9133 9134// GetImageStoreUploadSessionByIDSender sends the GetImageStoreUploadSessionByID request. The method will close the 9135// http.Response Body if it receives an error. 9136func (client BaseClient) GetImageStoreUploadSessionByIDSender(req *http.Request) (*http.Response, error) { 9137 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 9138 return autorest.SendWithSender(client, req, sd...) 9139} 9140 9141// GetImageStoreUploadSessionByIDResponder handles the response to the GetImageStoreUploadSessionByID request. The method always 9142// closes the http.Response Body. 9143func (client BaseClient) GetImageStoreUploadSessionByIDResponder(resp *http.Response) (result UploadSession, err error) { 9144 err = autorest.Respond( 9145 resp, 9146 client.ByInspecting(), 9147 azure.WithErrorUnlessStatusCode(http.StatusOK), 9148 autorest.ByUnmarshallingJSON(&result), 9149 autorest.ByClosing()) 9150 result.Response = autorest.Response{Response: resp} 9151 return 9152} 9153 9154// GetImageStoreUploadSessionByPath gets the image store upload session associated with the given image store relative 9155// path. User can query the upload session at any time during uploading. 9156// Parameters: 9157// contentPath - relative path to file or folder in the image store from its root. 9158// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 9159// duration that the client is willing to wait for the requested operation to complete. The default value for 9160// this parameter is 60 seconds. 9161func (client BaseClient) GetImageStoreUploadSessionByPath(ctx context.Context, contentPath string, timeout *int64) (result UploadSession, err error) { 9162 if tracing.IsEnabled() { 9163 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetImageStoreUploadSessionByPath") 9164 defer func() { 9165 sc := -1 9166 if result.Response.Response != nil { 9167 sc = result.Response.Response.StatusCode 9168 } 9169 tracing.EndSpan(ctx, sc, err) 9170 }() 9171 } 9172 if err := validation.Validate([]validation.Validation{ 9173 {TargetValue: timeout, 9174 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 9175 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 9176 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 9177 }}}}}); err != nil { 9178 return result, validation.NewError("servicefabric.BaseClient", "GetImageStoreUploadSessionByPath", err.Error()) 9179 } 9180 9181 req, err := client.GetImageStoreUploadSessionByPathPreparer(ctx, contentPath, timeout) 9182 if err != nil { 9183 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetImageStoreUploadSessionByPath", nil, "Failure preparing request") 9184 return 9185 } 9186 9187 resp, err := client.GetImageStoreUploadSessionByPathSender(req) 9188 if err != nil { 9189 result.Response = autorest.Response{Response: resp} 9190 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetImageStoreUploadSessionByPath", resp, "Failure sending request") 9191 return 9192 } 9193 9194 result, err = client.GetImageStoreUploadSessionByPathResponder(resp) 9195 if err != nil { 9196 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetImageStoreUploadSessionByPath", resp, "Failure responding to request") 9197 } 9198 9199 return 9200} 9201 9202// GetImageStoreUploadSessionByPathPreparer prepares the GetImageStoreUploadSessionByPath request. 9203func (client BaseClient) GetImageStoreUploadSessionByPathPreparer(ctx context.Context, contentPath string, timeout *int64) (*http.Request, error) { 9204 pathParameters := map[string]interface{}{ 9205 "contentPath": autorest.Encode("path", contentPath), 9206 } 9207 9208 const APIVersion = "6.0" 9209 queryParameters := map[string]interface{}{ 9210 "api-version": APIVersion, 9211 } 9212 if timeout != nil { 9213 queryParameters["timeout"] = autorest.Encode("query", *timeout) 9214 } else { 9215 queryParameters["timeout"] = autorest.Encode("query", 60) 9216 } 9217 9218 preparer := autorest.CreatePreparer( 9219 autorest.AsGet(), 9220 autorest.WithBaseURL(client.BaseURI), 9221 autorest.WithPathParameters("/ImageStore/{contentPath}/$/GetUploadSession", pathParameters), 9222 autorest.WithQueryParameters(queryParameters)) 9223 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 9224} 9225 9226// GetImageStoreUploadSessionByPathSender sends the GetImageStoreUploadSessionByPath request. The method will close the 9227// http.Response Body if it receives an error. 9228func (client BaseClient) GetImageStoreUploadSessionByPathSender(req *http.Request) (*http.Response, error) { 9229 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 9230 return autorest.SendWithSender(client, req, sd...) 9231} 9232 9233// GetImageStoreUploadSessionByPathResponder handles the response to the GetImageStoreUploadSessionByPath request. The method always 9234// closes the http.Response Body. 9235func (client BaseClient) GetImageStoreUploadSessionByPathResponder(resp *http.Response) (result UploadSession, err error) { 9236 err = autorest.Respond( 9237 resp, 9238 client.ByInspecting(), 9239 azure.WithErrorUnlessStatusCode(http.StatusOK), 9240 autorest.ByUnmarshallingJSON(&result), 9241 autorest.ByClosing()) 9242 result.Response = autorest.Response{Response: resp} 9243 return 9244} 9245 9246// GetNameExistsInfo returns whether the specified Service Fabric name exists. 9247// Parameters: 9248// nameID - the Service Fabric name, without the 'fabric:' URI scheme. 9249// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 9250// duration that the client is willing to wait for the requested operation to complete. The default value for 9251// this parameter is 60 seconds. 9252func (client BaseClient) GetNameExistsInfo(ctx context.Context, nameID string, timeout *int64) (result autorest.Response, err error) { 9253 if tracing.IsEnabled() { 9254 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetNameExistsInfo") 9255 defer func() { 9256 sc := -1 9257 if result.Response != nil { 9258 sc = result.Response.StatusCode 9259 } 9260 tracing.EndSpan(ctx, sc, err) 9261 }() 9262 } 9263 if err := validation.Validate([]validation.Validation{ 9264 {TargetValue: timeout, 9265 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 9266 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 9267 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 9268 }}}}}); err != nil { 9269 return result, validation.NewError("servicefabric.BaseClient", "GetNameExistsInfo", err.Error()) 9270 } 9271 9272 req, err := client.GetNameExistsInfoPreparer(ctx, nameID, timeout) 9273 if err != nil { 9274 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNameExistsInfo", nil, "Failure preparing request") 9275 return 9276 } 9277 9278 resp, err := client.GetNameExistsInfoSender(req) 9279 if err != nil { 9280 result.Response = resp 9281 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNameExistsInfo", resp, "Failure sending request") 9282 return 9283 } 9284 9285 result, err = client.GetNameExistsInfoResponder(resp) 9286 if err != nil { 9287 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNameExistsInfo", resp, "Failure responding to request") 9288 } 9289 9290 return 9291} 9292 9293// GetNameExistsInfoPreparer prepares the GetNameExistsInfo request. 9294func (client BaseClient) GetNameExistsInfoPreparer(ctx context.Context, nameID string, timeout *int64) (*http.Request, error) { 9295 pathParameters := map[string]interface{}{ 9296 "nameId": nameID, 9297 } 9298 9299 const APIVersion = "6.0" 9300 queryParameters := map[string]interface{}{ 9301 "api-version": APIVersion, 9302 } 9303 if timeout != nil { 9304 queryParameters["timeout"] = autorest.Encode("query", *timeout) 9305 } else { 9306 queryParameters["timeout"] = autorest.Encode("query", 60) 9307 } 9308 9309 preparer := autorest.CreatePreparer( 9310 autorest.AsGet(), 9311 autorest.WithBaseURL(client.BaseURI), 9312 autorest.WithPathParameters("/Names/{nameId}", pathParameters), 9313 autorest.WithQueryParameters(queryParameters)) 9314 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 9315} 9316 9317// GetNameExistsInfoSender sends the GetNameExistsInfo request. The method will close the 9318// http.Response Body if it receives an error. 9319func (client BaseClient) GetNameExistsInfoSender(req *http.Request) (*http.Response, error) { 9320 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 9321 return autorest.SendWithSender(client, req, sd...) 9322} 9323 9324// GetNameExistsInfoResponder handles the response to the GetNameExistsInfo request. The method always 9325// closes the http.Response Body. 9326func (client BaseClient) GetNameExistsInfoResponder(resp *http.Response) (result autorest.Response, err error) { 9327 err = autorest.Respond( 9328 resp, 9329 client.ByInspecting(), 9330 azure.WithErrorUnlessStatusCode(http.StatusOK), 9331 autorest.ByClosing()) 9332 result.Response = resp 9333 return 9334} 9335 9336// GetNodeEventList the response is list of NodeEvent objects. 9337// Parameters: 9338// nodeName - the name of the node. 9339// startTimeUtc - the start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. 9340// endTimeUtc - the end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. 9341// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 9342// duration that the client is willing to wait for the requested operation to complete. The default value for 9343// this parameter is 60 seconds. 9344// eventsTypesFilter - this is a comma separated string specifying the types of FabricEvents that should only 9345// be included in the response. 9346// excludeAnalysisEvents - this param disables the retrieval of AnalysisEvents if true is passed. 9347// skipCorrelationLookup - this param disables the search of CorrelatedEvents information if true is passed. 9348// otherwise the CorrelationEvents get processed and HasCorrelatedEvents field in every FabricEvent gets 9349// populated. 9350func (client BaseClient) GetNodeEventList(ctx context.Context, nodeName string, startTimeUtc string, endTimeUtc string, timeout *int64, eventsTypesFilter string, excludeAnalysisEvents *bool, skipCorrelationLookup *bool) (result ListNodeEvent, err error) { 9351 if tracing.IsEnabled() { 9352 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetNodeEventList") 9353 defer func() { 9354 sc := -1 9355 if result.Response.Response != nil { 9356 sc = result.Response.Response.StatusCode 9357 } 9358 tracing.EndSpan(ctx, sc, err) 9359 }() 9360 } 9361 if err := validation.Validate([]validation.Validation{ 9362 {TargetValue: timeout, 9363 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 9364 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 9365 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 9366 }}}}}); err != nil { 9367 return result, validation.NewError("servicefabric.BaseClient", "GetNodeEventList", err.Error()) 9368 } 9369 9370 req, err := client.GetNodeEventListPreparer(ctx, nodeName, startTimeUtc, endTimeUtc, timeout, eventsTypesFilter, excludeAnalysisEvents, skipCorrelationLookup) 9371 if err != nil { 9372 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNodeEventList", nil, "Failure preparing request") 9373 return 9374 } 9375 9376 resp, err := client.GetNodeEventListSender(req) 9377 if err != nil { 9378 result.Response = autorest.Response{Response: resp} 9379 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNodeEventList", resp, "Failure sending request") 9380 return 9381 } 9382 9383 result, err = client.GetNodeEventListResponder(resp) 9384 if err != nil { 9385 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNodeEventList", resp, "Failure responding to request") 9386 } 9387 9388 return 9389} 9390 9391// GetNodeEventListPreparer prepares the GetNodeEventList request. 9392func (client BaseClient) GetNodeEventListPreparer(ctx context.Context, nodeName string, startTimeUtc string, endTimeUtc string, timeout *int64, eventsTypesFilter string, excludeAnalysisEvents *bool, skipCorrelationLookup *bool) (*http.Request, error) { 9393 pathParameters := map[string]interface{}{ 9394 "nodeName": autorest.Encode("path", nodeName), 9395 } 9396 9397 const APIVersion = "6.2-preview" 9398 queryParameters := map[string]interface{}{ 9399 "api-version": APIVersion, 9400 "EndTimeUtc": autorest.Encode("query", endTimeUtc), 9401 "StartTimeUtc": autorest.Encode("query", startTimeUtc), 9402 } 9403 if timeout != nil { 9404 queryParameters["timeout"] = autorest.Encode("query", *timeout) 9405 } else { 9406 queryParameters["timeout"] = autorest.Encode("query", 60) 9407 } 9408 if len(eventsTypesFilter) > 0 { 9409 queryParameters["EventsTypesFilter"] = autorest.Encode("query", eventsTypesFilter) 9410 } 9411 if excludeAnalysisEvents != nil { 9412 queryParameters["ExcludeAnalysisEvents"] = autorest.Encode("query", *excludeAnalysisEvents) 9413 } 9414 if skipCorrelationLookup != nil { 9415 queryParameters["SkipCorrelationLookup"] = autorest.Encode("query", *skipCorrelationLookup) 9416 } 9417 9418 preparer := autorest.CreatePreparer( 9419 autorest.AsGet(), 9420 autorest.WithBaseURL(client.BaseURI), 9421 autorest.WithPathParameters("/EventsStore/Nodes/{nodeName}/$/Events", pathParameters), 9422 autorest.WithQueryParameters(queryParameters)) 9423 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 9424} 9425 9426// GetNodeEventListSender sends the GetNodeEventList request. The method will close the 9427// http.Response Body if it receives an error. 9428func (client BaseClient) GetNodeEventListSender(req *http.Request) (*http.Response, error) { 9429 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 9430 return autorest.SendWithSender(client, req, sd...) 9431} 9432 9433// GetNodeEventListResponder handles the response to the GetNodeEventList request. The method always 9434// closes the http.Response Body. 9435func (client BaseClient) GetNodeEventListResponder(resp *http.Response) (result ListNodeEvent, err error) { 9436 err = autorest.Respond( 9437 resp, 9438 client.ByInspecting(), 9439 azure.WithErrorUnlessStatusCode(http.StatusOK), 9440 autorest.ByUnmarshallingJSON(&result), 9441 autorest.ByClosing()) 9442 result.Response = autorest.Response{Response: resp} 9443 return 9444} 9445 9446// GetNodeHealth gets the health of a Service Fabric node. Use EventsHealthStateFilter to filter the collection of 9447// health events reported on the node based on the health state. If the node that you specify by name does not exist in 9448// the health store, this returns an error. 9449// Parameters: 9450// nodeName - the name of the node. 9451// eventsHealthStateFilter - allows filtering the collection of HealthEvent objects returned based on health 9452// state. 9453// The possible values for this parameter include integer value of one of the following health states. 9454// Only events that match the filter are returned. All events are used to evaluate the aggregated health state. 9455// If not specified, all entries are returned. The state values are flag based enumeration, so the value could 9456// be a combination of these value obtained using bitwise 'OR' operator. For example, If the provided value is 9457// 6 then all of the events with HealthState value of OK (2) and Warning (4) are returned. 9458// 9459// - Default - Default value. Matches any HealthState. The value is zero. 9460// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given 9461// collection of states. The value is 1. 9462// - Ok - Filter that matches input with HealthState value Ok. The value is 2. 9463// - Warning - Filter that matches input with HealthState value Warning. The value is 4. 9464// - Error - Filter that matches input with HealthState value Error. The value is 8. 9465// - All - Filter that matches input with any HealthState value. The value is 65535. 9466// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 9467// duration that the client is willing to wait for the requested operation to complete. The default value for 9468// this parameter is 60 seconds. 9469func (client BaseClient) GetNodeHealth(ctx context.Context, nodeName string, eventsHealthStateFilter *int32, timeout *int64) (result NodeHealth, err error) { 9470 if tracing.IsEnabled() { 9471 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetNodeHealth") 9472 defer func() { 9473 sc := -1 9474 if result.Response.Response != nil { 9475 sc = result.Response.Response.StatusCode 9476 } 9477 tracing.EndSpan(ctx, sc, err) 9478 }() 9479 } 9480 if err := validation.Validate([]validation.Validation{ 9481 {TargetValue: timeout, 9482 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 9483 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 9484 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 9485 }}}}}); err != nil { 9486 return result, validation.NewError("servicefabric.BaseClient", "GetNodeHealth", err.Error()) 9487 } 9488 9489 req, err := client.GetNodeHealthPreparer(ctx, nodeName, eventsHealthStateFilter, timeout) 9490 if err != nil { 9491 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNodeHealth", nil, "Failure preparing request") 9492 return 9493 } 9494 9495 resp, err := client.GetNodeHealthSender(req) 9496 if err != nil { 9497 result.Response = autorest.Response{Response: resp} 9498 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNodeHealth", resp, "Failure sending request") 9499 return 9500 } 9501 9502 result, err = client.GetNodeHealthResponder(resp) 9503 if err != nil { 9504 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNodeHealth", resp, "Failure responding to request") 9505 } 9506 9507 return 9508} 9509 9510// GetNodeHealthPreparer prepares the GetNodeHealth request. 9511func (client BaseClient) GetNodeHealthPreparer(ctx context.Context, nodeName string, eventsHealthStateFilter *int32, timeout *int64) (*http.Request, error) { 9512 pathParameters := map[string]interface{}{ 9513 "nodeName": autorest.Encode("path", nodeName), 9514 } 9515 9516 const APIVersion = "6.0" 9517 queryParameters := map[string]interface{}{ 9518 "api-version": APIVersion, 9519 } 9520 if eventsHealthStateFilter != nil { 9521 queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", *eventsHealthStateFilter) 9522 } else { 9523 queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", 0) 9524 } 9525 if timeout != nil { 9526 queryParameters["timeout"] = autorest.Encode("query", *timeout) 9527 } else { 9528 queryParameters["timeout"] = autorest.Encode("query", 60) 9529 } 9530 9531 preparer := autorest.CreatePreparer( 9532 autorest.AsGet(), 9533 autorest.WithBaseURL(client.BaseURI), 9534 autorest.WithPathParameters("/Nodes/{nodeName}/$/GetHealth", pathParameters), 9535 autorest.WithQueryParameters(queryParameters)) 9536 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 9537} 9538 9539// GetNodeHealthSender sends the GetNodeHealth request. The method will close the 9540// http.Response Body if it receives an error. 9541func (client BaseClient) GetNodeHealthSender(req *http.Request) (*http.Response, error) { 9542 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 9543 return autorest.SendWithSender(client, req, sd...) 9544} 9545 9546// GetNodeHealthResponder handles the response to the GetNodeHealth request. The method always 9547// closes the http.Response Body. 9548func (client BaseClient) GetNodeHealthResponder(resp *http.Response) (result NodeHealth, err error) { 9549 err = autorest.Respond( 9550 resp, 9551 client.ByInspecting(), 9552 azure.WithErrorUnlessStatusCode(http.StatusOK), 9553 autorest.ByUnmarshallingJSON(&result), 9554 autorest.ByClosing()) 9555 result.Response = autorest.Response{Response: resp} 9556 return 9557} 9558 9559// GetNodeHealthUsingPolicy gets the health of a Service Fabric node. Use EventsHealthStateFilter to filter the 9560// collection of health events reported on the node based on the health state. Use ClusterHealthPolicy in the POST body 9561// to override the health policies used to evaluate the health. If the node that you specify by name does not exist in 9562// the health store, this returns an error. 9563// Parameters: 9564// nodeName - the name of the node. 9565// eventsHealthStateFilter - allows filtering the collection of HealthEvent objects returned based on health 9566// state. 9567// The possible values for this parameter include integer value of one of the following health states. 9568// Only events that match the filter are returned. All events are used to evaluate the aggregated health state. 9569// If not specified, all entries are returned. The state values are flag based enumeration, so the value could 9570// be a combination of these value obtained using bitwise 'OR' operator. For example, If the provided value is 9571// 6 then all of the events with HealthState value of OK (2) and Warning (4) are returned. 9572// 9573// - Default - Default value. Matches any HealthState. The value is zero. 9574// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given 9575// collection of states. The value is 1. 9576// - Ok - Filter that matches input with HealthState value Ok. The value is 2. 9577// - Warning - Filter that matches input with HealthState value Warning. The value is 4. 9578// - Error - Filter that matches input with HealthState value Error. The value is 8. 9579// - All - Filter that matches input with any HealthState value. The value is 65535. 9580// clusterHealthPolicy - describes the health policies used to evaluate the health of a cluster or node. If not 9581// present, the health evaluation uses the health policy from cluster manifest or the default health policy. 9582// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 9583// duration that the client is willing to wait for the requested operation to complete. The default value for 9584// this parameter is 60 seconds. 9585func (client BaseClient) GetNodeHealthUsingPolicy(ctx context.Context, nodeName string, eventsHealthStateFilter *int32, clusterHealthPolicy *ClusterHealthPolicy, timeout *int64) (result NodeHealth, err error) { 9586 if tracing.IsEnabled() { 9587 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetNodeHealthUsingPolicy") 9588 defer func() { 9589 sc := -1 9590 if result.Response.Response != nil { 9591 sc = result.Response.Response.StatusCode 9592 } 9593 tracing.EndSpan(ctx, sc, err) 9594 }() 9595 } 9596 if err := validation.Validate([]validation.Validation{ 9597 {TargetValue: timeout, 9598 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 9599 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 9600 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 9601 }}}}}); err != nil { 9602 return result, validation.NewError("servicefabric.BaseClient", "GetNodeHealthUsingPolicy", err.Error()) 9603 } 9604 9605 req, err := client.GetNodeHealthUsingPolicyPreparer(ctx, nodeName, eventsHealthStateFilter, clusterHealthPolicy, timeout) 9606 if err != nil { 9607 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNodeHealthUsingPolicy", nil, "Failure preparing request") 9608 return 9609 } 9610 9611 resp, err := client.GetNodeHealthUsingPolicySender(req) 9612 if err != nil { 9613 result.Response = autorest.Response{Response: resp} 9614 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNodeHealthUsingPolicy", resp, "Failure sending request") 9615 return 9616 } 9617 9618 result, err = client.GetNodeHealthUsingPolicyResponder(resp) 9619 if err != nil { 9620 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNodeHealthUsingPolicy", resp, "Failure responding to request") 9621 } 9622 9623 return 9624} 9625 9626// GetNodeHealthUsingPolicyPreparer prepares the GetNodeHealthUsingPolicy request. 9627func (client BaseClient) GetNodeHealthUsingPolicyPreparer(ctx context.Context, nodeName string, eventsHealthStateFilter *int32, clusterHealthPolicy *ClusterHealthPolicy, timeout *int64) (*http.Request, error) { 9628 pathParameters := map[string]interface{}{ 9629 "nodeName": autorest.Encode("path", nodeName), 9630 } 9631 9632 const APIVersion = "6.0" 9633 queryParameters := map[string]interface{}{ 9634 "api-version": APIVersion, 9635 } 9636 if eventsHealthStateFilter != nil { 9637 queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", *eventsHealthStateFilter) 9638 } else { 9639 queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", 0) 9640 } 9641 if timeout != nil { 9642 queryParameters["timeout"] = autorest.Encode("query", *timeout) 9643 } else { 9644 queryParameters["timeout"] = autorest.Encode("query", 60) 9645 } 9646 9647 preparer := autorest.CreatePreparer( 9648 autorest.AsContentType("application/json; charset=utf-8"), 9649 autorest.AsPost(), 9650 autorest.WithBaseURL(client.BaseURI), 9651 autorest.WithPathParameters("/Nodes/{nodeName}/$/GetHealth", pathParameters), 9652 autorest.WithQueryParameters(queryParameters)) 9653 if clusterHealthPolicy != nil { 9654 preparer = autorest.DecoratePreparer(preparer, 9655 autorest.WithJSON(clusterHealthPolicy)) 9656 } 9657 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 9658} 9659 9660// GetNodeHealthUsingPolicySender sends the GetNodeHealthUsingPolicy request. The method will close the 9661// http.Response Body if it receives an error. 9662func (client BaseClient) GetNodeHealthUsingPolicySender(req *http.Request) (*http.Response, error) { 9663 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 9664 return autorest.SendWithSender(client, req, sd...) 9665} 9666 9667// GetNodeHealthUsingPolicyResponder handles the response to the GetNodeHealthUsingPolicy request. The method always 9668// closes the http.Response Body. 9669func (client BaseClient) GetNodeHealthUsingPolicyResponder(resp *http.Response) (result NodeHealth, err error) { 9670 err = autorest.Respond( 9671 resp, 9672 client.ByInspecting(), 9673 azure.WithErrorUnlessStatusCode(http.StatusOK), 9674 autorest.ByUnmarshallingJSON(&result), 9675 autorest.ByClosing()) 9676 result.Response = autorest.Response{Response: resp} 9677 return 9678} 9679 9680// GetNodeInfo gets the information about a specific node in the Service Fabric Cluster. The response includes the 9681// name, status, id, health, uptime, and other details about the node. 9682// Parameters: 9683// nodeName - the name of the node. 9684// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 9685// duration that the client is willing to wait for the requested operation to complete. The default value for 9686// this parameter is 60 seconds. 9687func (client BaseClient) GetNodeInfo(ctx context.Context, nodeName string, timeout *int64) (result NodeInfo, err error) { 9688 if tracing.IsEnabled() { 9689 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetNodeInfo") 9690 defer func() { 9691 sc := -1 9692 if result.Response.Response != nil { 9693 sc = result.Response.Response.StatusCode 9694 } 9695 tracing.EndSpan(ctx, sc, err) 9696 }() 9697 } 9698 if err := validation.Validate([]validation.Validation{ 9699 {TargetValue: timeout, 9700 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 9701 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 9702 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 9703 }}}}}); err != nil { 9704 return result, validation.NewError("servicefabric.BaseClient", "GetNodeInfo", err.Error()) 9705 } 9706 9707 req, err := client.GetNodeInfoPreparer(ctx, nodeName, timeout) 9708 if err != nil { 9709 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNodeInfo", nil, "Failure preparing request") 9710 return 9711 } 9712 9713 resp, err := client.GetNodeInfoSender(req) 9714 if err != nil { 9715 result.Response = autorest.Response{Response: resp} 9716 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNodeInfo", resp, "Failure sending request") 9717 return 9718 } 9719 9720 result, err = client.GetNodeInfoResponder(resp) 9721 if err != nil { 9722 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNodeInfo", resp, "Failure responding to request") 9723 } 9724 9725 return 9726} 9727 9728// GetNodeInfoPreparer prepares the GetNodeInfo request. 9729func (client BaseClient) GetNodeInfoPreparer(ctx context.Context, nodeName string, timeout *int64) (*http.Request, error) { 9730 pathParameters := map[string]interface{}{ 9731 "nodeName": autorest.Encode("path", nodeName), 9732 } 9733 9734 const APIVersion = "6.0" 9735 queryParameters := map[string]interface{}{ 9736 "api-version": APIVersion, 9737 } 9738 if timeout != nil { 9739 queryParameters["timeout"] = autorest.Encode("query", *timeout) 9740 } else { 9741 queryParameters["timeout"] = autorest.Encode("query", 60) 9742 } 9743 9744 preparer := autorest.CreatePreparer( 9745 autorest.AsGet(), 9746 autorest.WithBaseURL(client.BaseURI), 9747 autorest.WithPathParameters("/Nodes/{nodeName}", pathParameters), 9748 autorest.WithQueryParameters(queryParameters)) 9749 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 9750} 9751 9752// GetNodeInfoSender sends the GetNodeInfo request. The method will close the 9753// http.Response Body if it receives an error. 9754func (client BaseClient) GetNodeInfoSender(req *http.Request) (*http.Response, error) { 9755 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 9756 return autorest.SendWithSender(client, req, sd...) 9757} 9758 9759// GetNodeInfoResponder handles the response to the GetNodeInfo request. The method always 9760// closes the http.Response Body. 9761func (client BaseClient) GetNodeInfoResponder(resp *http.Response) (result NodeInfo, err error) { 9762 err = autorest.Respond( 9763 resp, 9764 client.ByInspecting(), 9765 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), 9766 autorest.ByUnmarshallingJSON(&result), 9767 autorest.ByClosing()) 9768 result.Response = autorest.Response{Response: resp} 9769 return 9770} 9771 9772// GetNodeInfoList gets the list of nodes in the Service Fabric cluster. The response includes the name, status, id, 9773// health, uptime, and other details about the node. 9774// Parameters: 9775// continuationToken - the continuation token parameter is used to obtain next set of results. A continuation 9776// token with a non empty value is included in the response of the API when the results from the system do not 9777// fit in a single response. When this value is passed to the next API call, the API returns next set of 9778// results. If there are no further results then the continuation token does not contain a value. The value of 9779// this parameter should not be URL encoded. 9780// nodeStatusFilter - allows filtering the nodes based on the NodeStatus. Only the nodes that are matching the 9781// specified filter value will be returned. The filter value can be one of the following. 9782// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 9783// duration that the client is willing to wait for the requested operation to complete. The default value for 9784// this parameter is 60 seconds. 9785func (client BaseClient) GetNodeInfoList(ctx context.Context, continuationToken string, nodeStatusFilter NodeStatusFilter, timeout *int64) (result PagedNodeInfoList, err error) { 9786 if tracing.IsEnabled() { 9787 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetNodeInfoList") 9788 defer func() { 9789 sc := -1 9790 if result.Response.Response != nil { 9791 sc = result.Response.Response.StatusCode 9792 } 9793 tracing.EndSpan(ctx, sc, err) 9794 }() 9795 } 9796 if err := validation.Validate([]validation.Validation{ 9797 {TargetValue: timeout, 9798 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 9799 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 9800 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 9801 }}}}}); err != nil { 9802 return result, validation.NewError("servicefabric.BaseClient", "GetNodeInfoList", err.Error()) 9803 } 9804 9805 req, err := client.GetNodeInfoListPreparer(ctx, continuationToken, nodeStatusFilter, timeout) 9806 if err != nil { 9807 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNodeInfoList", nil, "Failure preparing request") 9808 return 9809 } 9810 9811 resp, err := client.GetNodeInfoListSender(req) 9812 if err != nil { 9813 result.Response = autorest.Response{Response: resp} 9814 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNodeInfoList", resp, "Failure sending request") 9815 return 9816 } 9817 9818 result, err = client.GetNodeInfoListResponder(resp) 9819 if err != nil { 9820 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNodeInfoList", resp, "Failure responding to request") 9821 } 9822 9823 return 9824} 9825 9826// GetNodeInfoListPreparer prepares the GetNodeInfoList request. 9827func (client BaseClient) GetNodeInfoListPreparer(ctx context.Context, continuationToken string, nodeStatusFilter NodeStatusFilter, timeout *int64) (*http.Request, error) { 9828 const APIVersion = "6.0" 9829 queryParameters := map[string]interface{}{ 9830 "api-version": APIVersion, 9831 } 9832 if len(continuationToken) > 0 { 9833 queryParameters["ContinuationToken"] = continuationToken 9834 } 9835 if len(string(nodeStatusFilter)) > 0 { 9836 queryParameters["NodeStatusFilter"] = autorest.Encode("query", nodeStatusFilter) 9837 } else { 9838 queryParameters["NodeStatusFilter"] = autorest.Encode("query", "default") 9839 } 9840 if timeout != nil { 9841 queryParameters["timeout"] = autorest.Encode("query", *timeout) 9842 } else { 9843 queryParameters["timeout"] = autorest.Encode("query", 60) 9844 } 9845 9846 preparer := autorest.CreatePreparer( 9847 autorest.AsGet(), 9848 autorest.WithBaseURL(client.BaseURI), 9849 autorest.WithPath("/Nodes"), 9850 autorest.WithQueryParameters(queryParameters)) 9851 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 9852} 9853 9854// GetNodeInfoListSender sends the GetNodeInfoList request. The method will close the 9855// http.Response Body if it receives an error. 9856func (client BaseClient) GetNodeInfoListSender(req *http.Request) (*http.Response, error) { 9857 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 9858 return autorest.SendWithSender(client, req, sd...) 9859} 9860 9861// GetNodeInfoListResponder handles the response to the GetNodeInfoList request. The method always 9862// closes the http.Response Body. 9863func (client BaseClient) GetNodeInfoListResponder(resp *http.Response) (result PagedNodeInfoList, err error) { 9864 err = autorest.Respond( 9865 resp, 9866 client.ByInspecting(), 9867 azure.WithErrorUnlessStatusCode(http.StatusOK), 9868 autorest.ByUnmarshallingJSON(&result), 9869 autorest.ByClosing()) 9870 result.Response = autorest.Response{Response: resp} 9871 return 9872} 9873 9874// GetNodeLoadInfo retrieves the load information of a Service Fabric node for all the metrics that have load or 9875// capacity defined. 9876// Parameters: 9877// nodeName - the name of the node. 9878// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 9879// duration that the client is willing to wait for the requested operation to complete. The default value for 9880// this parameter is 60 seconds. 9881func (client BaseClient) GetNodeLoadInfo(ctx context.Context, nodeName string, timeout *int64) (result NodeLoadInfo, err error) { 9882 if tracing.IsEnabled() { 9883 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetNodeLoadInfo") 9884 defer func() { 9885 sc := -1 9886 if result.Response.Response != nil { 9887 sc = result.Response.Response.StatusCode 9888 } 9889 tracing.EndSpan(ctx, sc, err) 9890 }() 9891 } 9892 if err := validation.Validate([]validation.Validation{ 9893 {TargetValue: timeout, 9894 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 9895 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 9896 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 9897 }}}}}); err != nil { 9898 return result, validation.NewError("servicefabric.BaseClient", "GetNodeLoadInfo", err.Error()) 9899 } 9900 9901 req, err := client.GetNodeLoadInfoPreparer(ctx, nodeName, timeout) 9902 if err != nil { 9903 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNodeLoadInfo", nil, "Failure preparing request") 9904 return 9905 } 9906 9907 resp, err := client.GetNodeLoadInfoSender(req) 9908 if err != nil { 9909 result.Response = autorest.Response{Response: resp} 9910 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNodeLoadInfo", resp, "Failure sending request") 9911 return 9912 } 9913 9914 result, err = client.GetNodeLoadInfoResponder(resp) 9915 if err != nil { 9916 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNodeLoadInfo", resp, "Failure responding to request") 9917 } 9918 9919 return 9920} 9921 9922// GetNodeLoadInfoPreparer prepares the GetNodeLoadInfo request. 9923func (client BaseClient) GetNodeLoadInfoPreparer(ctx context.Context, nodeName string, timeout *int64) (*http.Request, error) { 9924 pathParameters := map[string]interface{}{ 9925 "nodeName": autorest.Encode("path", nodeName), 9926 } 9927 9928 const APIVersion = "6.0" 9929 queryParameters := map[string]interface{}{ 9930 "api-version": APIVersion, 9931 } 9932 if timeout != nil { 9933 queryParameters["timeout"] = autorest.Encode("query", *timeout) 9934 } else { 9935 queryParameters["timeout"] = autorest.Encode("query", 60) 9936 } 9937 9938 preparer := autorest.CreatePreparer( 9939 autorest.AsGet(), 9940 autorest.WithBaseURL(client.BaseURI), 9941 autorest.WithPathParameters("/Nodes/{nodeName}/$/GetLoadInformation", pathParameters), 9942 autorest.WithQueryParameters(queryParameters)) 9943 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 9944} 9945 9946// GetNodeLoadInfoSender sends the GetNodeLoadInfo request. The method will close the 9947// http.Response Body if it receives an error. 9948func (client BaseClient) GetNodeLoadInfoSender(req *http.Request) (*http.Response, error) { 9949 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 9950 return autorest.SendWithSender(client, req, sd...) 9951} 9952 9953// GetNodeLoadInfoResponder handles the response to the GetNodeLoadInfo request. The method always 9954// closes the http.Response Body. 9955func (client BaseClient) GetNodeLoadInfoResponder(resp *http.Response) (result NodeLoadInfo, err error) { 9956 err = autorest.Respond( 9957 resp, 9958 client.ByInspecting(), 9959 azure.WithErrorUnlessStatusCode(http.StatusOK), 9960 autorest.ByUnmarshallingJSON(&result), 9961 autorest.ByClosing()) 9962 result.Response = autorest.Response{Response: resp} 9963 return 9964} 9965 9966// GetNodesEventList the response is list of NodeEvent objects. 9967// Parameters: 9968// startTimeUtc - the start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. 9969// endTimeUtc - the end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. 9970// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 9971// duration that the client is willing to wait for the requested operation to complete. The default value for 9972// this parameter is 60 seconds. 9973// eventsTypesFilter - this is a comma separated string specifying the types of FabricEvents that should only 9974// be included in the response. 9975// excludeAnalysisEvents - this param disables the retrieval of AnalysisEvents if true is passed. 9976// skipCorrelationLookup - this param disables the search of CorrelatedEvents information if true is passed. 9977// otherwise the CorrelationEvents get processed and HasCorrelatedEvents field in every FabricEvent gets 9978// populated. 9979func (client BaseClient) GetNodesEventList(ctx context.Context, startTimeUtc string, endTimeUtc string, timeout *int64, eventsTypesFilter string, excludeAnalysisEvents *bool, skipCorrelationLookup *bool) (result ListNodeEvent, err error) { 9980 if tracing.IsEnabled() { 9981 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetNodesEventList") 9982 defer func() { 9983 sc := -1 9984 if result.Response.Response != nil { 9985 sc = result.Response.Response.StatusCode 9986 } 9987 tracing.EndSpan(ctx, sc, err) 9988 }() 9989 } 9990 if err := validation.Validate([]validation.Validation{ 9991 {TargetValue: timeout, 9992 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 9993 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 9994 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 9995 }}}}}); err != nil { 9996 return result, validation.NewError("servicefabric.BaseClient", "GetNodesEventList", err.Error()) 9997 } 9998 9999 req, err := client.GetNodesEventListPreparer(ctx, startTimeUtc, endTimeUtc, timeout, eventsTypesFilter, excludeAnalysisEvents, skipCorrelationLookup) 10000 if err != nil { 10001 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNodesEventList", nil, "Failure preparing request") 10002 return 10003 } 10004 10005 resp, err := client.GetNodesEventListSender(req) 10006 if err != nil { 10007 result.Response = autorest.Response{Response: resp} 10008 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNodesEventList", resp, "Failure sending request") 10009 return 10010 } 10011 10012 result, err = client.GetNodesEventListResponder(resp) 10013 if err != nil { 10014 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNodesEventList", resp, "Failure responding to request") 10015 } 10016 10017 return 10018} 10019 10020// GetNodesEventListPreparer prepares the GetNodesEventList request. 10021func (client BaseClient) GetNodesEventListPreparer(ctx context.Context, startTimeUtc string, endTimeUtc string, timeout *int64, eventsTypesFilter string, excludeAnalysisEvents *bool, skipCorrelationLookup *bool) (*http.Request, error) { 10022 const APIVersion = "6.2-preview" 10023 queryParameters := map[string]interface{}{ 10024 "api-version": APIVersion, 10025 "EndTimeUtc": autorest.Encode("query", endTimeUtc), 10026 "StartTimeUtc": autorest.Encode("query", startTimeUtc), 10027 } 10028 if timeout != nil { 10029 queryParameters["timeout"] = autorest.Encode("query", *timeout) 10030 } else { 10031 queryParameters["timeout"] = autorest.Encode("query", 60) 10032 } 10033 if len(eventsTypesFilter) > 0 { 10034 queryParameters["EventsTypesFilter"] = autorest.Encode("query", eventsTypesFilter) 10035 } 10036 if excludeAnalysisEvents != nil { 10037 queryParameters["ExcludeAnalysisEvents"] = autorest.Encode("query", *excludeAnalysisEvents) 10038 } 10039 if skipCorrelationLookup != nil { 10040 queryParameters["SkipCorrelationLookup"] = autorest.Encode("query", *skipCorrelationLookup) 10041 } 10042 10043 preparer := autorest.CreatePreparer( 10044 autorest.AsGet(), 10045 autorest.WithBaseURL(client.BaseURI), 10046 autorest.WithPath("/EventsStore/Nodes/Events"), 10047 autorest.WithQueryParameters(queryParameters)) 10048 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 10049} 10050 10051// GetNodesEventListSender sends the GetNodesEventList request. The method will close the 10052// http.Response Body if it receives an error. 10053func (client BaseClient) GetNodesEventListSender(req *http.Request) (*http.Response, error) { 10054 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 10055 return autorest.SendWithSender(client, req, sd...) 10056} 10057 10058// GetNodesEventListResponder handles the response to the GetNodesEventList request. The method always 10059// closes the http.Response Body. 10060func (client BaseClient) GetNodesEventListResponder(resp *http.Response) (result ListNodeEvent, err error) { 10061 err = autorest.Respond( 10062 resp, 10063 client.ByInspecting(), 10064 azure.WithErrorUnlessStatusCode(http.StatusOK), 10065 autorest.ByUnmarshallingJSON(&result), 10066 autorest.ByClosing()) 10067 result.Response = autorest.Response{Response: resp} 10068 return 10069} 10070 10071// GetNodeTransitionProgress gets the progress of an operation started with StartNodeTransition using the provided 10072// OperationId. 10073// Parameters: 10074// nodeName - the name of the node. 10075// operationID - a GUID that identifies a call of this API. This is passed into the corresponding GetProgress 10076// API 10077// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 10078// duration that the client is willing to wait for the requested operation to complete. The default value for 10079// this parameter is 60 seconds. 10080func (client BaseClient) GetNodeTransitionProgress(ctx context.Context, nodeName string, operationID uuid.UUID, timeout *int64) (result NodeTransitionProgress, err error) { 10081 if tracing.IsEnabled() { 10082 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetNodeTransitionProgress") 10083 defer func() { 10084 sc := -1 10085 if result.Response.Response != nil { 10086 sc = result.Response.Response.StatusCode 10087 } 10088 tracing.EndSpan(ctx, sc, err) 10089 }() 10090 } 10091 if err := validation.Validate([]validation.Validation{ 10092 {TargetValue: timeout, 10093 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 10094 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 10095 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 10096 }}}}}); err != nil { 10097 return result, validation.NewError("servicefabric.BaseClient", "GetNodeTransitionProgress", err.Error()) 10098 } 10099 10100 req, err := client.GetNodeTransitionProgressPreparer(ctx, nodeName, operationID, timeout) 10101 if err != nil { 10102 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNodeTransitionProgress", nil, "Failure preparing request") 10103 return 10104 } 10105 10106 resp, err := client.GetNodeTransitionProgressSender(req) 10107 if err != nil { 10108 result.Response = autorest.Response{Response: resp} 10109 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNodeTransitionProgress", resp, "Failure sending request") 10110 return 10111 } 10112 10113 result, err = client.GetNodeTransitionProgressResponder(resp) 10114 if err != nil { 10115 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNodeTransitionProgress", resp, "Failure responding to request") 10116 } 10117 10118 return 10119} 10120 10121// GetNodeTransitionProgressPreparer prepares the GetNodeTransitionProgress request. 10122func (client BaseClient) GetNodeTransitionProgressPreparer(ctx context.Context, nodeName string, operationID uuid.UUID, timeout *int64) (*http.Request, error) { 10123 pathParameters := map[string]interface{}{ 10124 "nodeName": autorest.Encode("path", nodeName), 10125 } 10126 10127 const APIVersion = "6.0" 10128 queryParameters := map[string]interface{}{ 10129 "api-version": APIVersion, 10130 "OperationId": autorest.Encode("query", operationID), 10131 } 10132 if timeout != nil { 10133 queryParameters["timeout"] = autorest.Encode("query", *timeout) 10134 } else { 10135 queryParameters["timeout"] = autorest.Encode("query", 60) 10136 } 10137 10138 preparer := autorest.CreatePreparer( 10139 autorest.AsGet(), 10140 autorest.WithBaseURL(client.BaseURI), 10141 autorest.WithPathParameters("/Faults/Nodes/{nodeName}/$/GetTransitionProgress", pathParameters), 10142 autorest.WithQueryParameters(queryParameters)) 10143 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 10144} 10145 10146// GetNodeTransitionProgressSender sends the GetNodeTransitionProgress request. The method will close the 10147// http.Response Body if it receives an error. 10148func (client BaseClient) GetNodeTransitionProgressSender(req *http.Request) (*http.Response, error) { 10149 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 10150 return autorest.SendWithSender(client, req, sd...) 10151} 10152 10153// GetNodeTransitionProgressResponder handles the response to the GetNodeTransitionProgress request. The method always 10154// closes the http.Response Body. 10155func (client BaseClient) GetNodeTransitionProgressResponder(resp *http.Response) (result NodeTransitionProgress, err error) { 10156 err = autorest.Respond( 10157 resp, 10158 client.ByInspecting(), 10159 azure.WithErrorUnlessStatusCode(http.StatusOK), 10160 autorest.ByUnmarshallingJSON(&result), 10161 autorest.ByClosing()) 10162 result.Response = autorest.Response{Response: resp} 10163 return 10164} 10165 10166// GetPartitionBackupConfigurationInfo gets the Service Fabric Backup configuration information for the specified 10167// partition. 10168// Parameters: 10169// partitionID - the identity of the partition. 10170// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 10171// duration that the client is willing to wait for the requested operation to complete. The default value for 10172// this parameter is 60 seconds. 10173func (client BaseClient) GetPartitionBackupConfigurationInfo(ctx context.Context, partitionID uuid.UUID, timeout *int64) (result PartitionBackupConfigurationInfo, err error) { 10174 if tracing.IsEnabled() { 10175 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetPartitionBackupConfigurationInfo") 10176 defer func() { 10177 sc := -1 10178 if result.Response.Response != nil { 10179 sc = result.Response.Response.StatusCode 10180 } 10181 tracing.EndSpan(ctx, sc, err) 10182 }() 10183 } 10184 if err := validation.Validate([]validation.Validation{ 10185 {TargetValue: timeout, 10186 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 10187 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 10188 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 10189 }}}}}); err != nil { 10190 return result, validation.NewError("servicefabric.BaseClient", "GetPartitionBackupConfigurationInfo", err.Error()) 10191 } 10192 10193 req, err := client.GetPartitionBackupConfigurationInfoPreparer(ctx, partitionID, timeout) 10194 if err != nil { 10195 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionBackupConfigurationInfo", nil, "Failure preparing request") 10196 return 10197 } 10198 10199 resp, err := client.GetPartitionBackupConfigurationInfoSender(req) 10200 if err != nil { 10201 result.Response = autorest.Response{Response: resp} 10202 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionBackupConfigurationInfo", resp, "Failure sending request") 10203 return 10204 } 10205 10206 result, err = client.GetPartitionBackupConfigurationInfoResponder(resp) 10207 if err != nil { 10208 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionBackupConfigurationInfo", resp, "Failure responding to request") 10209 } 10210 10211 return 10212} 10213 10214// GetPartitionBackupConfigurationInfoPreparer prepares the GetPartitionBackupConfigurationInfo request. 10215func (client BaseClient) GetPartitionBackupConfigurationInfoPreparer(ctx context.Context, partitionID uuid.UUID, timeout *int64) (*http.Request, error) { 10216 pathParameters := map[string]interface{}{ 10217 "partitionId": partitionID, 10218 } 10219 10220 const APIVersion = "6.2-preview" 10221 queryParameters := map[string]interface{}{ 10222 "api-version": APIVersion, 10223 } 10224 if timeout != nil { 10225 queryParameters["timeout"] = autorest.Encode("query", *timeout) 10226 } else { 10227 queryParameters["timeout"] = autorest.Encode("query", 60) 10228 } 10229 10230 preparer := autorest.CreatePreparer( 10231 autorest.AsGet(), 10232 autorest.WithBaseURL(client.BaseURI), 10233 autorest.WithPathParameters("/Partitions/{partitionId}/$/GetBackupConfigurationInfo", pathParameters), 10234 autorest.WithQueryParameters(queryParameters)) 10235 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 10236} 10237 10238// GetPartitionBackupConfigurationInfoSender sends the GetPartitionBackupConfigurationInfo request. The method will close the 10239// http.Response Body if it receives an error. 10240func (client BaseClient) GetPartitionBackupConfigurationInfoSender(req *http.Request) (*http.Response, error) { 10241 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 10242 return autorest.SendWithSender(client, req, sd...) 10243} 10244 10245// GetPartitionBackupConfigurationInfoResponder handles the response to the GetPartitionBackupConfigurationInfo request. The method always 10246// closes the http.Response Body. 10247func (client BaseClient) GetPartitionBackupConfigurationInfoResponder(resp *http.Response) (result PartitionBackupConfigurationInfo, err error) { 10248 err = autorest.Respond( 10249 resp, 10250 client.ByInspecting(), 10251 azure.WithErrorUnlessStatusCode(http.StatusOK), 10252 autorest.ByUnmarshallingJSON(&result), 10253 autorest.ByClosing()) 10254 result.Response = autorest.Response{Response: resp} 10255 return 10256} 10257 10258// GetPartitionBackupList returns a list of backups available for the specified partition. The server enumerates all 10259// the backups available in the backup store configured in the backup policy. It also allows filtering of the result 10260// based on start and end datetime or just fetching the latest available backup for the partition. 10261// Parameters: 10262// partitionID - the identity of the partition. 10263// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 10264// duration that the client is willing to wait for the requested operation to complete. The default value for 10265// this parameter is 60 seconds. 10266// latest - specifies whether to get only the most recent backup available for a partition for the specified 10267// time range. 10268// startDateTimeFilter - specify the start date time from which to enumerate backups, in datetime format. The 10269// date time must be specified in ISO8601 format. This is an optional parameter. If not specified, all backups 10270// from the beginning are enumerated. 10271// endDateTimeFilter - specify the end date time till which to enumerate backups, in datetime format. The date 10272// time must be specified in ISO8601 format. This is an optional parameter. If not specified, enumeration is 10273// done till the most recent backup. 10274func (client BaseClient) GetPartitionBackupList(ctx context.Context, partitionID uuid.UUID, timeout *int64, latest *bool, startDateTimeFilter *date.Time, endDateTimeFilter *date.Time) (result PagedBackupInfoList, err error) { 10275 if tracing.IsEnabled() { 10276 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetPartitionBackupList") 10277 defer func() { 10278 sc := -1 10279 if result.Response.Response != nil { 10280 sc = result.Response.Response.StatusCode 10281 } 10282 tracing.EndSpan(ctx, sc, err) 10283 }() 10284 } 10285 if err := validation.Validate([]validation.Validation{ 10286 {TargetValue: timeout, 10287 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 10288 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 10289 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 10290 }}}}}); err != nil { 10291 return result, validation.NewError("servicefabric.BaseClient", "GetPartitionBackupList", err.Error()) 10292 } 10293 10294 req, err := client.GetPartitionBackupListPreparer(ctx, partitionID, timeout, latest, startDateTimeFilter, endDateTimeFilter) 10295 if err != nil { 10296 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionBackupList", nil, "Failure preparing request") 10297 return 10298 } 10299 10300 resp, err := client.GetPartitionBackupListSender(req) 10301 if err != nil { 10302 result.Response = autorest.Response{Response: resp} 10303 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionBackupList", resp, "Failure sending request") 10304 return 10305 } 10306 10307 result, err = client.GetPartitionBackupListResponder(resp) 10308 if err != nil { 10309 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionBackupList", resp, "Failure responding to request") 10310 } 10311 10312 return 10313} 10314 10315// GetPartitionBackupListPreparer prepares the GetPartitionBackupList request. 10316func (client BaseClient) GetPartitionBackupListPreparer(ctx context.Context, partitionID uuid.UUID, timeout *int64, latest *bool, startDateTimeFilter *date.Time, endDateTimeFilter *date.Time) (*http.Request, error) { 10317 pathParameters := map[string]interface{}{ 10318 "partitionId": partitionID, 10319 } 10320 10321 const APIVersion = "6.2-preview" 10322 queryParameters := map[string]interface{}{ 10323 "api-version": APIVersion, 10324 } 10325 if timeout != nil { 10326 queryParameters["timeout"] = autorest.Encode("query", *timeout) 10327 } else { 10328 queryParameters["timeout"] = autorest.Encode("query", 60) 10329 } 10330 if latest != nil { 10331 queryParameters["Latest"] = autorest.Encode("query", *latest) 10332 } else { 10333 queryParameters["Latest"] = autorest.Encode("query", false) 10334 } 10335 if startDateTimeFilter != nil { 10336 queryParameters["StartDateTimeFilter"] = autorest.Encode("query", *startDateTimeFilter) 10337 } 10338 if endDateTimeFilter != nil { 10339 queryParameters["EndDateTimeFilter"] = autorest.Encode("query", *endDateTimeFilter) 10340 } 10341 10342 preparer := autorest.CreatePreparer( 10343 autorest.AsGet(), 10344 autorest.WithBaseURL(client.BaseURI), 10345 autorest.WithPathParameters("/Partitions/{partitionId}/$/GetBackups", pathParameters), 10346 autorest.WithQueryParameters(queryParameters)) 10347 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 10348} 10349 10350// GetPartitionBackupListSender sends the GetPartitionBackupList request. The method will close the 10351// http.Response Body if it receives an error. 10352func (client BaseClient) GetPartitionBackupListSender(req *http.Request) (*http.Response, error) { 10353 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 10354 return autorest.SendWithSender(client, req, sd...) 10355} 10356 10357// GetPartitionBackupListResponder handles the response to the GetPartitionBackupList request. The method always 10358// closes the http.Response Body. 10359func (client BaseClient) GetPartitionBackupListResponder(resp *http.Response) (result PagedBackupInfoList, err error) { 10360 err = autorest.Respond( 10361 resp, 10362 client.ByInspecting(), 10363 azure.WithErrorUnlessStatusCode(http.StatusOK), 10364 autorest.ByUnmarshallingJSON(&result), 10365 autorest.ByClosing()) 10366 result.Response = autorest.Response{Response: resp} 10367 return 10368} 10369 10370// GetPartitionBackupProgress returns information about the state of the latest backup along with details or failure 10371// reason in case of completion. 10372// Parameters: 10373// partitionID - the identity of the partition. 10374// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 10375// duration that the client is willing to wait for the requested operation to complete. The default value for 10376// this parameter is 60 seconds. 10377func (client BaseClient) GetPartitionBackupProgress(ctx context.Context, partitionID uuid.UUID, timeout *int64) (result BackupProgressInfo, err error) { 10378 if tracing.IsEnabled() { 10379 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetPartitionBackupProgress") 10380 defer func() { 10381 sc := -1 10382 if result.Response.Response != nil { 10383 sc = result.Response.Response.StatusCode 10384 } 10385 tracing.EndSpan(ctx, sc, err) 10386 }() 10387 } 10388 if err := validation.Validate([]validation.Validation{ 10389 {TargetValue: timeout, 10390 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 10391 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 10392 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 10393 }}}}}); err != nil { 10394 return result, validation.NewError("servicefabric.BaseClient", "GetPartitionBackupProgress", err.Error()) 10395 } 10396 10397 req, err := client.GetPartitionBackupProgressPreparer(ctx, partitionID, timeout) 10398 if err != nil { 10399 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionBackupProgress", nil, "Failure preparing request") 10400 return 10401 } 10402 10403 resp, err := client.GetPartitionBackupProgressSender(req) 10404 if err != nil { 10405 result.Response = autorest.Response{Response: resp} 10406 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionBackupProgress", resp, "Failure sending request") 10407 return 10408 } 10409 10410 result, err = client.GetPartitionBackupProgressResponder(resp) 10411 if err != nil { 10412 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionBackupProgress", resp, "Failure responding to request") 10413 } 10414 10415 return 10416} 10417 10418// GetPartitionBackupProgressPreparer prepares the GetPartitionBackupProgress request. 10419func (client BaseClient) GetPartitionBackupProgressPreparer(ctx context.Context, partitionID uuid.UUID, timeout *int64) (*http.Request, error) { 10420 pathParameters := map[string]interface{}{ 10421 "partitionId": partitionID, 10422 } 10423 10424 const APIVersion = "6.2-preview" 10425 queryParameters := map[string]interface{}{ 10426 "api-version": APIVersion, 10427 } 10428 if timeout != nil { 10429 queryParameters["timeout"] = autorest.Encode("query", *timeout) 10430 } else { 10431 queryParameters["timeout"] = autorest.Encode("query", 60) 10432 } 10433 10434 preparer := autorest.CreatePreparer( 10435 autorest.AsGet(), 10436 autorest.WithBaseURL(client.BaseURI), 10437 autorest.WithPathParameters("/Partitions/{partitionId}/$/GetBackupProgress", pathParameters), 10438 autorest.WithQueryParameters(queryParameters)) 10439 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 10440} 10441 10442// GetPartitionBackupProgressSender sends the GetPartitionBackupProgress request. The method will close the 10443// http.Response Body if it receives an error. 10444func (client BaseClient) GetPartitionBackupProgressSender(req *http.Request) (*http.Response, error) { 10445 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 10446 return autorest.SendWithSender(client, req, sd...) 10447} 10448 10449// GetPartitionBackupProgressResponder handles the response to the GetPartitionBackupProgress request. The method always 10450// closes the http.Response Body. 10451func (client BaseClient) GetPartitionBackupProgressResponder(resp *http.Response) (result BackupProgressInfo, err error) { 10452 err = autorest.Respond( 10453 resp, 10454 client.ByInspecting(), 10455 azure.WithErrorUnlessStatusCode(http.StatusOK), 10456 autorest.ByUnmarshallingJSON(&result), 10457 autorest.ByClosing()) 10458 result.Response = autorest.Response{Response: resp} 10459 return 10460} 10461 10462// GetPartitionEventList the response is list of PartitionEvent objects. 10463// Parameters: 10464// partitionID - the identity of the partition. 10465// startTimeUtc - the start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. 10466// endTimeUtc - the end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. 10467// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 10468// duration that the client is willing to wait for the requested operation to complete. The default value for 10469// this parameter is 60 seconds. 10470// eventsTypesFilter - this is a comma separated string specifying the types of FabricEvents that should only 10471// be included in the response. 10472// excludeAnalysisEvents - this param disables the retrieval of AnalysisEvents if true is passed. 10473// skipCorrelationLookup - this param disables the search of CorrelatedEvents information if true is passed. 10474// otherwise the CorrelationEvents get processed and HasCorrelatedEvents field in every FabricEvent gets 10475// populated. 10476func (client BaseClient) GetPartitionEventList(ctx context.Context, partitionID uuid.UUID, startTimeUtc string, endTimeUtc string, timeout *int64, eventsTypesFilter string, excludeAnalysisEvents *bool, skipCorrelationLookup *bool) (result ListPartitionEvent, err error) { 10477 if tracing.IsEnabled() { 10478 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetPartitionEventList") 10479 defer func() { 10480 sc := -1 10481 if result.Response.Response != nil { 10482 sc = result.Response.Response.StatusCode 10483 } 10484 tracing.EndSpan(ctx, sc, err) 10485 }() 10486 } 10487 if err := validation.Validate([]validation.Validation{ 10488 {TargetValue: timeout, 10489 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 10490 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 10491 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 10492 }}}}}); err != nil { 10493 return result, validation.NewError("servicefabric.BaseClient", "GetPartitionEventList", err.Error()) 10494 } 10495 10496 req, err := client.GetPartitionEventListPreparer(ctx, partitionID, startTimeUtc, endTimeUtc, timeout, eventsTypesFilter, excludeAnalysisEvents, skipCorrelationLookup) 10497 if err != nil { 10498 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionEventList", nil, "Failure preparing request") 10499 return 10500 } 10501 10502 resp, err := client.GetPartitionEventListSender(req) 10503 if err != nil { 10504 result.Response = autorest.Response{Response: resp} 10505 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionEventList", resp, "Failure sending request") 10506 return 10507 } 10508 10509 result, err = client.GetPartitionEventListResponder(resp) 10510 if err != nil { 10511 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionEventList", resp, "Failure responding to request") 10512 } 10513 10514 return 10515} 10516 10517// GetPartitionEventListPreparer prepares the GetPartitionEventList request. 10518func (client BaseClient) GetPartitionEventListPreparer(ctx context.Context, partitionID uuid.UUID, startTimeUtc string, endTimeUtc string, timeout *int64, eventsTypesFilter string, excludeAnalysisEvents *bool, skipCorrelationLookup *bool) (*http.Request, error) { 10519 pathParameters := map[string]interface{}{ 10520 "partitionId": partitionID, 10521 } 10522 10523 const APIVersion = "6.2-preview" 10524 queryParameters := map[string]interface{}{ 10525 "api-version": APIVersion, 10526 "EndTimeUtc": autorest.Encode("query", endTimeUtc), 10527 "StartTimeUtc": autorest.Encode("query", startTimeUtc), 10528 } 10529 if timeout != nil { 10530 queryParameters["timeout"] = autorest.Encode("query", *timeout) 10531 } else { 10532 queryParameters["timeout"] = autorest.Encode("query", 60) 10533 } 10534 if len(eventsTypesFilter) > 0 { 10535 queryParameters["EventsTypesFilter"] = autorest.Encode("query", eventsTypesFilter) 10536 } 10537 if excludeAnalysisEvents != nil { 10538 queryParameters["ExcludeAnalysisEvents"] = autorest.Encode("query", *excludeAnalysisEvents) 10539 } 10540 if skipCorrelationLookup != nil { 10541 queryParameters["SkipCorrelationLookup"] = autorest.Encode("query", *skipCorrelationLookup) 10542 } 10543 10544 preparer := autorest.CreatePreparer( 10545 autorest.AsGet(), 10546 autorest.WithBaseURL(client.BaseURI), 10547 autorest.WithPathParameters("/EventsStore/Partitions/{partitionId}/$/Events", pathParameters), 10548 autorest.WithQueryParameters(queryParameters)) 10549 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 10550} 10551 10552// GetPartitionEventListSender sends the GetPartitionEventList request. The method will close the 10553// http.Response Body if it receives an error. 10554func (client BaseClient) GetPartitionEventListSender(req *http.Request) (*http.Response, error) { 10555 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 10556 return autorest.SendWithSender(client, req, sd...) 10557} 10558 10559// GetPartitionEventListResponder handles the response to the GetPartitionEventList request. The method always 10560// closes the http.Response Body. 10561func (client BaseClient) GetPartitionEventListResponder(resp *http.Response) (result ListPartitionEvent, err error) { 10562 err = autorest.Respond( 10563 resp, 10564 client.ByInspecting(), 10565 azure.WithErrorUnlessStatusCode(http.StatusOK), 10566 autorest.ByUnmarshallingJSON(&result), 10567 autorest.ByClosing()) 10568 result.Response = autorest.Response{Response: resp} 10569 return 10570} 10571 10572// GetPartitionHealth gets the health information of the specified partition. 10573// Use EventsHealthStateFilter to filter the collection of health events reported on the service based on the health 10574// state. 10575// Use ReplicasHealthStateFilter to filter the collection of ReplicaHealthState objects on the partition. 10576// If you specify a partition that does not exist in the health store, this request returns an error. 10577// Parameters: 10578// partitionID - the identity of the partition. 10579// eventsHealthStateFilter - allows filtering the collection of HealthEvent objects returned based on health 10580// state. 10581// The possible values for this parameter include integer value of one of the following health states. 10582// Only events that match the filter are returned. All events are used to evaluate the aggregated health state. 10583// If not specified, all entries are returned. The state values are flag based enumeration, so the value could 10584// be a combination of these value obtained using bitwise 'OR' operator. For example, If the provided value is 10585// 6 then all of the events with HealthState value of OK (2) and Warning (4) are returned. 10586// 10587// - Default - Default value. Matches any HealthState. The value is zero. 10588// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given 10589// collection of states. The value is 1. 10590// - Ok - Filter that matches input with HealthState value Ok. The value is 2. 10591// - Warning - Filter that matches input with HealthState value Warning. The value is 4. 10592// - Error - Filter that matches input with HealthState value Error. The value is 8. 10593// - All - Filter that matches input with any HealthState value. The value is 65535. 10594// replicasHealthStateFilter - allows filtering the collection of ReplicaHealthState objects on the partition. 10595// The value can be obtained from members or bitwise operations on members of HealthStateFilter. Only replicas 10596// that match the filter will be returned. All replicas will be used to evaluate the aggregated health state. 10597// If not specified, all entries will be returned.The state values are flag based enumeration, so the value 10598// could be a combination of these value obtained using bitwise 'OR' operator. For example, If the provided 10599// value is 6 then all of the events with HealthState value of OK (2) and Warning (4) will be returned. The 10600// possible values for this parameter include integer value of one of the following health states. 10601// 10602// - Default - Default value. Matches any HealthState. The value is zero. 10603// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given 10604// collection of states. The value is 1. 10605// - Ok - Filter that matches input with HealthState value Ok. The value is 2. 10606// - Warning - Filter that matches input with HealthState value Warning. The value is 4. 10607// - Error - Filter that matches input with HealthState value Error. The value is 8. 10608// - All - Filter that matches input with any HealthState value. The value is 65535. 10609// excludeHealthStatistics - indicates whether the health statistics should be returned as part of the query 10610// result. False by default. 10611// The statistics show the number of children entities in health state Ok, Warning, and Error. 10612// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 10613// duration that the client is willing to wait for the requested operation to complete. The default value for 10614// this parameter is 60 seconds. 10615func (client BaseClient) GetPartitionHealth(ctx context.Context, partitionID uuid.UUID, eventsHealthStateFilter *int32, replicasHealthStateFilter *int32, excludeHealthStatistics *bool, timeout *int64) (result PartitionHealth, err error) { 10616 if tracing.IsEnabled() { 10617 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetPartitionHealth") 10618 defer func() { 10619 sc := -1 10620 if result.Response.Response != nil { 10621 sc = result.Response.Response.StatusCode 10622 } 10623 tracing.EndSpan(ctx, sc, err) 10624 }() 10625 } 10626 if err := validation.Validate([]validation.Validation{ 10627 {TargetValue: timeout, 10628 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 10629 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 10630 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 10631 }}}}}); err != nil { 10632 return result, validation.NewError("servicefabric.BaseClient", "GetPartitionHealth", err.Error()) 10633 } 10634 10635 req, err := client.GetPartitionHealthPreparer(ctx, partitionID, eventsHealthStateFilter, replicasHealthStateFilter, excludeHealthStatistics, timeout) 10636 if err != nil { 10637 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionHealth", nil, "Failure preparing request") 10638 return 10639 } 10640 10641 resp, err := client.GetPartitionHealthSender(req) 10642 if err != nil { 10643 result.Response = autorest.Response{Response: resp} 10644 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionHealth", resp, "Failure sending request") 10645 return 10646 } 10647 10648 result, err = client.GetPartitionHealthResponder(resp) 10649 if err != nil { 10650 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionHealth", resp, "Failure responding to request") 10651 } 10652 10653 return 10654} 10655 10656// GetPartitionHealthPreparer prepares the GetPartitionHealth request. 10657func (client BaseClient) GetPartitionHealthPreparer(ctx context.Context, partitionID uuid.UUID, eventsHealthStateFilter *int32, replicasHealthStateFilter *int32, excludeHealthStatistics *bool, timeout *int64) (*http.Request, error) { 10658 pathParameters := map[string]interface{}{ 10659 "partitionId": partitionID, 10660 } 10661 10662 const APIVersion = "6.0" 10663 queryParameters := map[string]interface{}{ 10664 "api-version": APIVersion, 10665 } 10666 if eventsHealthStateFilter != nil { 10667 queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", *eventsHealthStateFilter) 10668 } else { 10669 queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", 0) 10670 } 10671 if replicasHealthStateFilter != nil { 10672 queryParameters["ReplicasHealthStateFilter"] = autorest.Encode("query", *replicasHealthStateFilter) 10673 } else { 10674 queryParameters["ReplicasHealthStateFilter"] = autorest.Encode("query", 0) 10675 } 10676 if excludeHealthStatistics != nil { 10677 queryParameters["ExcludeHealthStatistics"] = autorest.Encode("query", *excludeHealthStatistics) 10678 } else { 10679 queryParameters["ExcludeHealthStatistics"] = autorest.Encode("query", false) 10680 } 10681 if timeout != nil { 10682 queryParameters["timeout"] = autorest.Encode("query", *timeout) 10683 } else { 10684 queryParameters["timeout"] = autorest.Encode("query", 60) 10685 } 10686 10687 preparer := autorest.CreatePreparer( 10688 autorest.AsGet(), 10689 autorest.WithBaseURL(client.BaseURI), 10690 autorest.WithPathParameters("/Partitions/{partitionId}/$/GetHealth", pathParameters), 10691 autorest.WithQueryParameters(queryParameters)) 10692 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 10693} 10694 10695// GetPartitionHealthSender sends the GetPartitionHealth request. The method will close the 10696// http.Response Body if it receives an error. 10697func (client BaseClient) GetPartitionHealthSender(req *http.Request) (*http.Response, error) { 10698 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 10699 return autorest.SendWithSender(client, req, sd...) 10700} 10701 10702// GetPartitionHealthResponder handles the response to the GetPartitionHealth request. The method always 10703// closes the http.Response Body. 10704func (client BaseClient) GetPartitionHealthResponder(resp *http.Response) (result PartitionHealth, err error) { 10705 err = autorest.Respond( 10706 resp, 10707 client.ByInspecting(), 10708 azure.WithErrorUnlessStatusCode(http.StatusOK), 10709 autorest.ByUnmarshallingJSON(&result), 10710 autorest.ByClosing()) 10711 result.Response = autorest.Response{Response: resp} 10712 return 10713} 10714 10715// GetPartitionHealthUsingPolicy gets the health information of the specified partition. 10716// If the application health policy is specified, the health evaluation uses it to get the aggregated health state. 10717// If the policy is not specified, the health evaluation uses the application health policy defined in the application 10718// manifest, or the default health policy, if no policy is defined in the manifest. 10719// Use EventsHealthStateFilter to filter the collection of health events reported on the partition based on the health 10720// state. 10721// Use ReplicasHealthStateFilter to filter the collection of ReplicaHealthState objects on the partition. Use 10722// ApplicationHealthPolicy in the POST body to override the health policies used to evaluate the health. 10723// If you specify a partition that does not exist in the health store, this request returns an error. 10724// Parameters: 10725// partitionID - the identity of the partition. 10726// eventsHealthStateFilter - allows filtering the collection of HealthEvent objects returned based on health 10727// state. 10728// The possible values for this parameter include integer value of one of the following health states. 10729// Only events that match the filter are returned. All events are used to evaluate the aggregated health state. 10730// If not specified, all entries are returned. The state values are flag based enumeration, so the value could 10731// be a combination of these value obtained using bitwise 'OR' operator. For example, If the provided value is 10732// 6 then all of the events with HealthState value of OK (2) and Warning (4) are returned. 10733// 10734// - Default - Default value. Matches any HealthState. The value is zero. 10735// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given 10736// collection of states. The value is 1. 10737// - Ok - Filter that matches input with HealthState value Ok. The value is 2. 10738// - Warning - Filter that matches input with HealthState value Warning. The value is 4. 10739// - Error - Filter that matches input with HealthState value Error. The value is 8. 10740// - All - Filter that matches input with any HealthState value. The value is 65535. 10741// replicasHealthStateFilter - allows filtering the collection of ReplicaHealthState objects on the partition. 10742// The value can be obtained from members or bitwise operations on members of HealthStateFilter. Only replicas 10743// that match the filter will be returned. All replicas will be used to evaluate the aggregated health state. 10744// If not specified, all entries will be returned.The state values are flag based enumeration, so the value 10745// could be a combination of these value obtained using bitwise 'OR' operator. For example, If the provided 10746// value is 6 then all of the events with HealthState value of OK (2) and Warning (4) will be returned. The 10747// possible values for this parameter include integer value of one of the following health states. 10748// 10749// - Default - Default value. Matches any HealthState. The value is zero. 10750// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given 10751// collection of states. The value is 1. 10752// - Ok - Filter that matches input with HealthState value Ok. The value is 2. 10753// - Warning - Filter that matches input with HealthState value Warning. The value is 4. 10754// - Error - Filter that matches input with HealthState value Error. The value is 8. 10755// - All - Filter that matches input with any HealthState value. The value is 65535. 10756// applicationHealthPolicy - describes the health policies used to evaluate the health of an application or one 10757// of its children. 10758// If not present, the health evaluation uses the health policy from application manifest or the default health 10759// policy. 10760// excludeHealthStatistics - indicates whether the health statistics should be returned as part of the query 10761// result. False by default. 10762// The statistics show the number of children entities in health state Ok, Warning, and Error. 10763// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 10764// duration that the client is willing to wait for the requested operation to complete. The default value for 10765// this parameter is 60 seconds. 10766func (client BaseClient) GetPartitionHealthUsingPolicy(ctx context.Context, partitionID uuid.UUID, eventsHealthStateFilter *int32, replicasHealthStateFilter *int32, applicationHealthPolicy *ApplicationHealthPolicy, excludeHealthStatistics *bool, timeout *int64) (result PartitionHealth, err error) { 10767 if tracing.IsEnabled() { 10768 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetPartitionHealthUsingPolicy") 10769 defer func() { 10770 sc := -1 10771 if result.Response.Response != nil { 10772 sc = result.Response.Response.StatusCode 10773 } 10774 tracing.EndSpan(ctx, sc, err) 10775 }() 10776 } 10777 if err := validation.Validate([]validation.Validation{ 10778 {TargetValue: timeout, 10779 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 10780 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 10781 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 10782 }}}}}); err != nil { 10783 return result, validation.NewError("servicefabric.BaseClient", "GetPartitionHealthUsingPolicy", err.Error()) 10784 } 10785 10786 req, err := client.GetPartitionHealthUsingPolicyPreparer(ctx, partitionID, eventsHealthStateFilter, replicasHealthStateFilter, applicationHealthPolicy, excludeHealthStatistics, timeout) 10787 if err != nil { 10788 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionHealthUsingPolicy", nil, "Failure preparing request") 10789 return 10790 } 10791 10792 resp, err := client.GetPartitionHealthUsingPolicySender(req) 10793 if err != nil { 10794 result.Response = autorest.Response{Response: resp} 10795 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionHealthUsingPolicy", resp, "Failure sending request") 10796 return 10797 } 10798 10799 result, err = client.GetPartitionHealthUsingPolicyResponder(resp) 10800 if err != nil { 10801 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionHealthUsingPolicy", resp, "Failure responding to request") 10802 } 10803 10804 return 10805} 10806 10807// GetPartitionHealthUsingPolicyPreparer prepares the GetPartitionHealthUsingPolicy request. 10808func (client BaseClient) GetPartitionHealthUsingPolicyPreparer(ctx context.Context, partitionID uuid.UUID, eventsHealthStateFilter *int32, replicasHealthStateFilter *int32, applicationHealthPolicy *ApplicationHealthPolicy, excludeHealthStatistics *bool, timeout *int64) (*http.Request, error) { 10809 pathParameters := map[string]interface{}{ 10810 "partitionId": partitionID, 10811 } 10812 10813 const APIVersion = "6.0" 10814 queryParameters := map[string]interface{}{ 10815 "api-version": APIVersion, 10816 } 10817 if eventsHealthStateFilter != nil { 10818 queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", *eventsHealthStateFilter) 10819 } else { 10820 queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", 0) 10821 } 10822 if replicasHealthStateFilter != nil { 10823 queryParameters["ReplicasHealthStateFilter"] = autorest.Encode("query", *replicasHealthStateFilter) 10824 } else { 10825 queryParameters["ReplicasHealthStateFilter"] = autorest.Encode("query", 0) 10826 } 10827 if excludeHealthStatistics != nil { 10828 queryParameters["ExcludeHealthStatistics"] = autorest.Encode("query", *excludeHealthStatistics) 10829 } else { 10830 queryParameters["ExcludeHealthStatistics"] = autorest.Encode("query", false) 10831 } 10832 if timeout != nil { 10833 queryParameters["timeout"] = autorest.Encode("query", *timeout) 10834 } else { 10835 queryParameters["timeout"] = autorest.Encode("query", 60) 10836 } 10837 10838 preparer := autorest.CreatePreparer( 10839 autorest.AsContentType("application/json; charset=utf-8"), 10840 autorest.AsPost(), 10841 autorest.WithBaseURL(client.BaseURI), 10842 autorest.WithPathParameters("/Partitions/{partitionId}/$/GetHealth", pathParameters), 10843 autorest.WithQueryParameters(queryParameters)) 10844 if applicationHealthPolicy != nil { 10845 preparer = autorest.DecoratePreparer(preparer, 10846 autorest.WithJSON(applicationHealthPolicy)) 10847 } 10848 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 10849} 10850 10851// GetPartitionHealthUsingPolicySender sends the GetPartitionHealthUsingPolicy request. The method will close the 10852// http.Response Body if it receives an error. 10853func (client BaseClient) GetPartitionHealthUsingPolicySender(req *http.Request) (*http.Response, error) { 10854 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 10855 return autorest.SendWithSender(client, req, sd...) 10856} 10857 10858// GetPartitionHealthUsingPolicyResponder handles the response to the GetPartitionHealthUsingPolicy request. The method always 10859// closes the http.Response Body. 10860func (client BaseClient) GetPartitionHealthUsingPolicyResponder(resp *http.Response) (result PartitionHealth, err error) { 10861 err = autorest.Respond( 10862 resp, 10863 client.ByInspecting(), 10864 azure.WithErrorUnlessStatusCode(http.StatusOK), 10865 autorest.ByUnmarshallingJSON(&result), 10866 autorest.ByClosing()) 10867 result.Response = autorest.Response{Response: resp} 10868 return 10869} 10870 10871// GetPartitionInfo gets the information about the specified partition. The response includes the partition ID, 10872// partitioning scheme information, keys supported by the partition, status, health, and other details about the 10873// partition. 10874// Parameters: 10875// partitionID - the identity of the partition. 10876// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 10877// duration that the client is willing to wait for the requested operation to complete. The default value for 10878// this parameter is 60 seconds. 10879func (client BaseClient) GetPartitionInfo(ctx context.Context, partitionID uuid.UUID, timeout *int64) (result ServicePartitionInfoModel, err error) { 10880 if tracing.IsEnabled() { 10881 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetPartitionInfo") 10882 defer func() { 10883 sc := -1 10884 if result.Response.Response != nil { 10885 sc = result.Response.Response.StatusCode 10886 } 10887 tracing.EndSpan(ctx, sc, err) 10888 }() 10889 } 10890 if err := validation.Validate([]validation.Validation{ 10891 {TargetValue: timeout, 10892 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 10893 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 10894 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 10895 }}}}}); err != nil { 10896 return result, validation.NewError("servicefabric.BaseClient", "GetPartitionInfo", err.Error()) 10897 } 10898 10899 req, err := client.GetPartitionInfoPreparer(ctx, partitionID, timeout) 10900 if err != nil { 10901 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionInfo", nil, "Failure preparing request") 10902 return 10903 } 10904 10905 resp, err := client.GetPartitionInfoSender(req) 10906 if err != nil { 10907 result.Response = autorest.Response{Response: resp} 10908 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionInfo", resp, "Failure sending request") 10909 return 10910 } 10911 10912 result, err = client.GetPartitionInfoResponder(resp) 10913 if err != nil { 10914 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionInfo", resp, "Failure responding to request") 10915 } 10916 10917 return 10918} 10919 10920// GetPartitionInfoPreparer prepares the GetPartitionInfo request. 10921func (client BaseClient) GetPartitionInfoPreparer(ctx context.Context, partitionID uuid.UUID, timeout *int64) (*http.Request, error) { 10922 pathParameters := map[string]interface{}{ 10923 "partitionId": partitionID, 10924 } 10925 10926 const APIVersion = "6.0" 10927 queryParameters := map[string]interface{}{ 10928 "api-version": APIVersion, 10929 } 10930 if timeout != nil { 10931 queryParameters["timeout"] = autorest.Encode("query", *timeout) 10932 } else { 10933 queryParameters["timeout"] = autorest.Encode("query", 60) 10934 } 10935 10936 preparer := autorest.CreatePreparer( 10937 autorest.AsGet(), 10938 autorest.WithBaseURL(client.BaseURI), 10939 autorest.WithPathParameters("/Partitions/{partitionId}", pathParameters), 10940 autorest.WithQueryParameters(queryParameters)) 10941 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 10942} 10943 10944// GetPartitionInfoSender sends the GetPartitionInfo request. The method will close the 10945// http.Response Body if it receives an error. 10946func (client BaseClient) GetPartitionInfoSender(req *http.Request) (*http.Response, error) { 10947 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 10948 return autorest.SendWithSender(client, req, sd...) 10949} 10950 10951// GetPartitionInfoResponder handles the response to the GetPartitionInfo request. The method always 10952// closes the http.Response Body. 10953func (client BaseClient) GetPartitionInfoResponder(resp *http.Response) (result ServicePartitionInfoModel, err error) { 10954 err = autorest.Respond( 10955 resp, 10956 client.ByInspecting(), 10957 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), 10958 autorest.ByUnmarshallingJSON(&result), 10959 autorest.ByClosing()) 10960 result.Response = autorest.Response{Response: resp} 10961 return 10962} 10963 10964// GetPartitionInfoList gets the list of partitions of a Service Fabric service. The response includes the partition 10965// ID, partitioning scheme information, keys supported by the partition, status, health, and other details about the 10966// partition. 10967// Parameters: 10968// serviceID - the identity of the service. This is typically the full name of the service without the 10969// 'fabric:' URI scheme. 10970// Starting from version 6.0, hierarchical names are delimited with the "~" character. 10971// For example, if the service name is "fabric:/myapp/app1/svc1", the service identity would be 10972// "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in previous versions. 10973// continuationToken - the continuation token parameter is used to obtain next set of results. A continuation 10974// token with a non empty value is included in the response of the API when the results from the system do not 10975// fit in a single response. When this value is passed to the next API call, the API returns next set of 10976// results. If there are no further results then the continuation token does not contain a value. The value of 10977// this parameter should not be URL encoded. 10978// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 10979// duration that the client is willing to wait for the requested operation to complete. The default value for 10980// this parameter is 60 seconds. 10981func (client BaseClient) GetPartitionInfoList(ctx context.Context, serviceID string, continuationToken string, timeout *int64) (result PagedServicePartitionInfoList, err error) { 10982 if tracing.IsEnabled() { 10983 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetPartitionInfoList") 10984 defer func() { 10985 sc := -1 10986 if result.Response.Response != nil { 10987 sc = result.Response.Response.StatusCode 10988 } 10989 tracing.EndSpan(ctx, sc, err) 10990 }() 10991 } 10992 if err := validation.Validate([]validation.Validation{ 10993 {TargetValue: timeout, 10994 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 10995 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 10996 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 10997 }}}}}); err != nil { 10998 return result, validation.NewError("servicefabric.BaseClient", "GetPartitionInfoList", err.Error()) 10999 } 11000 11001 req, err := client.GetPartitionInfoListPreparer(ctx, serviceID, continuationToken, timeout) 11002 if err != nil { 11003 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionInfoList", nil, "Failure preparing request") 11004 return 11005 } 11006 11007 resp, err := client.GetPartitionInfoListSender(req) 11008 if err != nil { 11009 result.Response = autorest.Response{Response: resp} 11010 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionInfoList", resp, "Failure sending request") 11011 return 11012 } 11013 11014 result, err = client.GetPartitionInfoListResponder(resp) 11015 if err != nil { 11016 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionInfoList", resp, "Failure responding to request") 11017 } 11018 11019 return 11020} 11021 11022// GetPartitionInfoListPreparer prepares the GetPartitionInfoList request. 11023func (client BaseClient) GetPartitionInfoListPreparer(ctx context.Context, serviceID string, continuationToken string, timeout *int64) (*http.Request, error) { 11024 pathParameters := map[string]interface{}{ 11025 "serviceId": serviceID, 11026 } 11027 11028 const APIVersion = "6.0" 11029 queryParameters := map[string]interface{}{ 11030 "api-version": APIVersion, 11031 } 11032 if len(continuationToken) > 0 { 11033 queryParameters["ContinuationToken"] = continuationToken 11034 } 11035 if timeout != nil { 11036 queryParameters["timeout"] = autorest.Encode("query", *timeout) 11037 } else { 11038 queryParameters["timeout"] = autorest.Encode("query", 60) 11039 } 11040 11041 preparer := autorest.CreatePreparer( 11042 autorest.AsGet(), 11043 autorest.WithBaseURL(client.BaseURI), 11044 autorest.WithPathParameters("/Services/{serviceId}/$/GetPartitions", pathParameters), 11045 autorest.WithQueryParameters(queryParameters)) 11046 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 11047} 11048 11049// GetPartitionInfoListSender sends the GetPartitionInfoList request. The method will close the 11050// http.Response Body if it receives an error. 11051func (client BaseClient) GetPartitionInfoListSender(req *http.Request) (*http.Response, error) { 11052 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 11053 return autorest.SendWithSender(client, req, sd...) 11054} 11055 11056// GetPartitionInfoListResponder handles the response to the GetPartitionInfoList request. The method always 11057// closes the http.Response Body. 11058func (client BaseClient) GetPartitionInfoListResponder(resp *http.Response) (result PagedServicePartitionInfoList, err error) { 11059 err = autorest.Respond( 11060 resp, 11061 client.ByInspecting(), 11062 azure.WithErrorUnlessStatusCode(http.StatusOK), 11063 autorest.ByUnmarshallingJSON(&result), 11064 autorest.ByClosing()) 11065 result.Response = autorest.Response{Response: resp} 11066 return 11067} 11068 11069// GetPartitionLoadInformation returns information about the load of a specified partition. 11070// The response includes a list of load reports for a Service Fabric partition. 11071// Each report includes the load metric name, value, and last reported time in UTC. 11072// Parameters: 11073// partitionID - the identity of the partition. 11074// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 11075// duration that the client is willing to wait for the requested operation to complete. The default value for 11076// this parameter is 60 seconds. 11077func (client BaseClient) GetPartitionLoadInformation(ctx context.Context, partitionID uuid.UUID, timeout *int64) (result PartitionLoadInformation, err error) { 11078 if tracing.IsEnabled() { 11079 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetPartitionLoadInformation") 11080 defer func() { 11081 sc := -1 11082 if result.Response.Response != nil { 11083 sc = result.Response.Response.StatusCode 11084 } 11085 tracing.EndSpan(ctx, sc, err) 11086 }() 11087 } 11088 if err := validation.Validate([]validation.Validation{ 11089 {TargetValue: timeout, 11090 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 11091 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 11092 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 11093 }}}}}); err != nil { 11094 return result, validation.NewError("servicefabric.BaseClient", "GetPartitionLoadInformation", err.Error()) 11095 } 11096 11097 req, err := client.GetPartitionLoadInformationPreparer(ctx, partitionID, timeout) 11098 if err != nil { 11099 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionLoadInformation", nil, "Failure preparing request") 11100 return 11101 } 11102 11103 resp, err := client.GetPartitionLoadInformationSender(req) 11104 if err != nil { 11105 result.Response = autorest.Response{Response: resp} 11106 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionLoadInformation", resp, "Failure sending request") 11107 return 11108 } 11109 11110 result, err = client.GetPartitionLoadInformationResponder(resp) 11111 if err != nil { 11112 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionLoadInformation", resp, "Failure responding to request") 11113 } 11114 11115 return 11116} 11117 11118// GetPartitionLoadInformationPreparer prepares the GetPartitionLoadInformation request. 11119func (client BaseClient) GetPartitionLoadInformationPreparer(ctx context.Context, partitionID uuid.UUID, timeout *int64) (*http.Request, error) { 11120 pathParameters := map[string]interface{}{ 11121 "partitionId": partitionID, 11122 } 11123 11124 const APIVersion = "6.0" 11125 queryParameters := map[string]interface{}{ 11126 "api-version": APIVersion, 11127 } 11128 if timeout != nil { 11129 queryParameters["timeout"] = autorest.Encode("query", *timeout) 11130 } else { 11131 queryParameters["timeout"] = autorest.Encode("query", 60) 11132 } 11133 11134 preparer := autorest.CreatePreparer( 11135 autorest.AsGet(), 11136 autorest.WithBaseURL(client.BaseURI), 11137 autorest.WithPathParameters("/Partitions/{partitionId}/$/GetLoadInformation", pathParameters), 11138 autorest.WithQueryParameters(queryParameters)) 11139 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 11140} 11141 11142// GetPartitionLoadInformationSender sends the GetPartitionLoadInformation request. The method will close the 11143// http.Response Body if it receives an error. 11144func (client BaseClient) GetPartitionLoadInformationSender(req *http.Request) (*http.Response, error) { 11145 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 11146 return autorest.SendWithSender(client, req, sd...) 11147} 11148 11149// GetPartitionLoadInformationResponder handles the response to the GetPartitionLoadInformation request. The method always 11150// closes the http.Response Body. 11151func (client BaseClient) GetPartitionLoadInformationResponder(resp *http.Response) (result PartitionLoadInformation, err error) { 11152 err = autorest.Respond( 11153 resp, 11154 client.ByInspecting(), 11155 azure.WithErrorUnlessStatusCode(http.StatusOK), 11156 autorest.ByUnmarshallingJSON(&result), 11157 autorest.ByClosing()) 11158 result.Response = autorest.Response{Response: resp} 11159 return 11160} 11161 11162// GetPartitionReplicaEventList the response is list of ReplicaEvent objects. 11163// Parameters: 11164// partitionID - the identity of the partition. 11165// replicaID - the identifier of the replica. 11166// startTimeUtc - the start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. 11167// endTimeUtc - the end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. 11168// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 11169// duration that the client is willing to wait for the requested operation to complete. The default value for 11170// this parameter is 60 seconds. 11171// eventsTypesFilter - this is a comma separated string specifying the types of FabricEvents that should only 11172// be included in the response. 11173// excludeAnalysisEvents - this param disables the retrieval of AnalysisEvents if true is passed. 11174// skipCorrelationLookup - this param disables the search of CorrelatedEvents information if true is passed. 11175// otherwise the CorrelationEvents get processed and HasCorrelatedEvents field in every FabricEvent gets 11176// populated. 11177func (client BaseClient) GetPartitionReplicaEventList(ctx context.Context, partitionID uuid.UUID, replicaID string, startTimeUtc string, endTimeUtc string, timeout *int64, eventsTypesFilter string, excludeAnalysisEvents *bool, skipCorrelationLookup *bool) (result ListReplicaEvent, err error) { 11178 if tracing.IsEnabled() { 11179 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetPartitionReplicaEventList") 11180 defer func() { 11181 sc := -1 11182 if result.Response.Response != nil { 11183 sc = result.Response.Response.StatusCode 11184 } 11185 tracing.EndSpan(ctx, sc, err) 11186 }() 11187 } 11188 if err := validation.Validate([]validation.Validation{ 11189 {TargetValue: timeout, 11190 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 11191 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 11192 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 11193 }}}}}); err != nil { 11194 return result, validation.NewError("servicefabric.BaseClient", "GetPartitionReplicaEventList", err.Error()) 11195 } 11196 11197 req, err := client.GetPartitionReplicaEventListPreparer(ctx, partitionID, replicaID, startTimeUtc, endTimeUtc, timeout, eventsTypesFilter, excludeAnalysisEvents, skipCorrelationLookup) 11198 if err != nil { 11199 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionReplicaEventList", nil, "Failure preparing request") 11200 return 11201 } 11202 11203 resp, err := client.GetPartitionReplicaEventListSender(req) 11204 if err != nil { 11205 result.Response = autorest.Response{Response: resp} 11206 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionReplicaEventList", resp, "Failure sending request") 11207 return 11208 } 11209 11210 result, err = client.GetPartitionReplicaEventListResponder(resp) 11211 if err != nil { 11212 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionReplicaEventList", resp, "Failure responding to request") 11213 } 11214 11215 return 11216} 11217 11218// GetPartitionReplicaEventListPreparer prepares the GetPartitionReplicaEventList request. 11219func (client BaseClient) GetPartitionReplicaEventListPreparer(ctx context.Context, partitionID uuid.UUID, replicaID string, startTimeUtc string, endTimeUtc string, timeout *int64, eventsTypesFilter string, excludeAnalysisEvents *bool, skipCorrelationLookup *bool) (*http.Request, error) { 11220 pathParameters := map[string]interface{}{ 11221 "partitionId": partitionID, 11222 "replicaId": replicaID, 11223 } 11224 11225 const APIVersion = "6.2-preview" 11226 queryParameters := map[string]interface{}{ 11227 "api-version": APIVersion, 11228 "EndTimeUtc": autorest.Encode("query", endTimeUtc), 11229 "StartTimeUtc": autorest.Encode("query", startTimeUtc), 11230 } 11231 if timeout != nil { 11232 queryParameters["timeout"] = autorest.Encode("query", *timeout) 11233 } else { 11234 queryParameters["timeout"] = autorest.Encode("query", 60) 11235 } 11236 if len(eventsTypesFilter) > 0 { 11237 queryParameters["EventsTypesFilter"] = autorest.Encode("query", eventsTypesFilter) 11238 } 11239 if excludeAnalysisEvents != nil { 11240 queryParameters["ExcludeAnalysisEvents"] = autorest.Encode("query", *excludeAnalysisEvents) 11241 } 11242 if skipCorrelationLookup != nil { 11243 queryParameters["SkipCorrelationLookup"] = autorest.Encode("query", *skipCorrelationLookup) 11244 } 11245 11246 preparer := autorest.CreatePreparer( 11247 autorest.AsGet(), 11248 autorest.WithBaseURL(client.BaseURI), 11249 autorest.WithPathParameters("/EventsStore/Partitions/{partitionId}/$/Replicas/{replicaId}/$/Events", pathParameters), 11250 autorest.WithQueryParameters(queryParameters)) 11251 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 11252} 11253 11254// GetPartitionReplicaEventListSender sends the GetPartitionReplicaEventList request. The method will close the 11255// http.Response Body if it receives an error. 11256func (client BaseClient) GetPartitionReplicaEventListSender(req *http.Request) (*http.Response, error) { 11257 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 11258 return autorest.SendWithSender(client, req, sd...) 11259} 11260 11261// GetPartitionReplicaEventListResponder handles the response to the GetPartitionReplicaEventList request. The method always 11262// closes the http.Response Body. 11263func (client BaseClient) GetPartitionReplicaEventListResponder(resp *http.Response) (result ListReplicaEvent, err error) { 11264 err = autorest.Respond( 11265 resp, 11266 client.ByInspecting(), 11267 azure.WithErrorUnlessStatusCode(http.StatusOK), 11268 autorest.ByUnmarshallingJSON(&result), 11269 autorest.ByClosing()) 11270 result.Response = autorest.Response{Response: resp} 11271 return 11272} 11273 11274// GetPartitionReplicasEventList the response is list of ReplicaEvent objects. 11275// Parameters: 11276// partitionID - the identity of the partition. 11277// startTimeUtc - the start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. 11278// endTimeUtc - the end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. 11279// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 11280// duration that the client is willing to wait for the requested operation to complete. The default value for 11281// this parameter is 60 seconds. 11282// eventsTypesFilter - this is a comma separated string specifying the types of FabricEvents that should only 11283// be included in the response. 11284// excludeAnalysisEvents - this param disables the retrieval of AnalysisEvents if true is passed. 11285// skipCorrelationLookup - this param disables the search of CorrelatedEvents information if true is passed. 11286// otherwise the CorrelationEvents get processed and HasCorrelatedEvents field in every FabricEvent gets 11287// populated. 11288func (client BaseClient) GetPartitionReplicasEventList(ctx context.Context, partitionID uuid.UUID, startTimeUtc string, endTimeUtc string, timeout *int64, eventsTypesFilter string, excludeAnalysisEvents *bool, skipCorrelationLookup *bool) (result ListReplicaEvent, err error) { 11289 if tracing.IsEnabled() { 11290 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetPartitionReplicasEventList") 11291 defer func() { 11292 sc := -1 11293 if result.Response.Response != nil { 11294 sc = result.Response.Response.StatusCode 11295 } 11296 tracing.EndSpan(ctx, sc, err) 11297 }() 11298 } 11299 if err := validation.Validate([]validation.Validation{ 11300 {TargetValue: timeout, 11301 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 11302 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 11303 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 11304 }}}}}); err != nil { 11305 return result, validation.NewError("servicefabric.BaseClient", "GetPartitionReplicasEventList", err.Error()) 11306 } 11307 11308 req, err := client.GetPartitionReplicasEventListPreparer(ctx, partitionID, startTimeUtc, endTimeUtc, timeout, eventsTypesFilter, excludeAnalysisEvents, skipCorrelationLookup) 11309 if err != nil { 11310 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionReplicasEventList", nil, "Failure preparing request") 11311 return 11312 } 11313 11314 resp, err := client.GetPartitionReplicasEventListSender(req) 11315 if err != nil { 11316 result.Response = autorest.Response{Response: resp} 11317 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionReplicasEventList", resp, "Failure sending request") 11318 return 11319 } 11320 11321 result, err = client.GetPartitionReplicasEventListResponder(resp) 11322 if err != nil { 11323 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionReplicasEventList", resp, "Failure responding to request") 11324 } 11325 11326 return 11327} 11328 11329// GetPartitionReplicasEventListPreparer prepares the GetPartitionReplicasEventList request. 11330func (client BaseClient) GetPartitionReplicasEventListPreparer(ctx context.Context, partitionID uuid.UUID, startTimeUtc string, endTimeUtc string, timeout *int64, eventsTypesFilter string, excludeAnalysisEvents *bool, skipCorrelationLookup *bool) (*http.Request, error) { 11331 pathParameters := map[string]interface{}{ 11332 "partitionId": partitionID, 11333 } 11334 11335 const APIVersion = "6.2-preview" 11336 queryParameters := map[string]interface{}{ 11337 "api-version": APIVersion, 11338 "EndTimeUtc": autorest.Encode("query", endTimeUtc), 11339 "StartTimeUtc": autorest.Encode("query", startTimeUtc), 11340 } 11341 if timeout != nil { 11342 queryParameters["timeout"] = autorest.Encode("query", *timeout) 11343 } else { 11344 queryParameters["timeout"] = autorest.Encode("query", 60) 11345 } 11346 if len(eventsTypesFilter) > 0 { 11347 queryParameters["EventsTypesFilter"] = autorest.Encode("query", eventsTypesFilter) 11348 } 11349 if excludeAnalysisEvents != nil { 11350 queryParameters["ExcludeAnalysisEvents"] = autorest.Encode("query", *excludeAnalysisEvents) 11351 } 11352 if skipCorrelationLookup != nil { 11353 queryParameters["SkipCorrelationLookup"] = autorest.Encode("query", *skipCorrelationLookup) 11354 } 11355 11356 preparer := autorest.CreatePreparer( 11357 autorest.AsGet(), 11358 autorest.WithBaseURL(client.BaseURI), 11359 autorest.WithPathParameters("/EventsStore/Partitions/{partitionId}/$/Replicas/Events", pathParameters), 11360 autorest.WithQueryParameters(queryParameters)) 11361 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 11362} 11363 11364// GetPartitionReplicasEventListSender sends the GetPartitionReplicasEventList request. The method will close the 11365// http.Response Body if it receives an error. 11366func (client BaseClient) GetPartitionReplicasEventListSender(req *http.Request) (*http.Response, error) { 11367 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 11368 return autorest.SendWithSender(client, req, sd...) 11369} 11370 11371// GetPartitionReplicasEventListResponder handles the response to the GetPartitionReplicasEventList request. The method always 11372// closes the http.Response Body. 11373func (client BaseClient) GetPartitionReplicasEventListResponder(resp *http.Response) (result ListReplicaEvent, err error) { 11374 err = autorest.Respond( 11375 resp, 11376 client.ByInspecting(), 11377 azure.WithErrorUnlessStatusCode(http.StatusOK), 11378 autorest.ByUnmarshallingJSON(&result), 11379 autorest.ByClosing()) 11380 result.Response = autorest.Response{Response: resp} 11381 return 11382} 11383 11384// GetPartitionRestartProgress gets the progress of a PartitionRestart started with StartPartitionRestart using the 11385// provided OperationId. 11386// Parameters: 11387// serviceID - the identity of the service. This is typically the full name of the service without the 11388// 'fabric:' URI scheme. 11389// Starting from version 6.0, hierarchical names are delimited with the "~" character. 11390// For example, if the service name is "fabric:/myapp/app1/svc1", the service identity would be 11391// "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in previous versions. 11392// partitionID - the identity of the partition. 11393// operationID - a GUID that identifies a call of this API. This is passed into the corresponding GetProgress 11394// API 11395// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 11396// duration that the client is willing to wait for the requested operation to complete. The default value for 11397// this parameter is 60 seconds. 11398func (client BaseClient) GetPartitionRestartProgress(ctx context.Context, serviceID string, partitionID uuid.UUID, operationID uuid.UUID, timeout *int64) (result PartitionRestartProgress, err error) { 11399 if tracing.IsEnabled() { 11400 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetPartitionRestartProgress") 11401 defer func() { 11402 sc := -1 11403 if result.Response.Response != nil { 11404 sc = result.Response.Response.StatusCode 11405 } 11406 tracing.EndSpan(ctx, sc, err) 11407 }() 11408 } 11409 if err := validation.Validate([]validation.Validation{ 11410 {TargetValue: timeout, 11411 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 11412 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 11413 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 11414 }}}}}); err != nil { 11415 return result, validation.NewError("servicefabric.BaseClient", "GetPartitionRestartProgress", err.Error()) 11416 } 11417 11418 req, err := client.GetPartitionRestartProgressPreparer(ctx, serviceID, partitionID, operationID, timeout) 11419 if err != nil { 11420 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionRestartProgress", nil, "Failure preparing request") 11421 return 11422 } 11423 11424 resp, err := client.GetPartitionRestartProgressSender(req) 11425 if err != nil { 11426 result.Response = autorest.Response{Response: resp} 11427 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionRestartProgress", resp, "Failure sending request") 11428 return 11429 } 11430 11431 result, err = client.GetPartitionRestartProgressResponder(resp) 11432 if err != nil { 11433 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionRestartProgress", resp, "Failure responding to request") 11434 } 11435 11436 return 11437} 11438 11439// GetPartitionRestartProgressPreparer prepares the GetPartitionRestartProgress request. 11440func (client BaseClient) GetPartitionRestartProgressPreparer(ctx context.Context, serviceID string, partitionID uuid.UUID, operationID uuid.UUID, timeout *int64) (*http.Request, error) { 11441 pathParameters := map[string]interface{}{ 11442 "partitionId": partitionID, 11443 "serviceId": serviceID, 11444 } 11445 11446 const APIVersion = "6.0" 11447 queryParameters := map[string]interface{}{ 11448 "api-version": APIVersion, 11449 "OperationId": autorest.Encode("query", operationID), 11450 } 11451 if timeout != nil { 11452 queryParameters["timeout"] = autorest.Encode("query", *timeout) 11453 } else { 11454 queryParameters["timeout"] = autorest.Encode("query", 60) 11455 } 11456 11457 preparer := autorest.CreatePreparer( 11458 autorest.AsGet(), 11459 autorest.WithBaseURL(client.BaseURI), 11460 autorest.WithPathParameters("/Faults/Services/{serviceId}/$/GetPartitions/{partitionId}/$/GetRestartProgress", pathParameters), 11461 autorest.WithQueryParameters(queryParameters)) 11462 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 11463} 11464 11465// GetPartitionRestartProgressSender sends the GetPartitionRestartProgress request. The method will close the 11466// http.Response Body if it receives an error. 11467func (client BaseClient) GetPartitionRestartProgressSender(req *http.Request) (*http.Response, error) { 11468 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 11469 return autorest.SendWithSender(client, req, sd...) 11470} 11471 11472// GetPartitionRestartProgressResponder handles the response to the GetPartitionRestartProgress request. The method always 11473// closes the http.Response Body. 11474func (client BaseClient) GetPartitionRestartProgressResponder(resp *http.Response) (result PartitionRestartProgress, err error) { 11475 err = autorest.Respond( 11476 resp, 11477 client.ByInspecting(), 11478 azure.WithErrorUnlessStatusCode(http.StatusOK), 11479 autorest.ByUnmarshallingJSON(&result), 11480 autorest.ByClosing()) 11481 result.Response = autorest.Response{Response: resp} 11482 return 11483} 11484 11485// GetPartitionRestoreProgress returns information about the state of the latest restore operation along with details 11486// or failure reason in case of completion. 11487// Parameters: 11488// partitionID - the identity of the partition. 11489// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 11490// duration that the client is willing to wait for the requested operation to complete. The default value for 11491// this parameter is 60 seconds. 11492func (client BaseClient) GetPartitionRestoreProgress(ctx context.Context, partitionID uuid.UUID, timeout *int64) (result RestoreProgressInfo, err error) { 11493 if tracing.IsEnabled() { 11494 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetPartitionRestoreProgress") 11495 defer func() { 11496 sc := -1 11497 if result.Response.Response != nil { 11498 sc = result.Response.Response.StatusCode 11499 } 11500 tracing.EndSpan(ctx, sc, err) 11501 }() 11502 } 11503 if err := validation.Validate([]validation.Validation{ 11504 {TargetValue: timeout, 11505 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 11506 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 11507 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 11508 }}}}}); err != nil { 11509 return result, validation.NewError("servicefabric.BaseClient", "GetPartitionRestoreProgress", err.Error()) 11510 } 11511 11512 req, err := client.GetPartitionRestoreProgressPreparer(ctx, partitionID, timeout) 11513 if err != nil { 11514 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionRestoreProgress", nil, "Failure preparing request") 11515 return 11516 } 11517 11518 resp, err := client.GetPartitionRestoreProgressSender(req) 11519 if err != nil { 11520 result.Response = autorest.Response{Response: resp} 11521 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionRestoreProgress", resp, "Failure sending request") 11522 return 11523 } 11524 11525 result, err = client.GetPartitionRestoreProgressResponder(resp) 11526 if err != nil { 11527 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionRestoreProgress", resp, "Failure responding to request") 11528 } 11529 11530 return 11531} 11532 11533// GetPartitionRestoreProgressPreparer prepares the GetPartitionRestoreProgress request. 11534func (client BaseClient) GetPartitionRestoreProgressPreparer(ctx context.Context, partitionID uuid.UUID, timeout *int64) (*http.Request, error) { 11535 pathParameters := map[string]interface{}{ 11536 "partitionId": partitionID, 11537 } 11538 11539 const APIVersion = "6.2-preview" 11540 queryParameters := map[string]interface{}{ 11541 "api-version": APIVersion, 11542 } 11543 if timeout != nil { 11544 queryParameters["timeout"] = autorest.Encode("query", *timeout) 11545 } else { 11546 queryParameters["timeout"] = autorest.Encode("query", 60) 11547 } 11548 11549 preparer := autorest.CreatePreparer( 11550 autorest.AsGet(), 11551 autorest.WithBaseURL(client.BaseURI), 11552 autorest.WithPathParameters("/Partitions/{partitionId}/$/GetRestoreProgress", pathParameters), 11553 autorest.WithQueryParameters(queryParameters)) 11554 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 11555} 11556 11557// GetPartitionRestoreProgressSender sends the GetPartitionRestoreProgress request. The method will close the 11558// http.Response Body if it receives an error. 11559func (client BaseClient) GetPartitionRestoreProgressSender(req *http.Request) (*http.Response, error) { 11560 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 11561 return autorest.SendWithSender(client, req, sd...) 11562} 11563 11564// GetPartitionRestoreProgressResponder handles the response to the GetPartitionRestoreProgress request. The method always 11565// closes the http.Response Body. 11566func (client BaseClient) GetPartitionRestoreProgressResponder(resp *http.Response) (result RestoreProgressInfo, err error) { 11567 err = autorest.Respond( 11568 resp, 11569 client.ByInspecting(), 11570 azure.WithErrorUnlessStatusCode(http.StatusOK), 11571 autorest.ByUnmarshallingJSON(&result), 11572 autorest.ByClosing()) 11573 result.Response = autorest.Response{Response: resp} 11574 return 11575} 11576 11577// GetPartitionsEventList the response is list of PartitionEvent objects. 11578// Parameters: 11579// startTimeUtc - the start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. 11580// endTimeUtc - the end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. 11581// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 11582// duration that the client is willing to wait for the requested operation to complete. The default value for 11583// this parameter is 60 seconds. 11584// eventsTypesFilter - this is a comma separated string specifying the types of FabricEvents that should only 11585// be included in the response. 11586// excludeAnalysisEvents - this param disables the retrieval of AnalysisEvents if true is passed. 11587// skipCorrelationLookup - this param disables the search of CorrelatedEvents information if true is passed. 11588// otherwise the CorrelationEvents get processed and HasCorrelatedEvents field in every FabricEvent gets 11589// populated. 11590func (client BaseClient) GetPartitionsEventList(ctx context.Context, startTimeUtc string, endTimeUtc string, timeout *int64, eventsTypesFilter string, excludeAnalysisEvents *bool, skipCorrelationLookup *bool) (result ListPartitionEvent, err error) { 11591 if tracing.IsEnabled() { 11592 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetPartitionsEventList") 11593 defer func() { 11594 sc := -1 11595 if result.Response.Response != nil { 11596 sc = result.Response.Response.StatusCode 11597 } 11598 tracing.EndSpan(ctx, sc, err) 11599 }() 11600 } 11601 if err := validation.Validate([]validation.Validation{ 11602 {TargetValue: timeout, 11603 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 11604 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 11605 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 11606 }}}}}); err != nil { 11607 return result, validation.NewError("servicefabric.BaseClient", "GetPartitionsEventList", err.Error()) 11608 } 11609 11610 req, err := client.GetPartitionsEventListPreparer(ctx, startTimeUtc, endTimeUtc, timeout, eventsTypesFilter, excludeAnalysisEvents, skipCorrelationLookup) 11611 if err != nil { 11612 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionsEventList", nil, "Failure preparing request") 11613 return 11614 } 11615 11616 resp, err := client.GetPartitionsEventListSender(req) 11617 if err != nil { 11618 result.Response = autorest.Response{Response: resp} 11619 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionsEventList", resp, "Failure sending request") 11620 return 11621 } 11622 11623 result, err = client.GetPartitionsEventListResponder(resp) 11624 if err != nil { 11625 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionsEventList", resp, "Failure responding to request") 11626 } 11627 11628 return 11629} 11630 11631// GetPartitionsEventListPreparer prepares the GetPartitionsEventList request. 11632func (client BaseClient) GetPartitionsEventListPreparer(ctx context.Context, startTimeUtc string, endTimeUtc string, timeout *int64, eventsTypesFilter string, excludeAnalysisEvents *bool, skipCorrelationLookup *bool) (*http.Request, error) { 11633 const APIVersion = "6.2-preview" 11634 queryParameters := map[string]interface{}{ 11635 "api-version": APIVersion, 11636 "EndTimeUtc": autorest.Encode("query", endTimeUtc), 11637 "StartTimeUtc": autorest.Encode("query", startTimeUtc), 11638 } 11639 if timeout != nil { 11640 queryParameters["timeout"] = autorest.Encode("query", *timeout) 11641 } else { 11642 queryParameters["timeout"] = autorest.Encode("query", 60) 11643 } 11644 if len(eventsTypesFilter) > 0 { 11645 queryParameters["EventsTypesFilter"] = autorest.Encode("query", eventsTypesFilter) 11646 } 11647 if excludeAnalysisEvents != nil { 11648 queryParameters["ExcludeAnalysisEvents"] = autorest.Encode("query", *excludeAnalysisEvents) 11649 } 11650 if skipCorrelationLookup != nil { 11651 queryParameters["SkipCorrelationLookup"] = autorest.Encode("query", *skipCorrelationLookup) 11652 } 11653 11654 preparer := autorest.CreatePreparer( 11655 autorest.AsGet(), 11656 autorest.WithBaseURL(client.BaseURI), 11657 autorest.WithPath("/EventsStore/Partitions/Events"), 11658 autorest.WithQueryParameters(queryParameters)) 11659 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 11660} 11661 11662// GetPartitionsEventListSender sends the GetPartitionsEventList request. The method will close the 11663// http.Response Body if it receives an error. 11664func (client BaseClient) GetPartitionsEventListSender(req *http.Request) (*http.Response, error) { 11665 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 11666 return autorest.SendWithSender(client, req, sd...) 11667} 11668 11669// GetPartitionsEventListResponder handles the response to the GetPartitionsEventList request. The method always 11670// closes the http.Response Body. 11671func (client BaseClient) GetPartitionsEventListResponder(resp *http.Response) (result ListPartitionEvent, err error) { 11672 err = autorest.Respond( 11673 resp, 11674 client.ByInspecting(), 11675 azure.WithErrorUnlessStatusCode(http.StatusOK), 11676 autorest.ByUnmarshallingJSON(&result), 11677 autorest.ByClosing()) 11678 result.Response = autorest.Response{Response: resp} 11679 return 11680} 11681 11682// GetPropertyInfo gets the specified Service Fabric property under a given name. This will always return both value 11683// and metadata. 11684// Parameters: 11685// nameID - the Service Fabric name, without the 'fabric:' URI scheme. 11686// propertyName - specifies the name of the property to get. 11687// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 11688// duration that the client is willing to wait for the requested operation to complete. The default value for 11689// this parameter is 60 seconds. 11690func (client BaseClient) GetPropertyInfo(ctx context.Context, nameID string, propertyName string, timeout *int64) (result PropertyInfo, err error) { 11691 if tracing.IsEnabled() { 11692 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetPropertyInfo") 11693 defer func() { 11694 sc := -1 11695 if result.Response.Response != nil { 11696 sc = result.Response.Response.StatusCode 11697 } 11698 tracing.EndSpan(ctx, sc, err) 11699 }() 11700 } 11701 if err := validation.Validate([]validation.Validation{ 11702 {TargetValue: timeout, 11703 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 11704 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 11705 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 11706 }}}}}); err != nil { 11707 return result, validation.NewError("servicefabric.BaseClient", "GetPropertyInfo", err.Error()) 11708 } 11709 11710 req, err := client.GetPropertyInfoPreparer(ctx, nameID, propertyName, timeout) 11711 if err != nil { 11712 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPropertyInfo", nil, "Failure preparing request") 11713 return 11714 } 11715 11716 resp, err := client.GetPropertyInfoSender(req) 11717 if err != nil { 11718 result.Response = autorest.Response{Response: resp} 11719 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPropertyInfo", resp, "Failure sending request") 11720 return 11721 } 11722 11723 result, err = client.GetPropertyInfoResponder(resp) 11724 if err != nil { 11725 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPropertyInfo", resp, "Failure responding to request") 11726 } 11727 11728 return 11729} 11730 11731// GetPropertyInfoPreparer prepares the GetPropertyInfo request. 11732func (client BaseClient) GetPropertyInfoPreparer(ctx context.Context, nameID string, propertyName string, timeout *int64) (*http.Request, error) { 11733 pathParameters := map[string]interface{}{ 11734 "nameId": nameID, 11735 } 11736 11737 const APIVersion = "6.0" 11738 queryParameters := map[string]interface{}{ 11739 "api-version": APIVersion, 11740 "PropertyName": autorest.Encode("query", propertyName), 11741 } 11742 if timeout != nil { 11743 queryParameters["timeout"] = autorest.Encode("query", *timeout) 11744 } else { 11745 queryParameters["timeout"] = autorest.Encode("query", 60) 11746 } 11747 11748 preparer := autorest.CreatePreparer( 11749 autorest.AsGet(), 11750 autorest.WithBaseURL(client.BaseURI), 11751 autorest.WithPathParameters("/Names/{nameId}/$/GetProperty", pathParameters), 11752 autorest.WithQueryParameters(queryParameters)) 11753 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 11754} 11755 11756// GetPropertyInfoSender sends the GetPropertyInfo request. The method will close the 11757// http.Response Body if it receives an error. 11758func (client BaseClient) GetPropertyInfoSender(req *http.Request) (*http.Response, error) { 11759 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 11760 return autorest.SendWithSender(client, req, sd...) 11761} 11762 11763// GetPropertyInfoResponder handles the response to the GetPropertyInfo request. The method always 11764// closes the http.Response Body. 11765func (client BaseClient) GetPropertyInfoResponder(resp *http.Response) (result PropertyInfo, err error) { 11766 err = autorest.Respond( 11767 resp, 11768 client.ByInspecting(), 11769 azure.WithErrorUnlessStatusCode(http.StatusOK), 11770 autorest.ByUnmarshallingJSON(&result), 11771 autorest.ByClosing()) 11772 result.Response = autorest.Response{Response: resp} 11773 return 11774} 11775 11776// GetPropertyInfoList a Service Fabric name can have one or more named properties that stores custom information. This 11777// operation gets the information about these properties in a paged list. The information include name, value and 11778// metadata about each of the properties. 11779// Parameters: 11780// nameID - the Service Fabric name, without the 'fabric:' URI scheme. 11781// includeValues - allows specifying whether to include the values of the properties returned. True if values 11782// should be returned with the metadata; False to return only property metadata. 11783// continuationToken - the continuation token parameter is used to obtain next set of results. A continuation 11784// token with a non empty value is included in the response of the API when the results from the system do not 11785// fit in a single response. When this value is passed to the next API call, the API returns next set of 11786// results. If there are no further results then the continuation token does not contain a value. The value of 11787// this parameter should not be URL encoded. 11788// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 11789// duration that the client is willing to wait for the requested operation to complete. The default value for 11790// this parameter is 60 seconds. 11791func (client BaseClient) GetPropertyInfoList(ctx context.Context, nameID string, includeValues *bool, continuationToken string, timeout *int64) (result PagedPropertyInfoList, err error) { 11792 if tracing.IsEnabled() { 11793 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetPropertyInfoList") 11794 defer func() { 11795 sc := -1 11796 if result.Response.Response != nil { 11797 sc = result.Response.Response.StatusCode 11798 } 11799 tracing.EndSpan(ctx, sc, err) 11800 }() 11801 } 11802 if err := validation.Validate([]validation.Validation{ 11803 {TargetValue: timeout, 11804 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 11805 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 11806 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 11807 }}}}}); err != nil { 11808 return result, validation.NewError("servicefabric.BaseClient", "GetPropertyInfoList", err.Error()) 11809 } 11810 11811 req, err := client.GetPropertyInfoListPreparer(ctx, nameID, includeValues, continuationToken, timeout) 11812 if err != nil { 11813 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPropertyInfoList", nil, "Failure preparing request") 11814 return 11815 } 11816 11817 resp, err := client.GetPropertyInfoListSender(req) 11818 if err != nil { 11819 result.Response = autorest.Response{Response: resp} 11820 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPropertyInfoList", resp, "Failure sending request") 11821 return 11822 } 11823 11824 result, err = client.GetPropertyInfoListResponder(resp) 11825 if err != nil { 11826 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPropertyInfoList", resp, "Failure responding to request") 11827 } 11828 11829 return 11830} 11831 11832// GetPropertyInfoListPreparer prepares the GetPropertyInfoList request. 11833func (client BaseClient) GetPropertyInfoListPreparer(ctx context.Context, nameID string, includeValues *bool, continuationToken string, timeout *int64) (*http.Request, error) { 11834 pathParameters := map[string]interface{}{ 11835 "nameId": nameID, 11836 } 11837 11838 const APIVersion = "6.0" 11839 queryParameters := map[string]interface{}{ 11840 "api-version": APIVersion, 11841 } 11842 if includeValues != nil { 11843 queryParameters["IncludeValues"] = autorest.Encode("query", *includeValues) 11844 } else { 11845 queryParameters["IncludeValues"] = autorest.Encode("query", false) 11846 } 11847 if len(continuationToken) > 0 { 11848 queryParameters["ContinuationToken"] = continuationToken 11849 } 11850 if timeout != nil { 11851 queryParameters["timeout"] = autorest.Encode("query", *timeout) 11852 } else { 11853 queryParameters["timeout"] = autorest.Encode("query", 60) 11854 } 11855 11856 preparer := autorest.CreatePreparer( 11857 autorest.AsGet(), 11858 autorest.WithBaseURL(client.BaseURI), 11859 autorest.WithPathParameters("/Names/{nameId}/$/GetProperties", pathParameters), 11860 autorest.WithQueryParameters(queryParameters)) 11861 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 11862} 11863 11864// GetPropertyInfoListSender sends the GetPropertyInfoList request. The method will close the 11865// http.Response Body if it receives an error. 11866func (client BaseClient) GetPropertyInfoListSender(req *http.Request) (*http.Response, error) { 11867 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 11868 return autorest.SendWithSender(client, req, sd...) 11869} 11870 11871// GetPropertyInfoListResponder handles the response to the GetPropertyInfoList request. The method always 11872// closes the http.Response Body. 11873func (client BaseClient) GetPropertyInfoListResponder(resp *http.Response) (result PagedPropertyInfoList, err error) { 11874 err = autorest.Respond( 11875 resp, 11876 client.ByInspecting(), 11877 azure.WithErrorUnlessStatusCode(http.StatusOK), 11878 autorest.ByUnmarshallingJSON(&result), 11879 autorest.ByClosing()) 11880 result.Response = autorest.Response{Response: resp} 11881 return 11882} 11883 11884// GetProvisionedFabricCodeVersionInfoList gets a list of information about fabric code versions that are provisioned 11885// in the cluster. The parameter CodeVersion can be used to optionally filter the output to only that particular 11886// version. 11887// Parameters: 11888// codeVersion - the product version of Service Fabric. 11889// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 11890// duration that the client is willing to wait for the requested operation to complete. The default value for 11891// this parameter is 60 seconds. 11892func (client BaseClient) GetProvisionedFabricCodeVersionInfoList(ctx context.Context, codeVersion string, timeout *int64) (result ListFabricCodeVersionInfo, err error) { 11893 if tracing.IsEnabled() { 11894 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetProvisionedFabricCodeVersionInfoList") 11895 defer func() { 11896 sc := -1 11897 if result.Response.Response != nil { 11898 sc = result.Response.Response.StatusCode 11899 } 11900 tracing.EndSpan(ctx, sc, err) 11901 }() 11902 } 11903 if err := validation.Validate([]validation.Validation{ 11904 {TargetValue: timeout, 11905 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 11906 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 11907 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 11908 }}}}}); err != nil { 11909 return result, validation.NewError("servicefabric.BaseClient", "GetProvisionedFabricCodeVersionInfoList", err.Error()) 11910 } 11911 11912 req, err := client.GetProvisionedFabricCodeVersionInfoListPreparer(ctx, codeVersion, timeout) 11913 if err != nil { 11914 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetProvisionedFabricCodeVersionInfoList", nil, "Failure preparing request") 11915 return 11916 } 11917 11918 resp, err := client.GetProvisionedFabricCodeVersionInfoListSender(req) 11919 if err != nil { 11920 result.Response = autorest.Response{Response: resp} 11921 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetProvisionedFabricCodeVersionInfoList", resp, "Failure sending request") 11922 return 11923 } 11924 11925 result, err = client.GetProvisionedFabricCodeVersionInfoListResponder(resp) 11926 if err != nil { 11927 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetProvisionedFabricCodeVersionInfoList", resp, "Failure responding to request") 11928 } 11929 11930 return 11931} 11932 11933// GetProvisionedFabricCodeVersionInfoListPreparer prepares the GetProvisionedFabricCodeVersionInfoList request. 11934func (client BaseClient) GetProvisionedFabricCodeVersionInfoListPreparer(ctx context.Context, codeVersion string, timeout *int64) (*http.Request, error) { 11935 const APIVersion = "6.0" 11936 queryParameters := map[string]interface{}{ 11937 "api-version": APIVersion, 11938 } 11939 if len(codeVersion) > 0 { 11940 queryParameters["CodeVersion"] = autorest.Encode("query", codeVersion) 11941 } 11942 if timeout != nil { 11943 queryParameters["timeout"] = autorest.Encode("query", *timeout) 11944 } else { 11945 queryParameters["timeout"] = autorest.Encode("query", 60) 11946 } 11947 11948 preparer := autorest.CreatePreparer( 11949 autorest.AsGet(), 11950 autorest.WithBaseURL(client.BaseURI), 11951 autorest.WithPath("/$/GetProvisionedCodeVersions"), 11952 autorest.WithQueryParameters(queryParameters)) 11953 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 11954} 11955 11956// GetProvisionedFabricCodeVersionInfoListSender sends the GetProvisionedFabricCodeVersionInfoList request. The method will close the 11957// http.Response Body if it receives an error. 11958func (client BaseClient) GetProvisionedFabricCodeVersionInfoListSender(req *http.Request) (*http.Response, error) { 11959 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 11960 return autorest.SendWithSender(client, req, sd...) 11961} 11962 11963// GetProvisionedFabricCodeVersionInfoListResponder handles the response to the GetProvisionedFabricCodeVersionInfoList request. The method always 11964// closes the http.Response Body. 11965func (client BaseClient) GetProvisionedFabricCodeVersionInfoListResponder(resp *http.Response) (result ListFabricCodeVersionInfo, err error) { 11966 err = autorest.Respond( 11967 resp, 11968 client.ByInspecting(), 11969 azure.WithErrorUnlessStatusCode(http.StatusOK), 11970 autorest.ByUnmarshallingJSON(&result.Value), 11971 autorest.ByClosing()) 11972 result.Response = autorest.Response{Response: resp} 11973 return 11974} 11975 11976// GetProvisionedFabricConfigVersionInfoList gets a list of information about fabric config versions that are 11977// provisioned in the cluster. The parameter ConfigVersion can be used to optionally filter the output to only that 11978// particular version. 11979// Parameters: 11980// configVersion - the config version of Service Fabric. 11981// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 11982// duration that the client is willing to wait for the requested operation to complete. The default value for 11983// this parameter is 60 seconds. 11984func (client BaseClient) GetProvisionedFabricConfigVersionInfoList(ctx context.Context, configVersion string, timeout *int64) (result ListFabricConfigVersionInfo, err error) { 11985 if tracing.IsEnabled() { 11986 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetProvisionedFabricConfigVersionInfoList") 11987 defer func() { 11988 sc := -1 11989 if result.Response.Response != nil { 11990 sc = result.Response.Response.StatusCode 11991 } 11992 tracing.EndSpan(ctx, sc, err) 11993 }() 11994 } 11995 if err := validation.Validate([]validation.Validation{ 11996 {TargetValue: timeout, 11997 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 11998 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 11999 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 12000 }}}}}); err != nil { 12001 return result, validation.NewError("servicefabric.BaseClient", "GetProvisionedFabricConfigVersionInfoList", err.Error()) 12002 } 12003 12004 req, err := client.GetProvisionedFabricConfigVersionInfoListPreparer(ctx, configVersion, timeout) 12005 if err != nil { 12006 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetProvisionedFabricConfigVersionInfoList", nil, "Failure preparing request") 12007 return 12008 } 12009 12010 resp, err := client.GetProvisionedFabricConfigVersionInfoListSender(req) 12011 if err != nil { 12012 result.Response = autorest.Response{Response: resp} 12013 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetProvisionedFabricConfigVersionInfoList", resp, "Failure sending request") 12014 return 12015 } 12016 12017 result, err = client.GetProvisionedFabricConfigVersionInfoListResponder(resp) 12018 if err != nil { 12019 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetProvisionedFabricConfigVersionInfoList", resp, "Failure responding to request") 12020 } 12021 12022 return 12023} 12024 12025// GetProvisionedFabricConfigVersionInfoListPreparer prepares the GetProvisionedFabricConfigVersionInfoList request. 12026func (client BaseClient) GetProvisionedFabricConfigVersionInfoListPreparer(ctx context.Context, configVersion string, timeout *int64) (*http.Request, error) { 12027 const APIVersion = "6.0" 12028 queryParameters := map[string]interface{}{ 12029 "api-version": APIVersion, 12030 } 12031 if len(configVersion) > 0 { 12032 queryParameters["ConfigVersion"] = autorest.Encode("query", configVersion) 12033 } 12034 if timeout != nil { 12035 queryParameters["timeout"] = autorest.Encode("query", *timeout) 12036 } else { 12037 queryParameters["timeout"] = autorest.Encode("query", 60) 12038 } 12039 12040 preparer := autorest.CreatePreparer( 12041 autorest.AsGet(), 12042 autorest.WithBaseURL(client.BaseURI), 12043 autorest.WithPath("/$/GetProvisionedConfigVersions"), 12044 autorest.WithQueryParameters(queryParameters)) 12045 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 12046} 12047 12048// GetProvisionedFabricConfigVersionInfoListSender sends the GetProvisionedFabricConfigVersionInfoList request. The method will close the 12049// http.Response Body if it receives an error. 12050func (client BaseClient) GetProvisionedFabricConfigVersionInfoListSender(req *http.Request) (*http.Response, error) { 12051 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 12052 return autorest.SendWithSender(client, req, sd...) 12053} 12054 12055// GetProvisionedFabricConfigVersionInfoListResponder handles the response to the GetProvisionedFabricConfigVersionInfoList request. The method always 12056// closes the http.Response Body. 12057func (client BaseClient) GetProvisionedFabricConfigVersionInfoListResponder(resp *http.Response) (result ListFabricConfigVersionInfo, err error) { 12058 err = autorest.Respond( 12059 resp, 12060 client.ByInspecting(), 12061 azure.WithErrorUnlessStatusCode(http.StatusOK), 12062 autorest.ByUnmarshallingJSON(&result.Value), 12063 autorest.ByClosing()) 12064 result.Response = autorest.Response{Response: resp} 12065 return 12066} 12067 12068// GetQuorumLossProgress gets the progress of a quorum loss operation started with StartQuorumLoss, using the provided 12069// OperationId. 12070// Parameters: 12071// serviceID - the identity of the service. This is typically the full name of the service without the 12072// 'fabric:' URI scheme. 12073// Starting from version 6.0, hierarchical names are delimited with the "~" character. 12074// For example, if the service name is "fabric:/myapp/app1/svc1", the service identity would be 12075// "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in previous versions. 12076// partitionID - the identity of the partition. 12077// operationID - a GUID that identifies a call of this API. This is passed into the corresponding GetProgress 12078// API 12079// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 12080// duration that the client is willing to wait for the requested operation to complete. The default value for 12081// this parameter is 60 seconds. 12082func (client BaseClient) GetQuorumLossProgress(ctx context.Context, serviceID string, partitionID uuid.UUID, operationID uuid.UUID, timeout *int64) (result PartitionQuorumLossProgress, err error) { 12083 if tracing.IsEnabled() { 12084 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetQuorumLossProgress") 12085 defer func() { 12086 sc := -1 12087 if result.Response.Response != nil { 12088 sc = result.Response.Response.StatusCode 12089 } 12090 tracing.EndSpan(ctx, sc, err) 12091 }() 12092 } 12093 if err := validation.Validate([]validation.Validation{ 12094 {TargetValue: timeout, 12095 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 12096 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 12097 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 12098 }}}}}); err != nil { 12099 return result, validation.NewError("servicefabric.BaseClient", "GetQuorumLossProgress", err.Error()) 12100 } 12101 12102 req, err := client.GetQuorumLossProgressPreparer(ctx, serviceID, partitionID, operationID, timeout) 12103 if err != nil { 12104 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetQuorumLossProgress", nil, "Failure preparing request") 12105 return 12106 } 12107 12108 resp, err := client.GetQuorumLossProgressSender(req) 12109 if err != nil { 12110 result.Response = autorest.Response{Response: resp} 12111 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetQuorumLossProgress", resp, "Failure sending request") 12112 return 12113 } 12114 12115 result, err = client.GetQuorumLossProgressResponder(resp) 12116 if err != nil { 12117 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetQuorumLossProgress", resp, "Failure responding to request") 12118 } 12119 12120 return 12121} 12122 12123// GetQuorumLossProgressPreparer prepares the GetQuorumLossProgress request. 12124func (client BaseClient) GetQuorumLossProgressPreparer(ctx context.Context, serviceID string, partitionID uuid.UUID, operationID uuid.UUID, timeout *int64) (*http.Request, error) { 12125 pathParameters := map[string]interface{}{ 12126 "partitionId": partitionID, 12127 "serviceId": serviceID, 12128 } 12129 12130 const APIVersion = "6.0" 12131 queryParameters := map[string]interface{}{ 12132 "api-version": APIVersion, 12133 "OperationId": autorest.Encode("query", operationID), 12134 } 12135 if timeout != nil { 12136 queryParameters["timeout"] = autorest.Encode("query", *timeout) 12137 } else { 12138 queryParameters["timeout"] = autorest.Encode("query", 60) 12139 } 12140 12141 preparer := autorest.CreatePreparer( 12142 autorest.AsGet(), 12143 autorest.WithBaseURL(client.BaseURI), 12144 autorest.WithPathParameters("/Faults/Services/{serviceId}/$/GetPartitions/{partitionId}/$/GetQuorumLossProgress", pathParameters), 12145 autorest.WithQueryParameters(queryParameters)) 12146 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 12147} 12148 12149// GetQuorumLossProgressSender sends the GetQuorumLossProgress request. The method will close the 12150// http.Response Body if it receives an error. 12151func (client BaseClient) GetQuorumLossProgressSender(req *http.Request) (*http.Response, error) { 12152 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 12153 return autorest.SendWithSender(client, req, sd...) 12154} 12155 12156// GetQuorumLossProgressResponder handles the response to the GetQuorumLossProgress request. The method always 12157// closes the http.Response Body. 12158func (client BaseClient) GetQuorumLossProgressResponder(resp *http.Response) (result PartitionQuorumLossProgress, err error) { 12159 err = autorest.Respond( 12160 resp, 12161 client.ByInspecting(), 12162 azure.WithErrorUnlessStatusCode(http.StatusOK), 12163 autorest.ByUnmarshallingJSON(&result), 12164 autorest.ByClosing()) 12165 result.Response = autorest.Response{Response: resp} 12166 return 12167} 12168 12169// GetRepairTaskList this API supports the Service Fabric platform; it is not meant to be used directly from your code. 12170// Parameters: 12171// taskIDFilter - the repair task ID prefix to be matched. 12172// stateFilter - a bitwise-OR of the following values, specifying which task states should be included in the 12173// result list. 12174// - 1 - Created 12175// - 2 - Claimed 12176// - 4 - Preparing 12177// - 8 - Approved 12178// - 16 - Executing 12179// - 32 - Restoring 12180// - 64 - Completed 12181// executorFilter - the name of the repair executor whose claimed tasks should be included in the list. 12182func (client BaseClient) GetRepairTaskList(ctx context.Context, taskIDFilter string, stateFilter *int32, executorFilter string) (result ListRepairTask, err error) { 12183 if tracing.IsEnabled() { 12184 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetRepairTaskList") 12185 defer func() { 12186 sc := -1 12187 if result.Response.Response != nil { 12188 sc = result.Response.Response.StatusCode 12189 } 12190 tracing.EndSpan(ctx, sc, err) 12191 }() 12192 } 12193 req, err := client.GetRepairTaskListPreparer(ctx, taskIDFilter, stateFilter, executorFilter) 12194 if err != nil { 12195 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetRepairTaskList", nil, "Failure preparing request") 12196 return 12197 } 12198 12199 resp, err := client.GetRepairTaskListSender(req) 12200 if err != nil { 12201 result.Response = autorest.Response{Response: resp} 12202 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetRepairTaskList", resp, "Failure sending request") 12203 return 12204 } 12205 12206 result, err = client.GetRepairTaskListResponder(resp) 12207 if err != nil { 12208 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetRepairTaskList", resp, "Failure responding to request") 12209 } 12210 12211 return 12212} 12213 12214// GetRepairTaskListPreparer prepares the GetRepairTaskList request. 12215func (client BaseClient) GetRepairTaskListPreparer(ctx context.Context, taskIDFilter string, stateFilter *int32, executorFilter string) (*http.Request, error) { 12216 const APIVersion = "6.0" 12217 queryParameters := map[string]interface{}{ 12218 "api-version": APIVersion, 12219 } 12220 if len(taskIDFilter) > 0 { 12221 queryParameters["TaskIdFilter"] = autorest.Encode("query", taskIDFilter) 12222 } 12223 if stateFilter != nil { 12224 queryParameters["StateFilter"] = autorest.Encode("query", *stateFilter) 12225 } 12226 if len(executorFilter) > 0 { 12227 queryParameters["ExecutorFilter"] = autorest.Encode("query", executorFilter) 12228 } 12229 12230 preparer := autorest.CreatePreparer( 12231 autorest.AsGet(), 12232 autorest.WithBaseURL(client.BaseURI), 12233 autorest.WithPath("/$/GetRepairTaskList"), 12234 autorest.WithQueryParameters(queryParameters)) 12235 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 12236} 12237 12238// GetRepairTaskListSender sends the GetRepairTaskList request. The method will close the 12239// http.Response Body if it receives an error. 12240func (client BaseClient) GetRepairTaskListSender(req *http.Request) (*http.Response, error) { 12241 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 12242 return autorest.SendWithSender(client, req, sd...) 12243} 12244 12245// GetRepairTaskListResponder handles the response to the GetRepairTaskList request. The method always 12246// closes the http.Response Body. 12247func (client BaseClient) GetRepairTaskListResponder(resp *http.Response) (result ListRepairTask, err error) { 12248 err = autorest.Respond( 12249 resp, 12250 client.ByInspecting(), 12251 azure.WithErrorUnlessStatusCode(http.StatusOK), 12252 autorest.ByUnmarshallingJSON(&result.Value), 12253 autorest.ByClosing()) 12254 result.Response = autorest.Response{Response: resp} 12255 return 12256} 12257 12258// GetReplicaHealth gets the health of a Service Fabric replica. 12259// Use EventsHealthStateFilter to filter the collection of health events reported on the replica based on the health 12260// state. 12261// Parameters: 12262// partitionID - the identity of the partition. 12263// replicaID - the identifier of the replica. 12264// eventsHealthStateFilter - allows filtering the collection of HealthEvent objects returned based on health 12265// state. 12266// The possible values for this parameter include integer value of one of the following health states. 12267// Only events that match the filter are returned. All events are used to evaluate the aggregated health state. 12268// If not specified, all entries are returned. The state values are flag based enumeration, so the value could 12269// be a combination of these value obtained using bitwise 'OR' operator. For example, If the provided value is 12270// 6 then all of the events with HealthState value of OK (2) and Warning (4) are returned. 12271// 12272// - Default - Default value. Matches any HealthState. The value is zero. 12273// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given 12274// collection of states. The value is 1. 12275// - Ok - Filter that matches input with HealthState value Ok. The value is 2. 12276// - Warning - Filter that matches input with HealthState value Warning. The value is 4. 12277// - Error - Filter that matches input with HealthState value Error. The value is 8. 12278// - All - Filter that matches input with any HealthState value. The value is 65535. 12279// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 12280// duration that the client is willing to wait for the requested operation to complete. The default value for 12281// this parameter is 60 seconds. 12282func (client BaseClient) GetReplicaHealth(ctx context.Context, partitionID uuid.UUID, replicaID string, eventsHealthStateFilter *int32, timeout *int64) (result ReplicaHealthModel, err error) { 12283 if tracing.IsEnabled() { 12284 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetReplicaHealth") 12285 defer func() { 12286 sc := -1 12287 if result.Response.Response != nil { 12288 sc = result.Response.Response.StatusCode 12289 } 12290 tracing.EndSpan(ctx, sc, err) 12291 }() 12292 } 12293 if err := validation.Validate([]validation.Validation{ 12294 {TargetValue: timeout, 12295 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 12296 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 12297 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 12298 }}}}}); err != nil { 12299 return result, validation.NewError("servicefabric.BaseClient", "GetReplicaHealth", err.Error()) 12300 } 12301 12302 req, err := client.GetReplicaHealthPreparer(ctx, partitionID, replicaID, eventsHealthStateFilter, timeout) 12303 if err != nil { 12304 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetReplicaHealth", nil, "Failure preparing request") 12305 return 12306 } 12307 12308 resp, err := client.GetReplicaHealthSender(req) 12309 if err != nil { 12310 result.Response = autorest.Response{Response: resp} 12311 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetReplicaHealth", resp, "Failure sending request") 12312 return 12313 } 12314 12315 result, err = client.GetReplicaHealthResponder(resp) 12316 if err != nil { 12317 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetReplicaHealth", resp, "Failure responding to request") 12318 } 12319 12320 return 12321} 12322 12323// GetReplicaHealthPreparer prepares the GetReplicaHealth request. 12324func (client BaseClient) GetReplicaHealthPreparer(ctx context.Context, partitionID uuid.UUID, replicaID string, eventsHealthStateFilter *int32, timeout *int64) (*http.Request, error) { 12325 pathParameters := map[string]interface{}{ 12326 "partitionId": partitionID, 12327 "replicaId": replicaID, 12328 } 12329 12330 const APIVersion = "6.0" 12331 queryParameters := map[string]interface{}{ 12332 "api-version": APIVersion, 12333 } 12334 if eventsHealthStateFilter != nil { 12335 queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", *eventsHealthStateFilter) 12336 } else { 12337 queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", 0) 12338 } 12339 if timeout != nil { 12340 queryParameters["timeout"] = autorest.Encode("query", *timeout) 12341 } else { 12342 queryParameters["timeout"] = autorest.Encode("query", 60) 12343 } 12344 12345 preparer := autorest.CreatePreparer( 12346 autorest.AsGet(), 12347 autorest.WithBaseURL(client.BaseURI), 12348 autorest.WithPathParameters("/Partitions/{partitionId}/$/GetReplicas/{replicaId}/$/GetHealth", pathParameters), 12349 autorest.WithQueryParameters(queryParameters)) 12350 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 12351} 12352 12353// GetReplicaHealthSender sends the GetReplicaHealth request. The method will close the 12354// http.Response Body if it receives an error. 12355func (client BaseClient) GetReplicaHealthSender(req *http.Request) (*http.Response, error) { 12356 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 12357 return autorest.SendWithSender(client, req, sd...) 12358} 12359 12360// GetReplicaHealthResponder handles the response to the GetReplicaHealth request. The method always 12361// closes the http.Response Body. 12362func (client BaseClient) GetReplicaHealthResponder(resp *http.Response) (result ReplicaHealthModel, err error) { 12363 err = autorest.Respond( 12364 resp, 12365 client.ByInspecting(), 12366 azure.WithErrorUnlessStatusCode(http.StatusOK), 12367 autorest.ByUnmarshallingJSON(&result), 12368 autorest.ByClosing()) 12369 result.Response = autorest.Response{Response: resp} 12370 return 12371} 12372 12373// GetReplicaHealthUsingPolicy gets the health of a Service Fabric stateful service replica or stateless service 12374// instance. 12375// Use EventsHealthStateFilter to filter the collection of health events reported on the cluster based on the health 12376// state. 12377// Use ApplicationHealthPolicy to optionally override the health policies used to evaluate the health. This API only 12378// uses 'ConsiderWarningAsError' field of the ApplicationHealthPolicy. The rest of the fields are ignored while 12379// evaluating the health of the replica. 12380// Parameters: 12381// partitionID - the identity of the partition. 12382// replicaID - the identifier of the replica. 12383// eventsHealthStateFilter - allows filtering the collection of HealthEvent objects returned based on health 12384// state. 12385// The possible values for this parameter include integer value of one of the following health states. 12386// Only events that match the filter are returned. All events are used to evaluate the aggregated health state. 12387// If not specified, all entries are returned. The state values are flag based enumeration, so the value could 12388// be a combination of these value obtained using bitwise 'OR' operator. For example, If the provided value is 12389// 6 then all of the events with HealthState value of OK (2) and Warning (4) are returned. 12390// 12391// - Default - Default value. Matches any HealthState. The value is zero. 12392// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given 12393// collection of states. The value is 1. 12394// - Ok - Filter that matches input with HealthState value Ok. The value is 2. 12395// - Warning - Filter that matches input with HealthState value Warning. The value is 4. 12396// - Error - Filter that matches input with HealthState value Error. The value is 8. 12397// - All - Filter that matches input with any HealthState value. The value is 65535. 12398// applicationHealthPolicy - describes the health policies used to evaluate the health of an application or one 12399// of its children. 12400// If not present, the health evaluation uses the health policy from application manifest or the default health 12401// policy. 12402// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 12403// duration that the client is willing to wait for the requested operation to complete. The default value for 12404// this parameter is 60 seconds. 12405func (client BaseClient) GetReplicaHealthUsingPolicy(ctx context.Context, partitionID uuid.UUID, replicaID string, eventsHealthStateFilter *int32, applicationHealthPolicy *ApplicationHealthPolicy, timeout *int64) (result ReplicaHealthModel, err error) { 12406 if tracing.IsEnabled() { 12407 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetReplicaHealthUsingPolicy") 12408 defer func() { 12409 sc := -1 12410 if result.Response.Response != nil { 12411 sc = result.Response.Response.StatusCode 12412 } 12413 tracing.EndSpan(ctx, sc, err) 12414 }() 12415 } 12416 if err := validation.Validate([]validation.Validation{ 12417 {TargetValue: timeout, 12418 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 12419 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 12420 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 12421 }}}}}); err != nil { 12422 return result, validation.NewError("servicefabric.BaseClient", "GetReplicaHealthUsingPolicy", err.Error()) 12423 } 12424 12425 req, err := client.GetReplicaHealthUsingPolicyPreparer(ctx, partitionID, replicaID, eventsHealthStateFilter, applicationHealthPolicy, timeout) 12426 if err != nil { 12427 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetReplicaHealthUsingPolicy", nil, "Failure preparing request") 12428 return 12429 } 12430 12431 resp, err := client.GetReplicaHealthUsingPolicySender(req) 12432 if err != nil { 12433 result.Response = autorest.Response{Response: resp} 12434 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetReplicaHealthUsingPolicy", resp, "Failure sending request") 12435 return 12436 } 12437 12438 result, err = client.GetReplicaHealthUsingPolicyResponder(resp) 12439 if err != nil { 12440 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetReplicaHealthUsingPolicy", resp, "Failure responding to request") 12441 } 12442 12443 return 12444} 12445 12446// GetReplicaHealthUsingPolicyPreparer prepares the GetReplicaHealthUsingPolicy request. 12447func (client BaseClient) GetReplicaHealthUsingPolicyPreparer(ctx context.Context, partitionID uuid.UUID, replicaID string, eventsHealthStateFilter *int32, applicationHealthPolicy *ApplicationHealthPolicy, timeout *int64) (*http.Request, error) { 12448 pathParameters := map[string]interface{}{ 12449 "partitionId": partitionID, 12450 "replicaId": replicaID, 12451 } 12452 12453 const APIVersion = "6.0" 12454 queryParameters := map[string]interface{}{ 12455 "api-version": APIVersion, 12456 } 12457 if eventsHealthStateFilter != nil { 12458 queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", *eventsHealthStateFilter) 12459 } else { 12460 queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", 0) 12461 } 12462 if timeout != nil { 12463 queryParameters["timeout"] = autorest.Encode("query", *timeout) 12464 } else { 12465 queryParameters["timeout"] = autorest.Encode("query", 60) 12466 } 12467 12468 preparer := autorest.CreatePreparer( 12469 autorest.AsContentType("application/json; charset=utf-8"), 12470 autorest.AsPost(), 12471 autorest.WithBaseURL(client.BaseURI), 12472 autorest.WithPathParameters("/Partitions/{partitionId}/$/GetReplicas/{replicaId}/$/GetHealth", pathParameters), 12473 autorest.WithQueryParameters(queryParameters)) 12474 if applicationHealthPolicy != nil { 12475 preparer = autorest.DecoratePreparer(preparer, 12476 autorest.WithJSON(applicationHealthPolicy)) 12477 } 12478 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 12479} 12480 12481// GetReplicaHealthUsingPolicySender sends the GetReplicaHealthUsingPolicy request. The method will close the 12482// http.Response Body if it receives an error. 12483func (client BaseClient) GetReplicaHealthUsingPolicySender(req *http.Request) (*http.Response, error) { 12484 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 12485 return autorest.SendWithSender(client, req, sd...) 12486} 12487 12488// GetReplicaHealthUsingPolicyResponder handles the response to the GetReplicaHealthUsingPolicy request. The method always 12489// closes the http.Response Body. 12490func (client BaseClient) GetReplicaHealthUsingPolicyResponder(resp *http.Response) (result ReplicaHealthModel, err error) { 12491 err = autorest.Respond( 12492 resp, 12493 client.ByInspecting(), 12494 azure.WithErrorUnlessStatusCode(http.StatusOK), 12495 autorest.ByUnmarshallingJSON(&result), 12496 autorest.ByClosing()) 12497 result.Response = autorest.Response{Response: resp} 12498 return 12499} 12500 12501// GetReplicaInfo the response includes the id, role, status, health, node name, uptime, and other details about the 12502// replica. 12503// Parameters: 12504// partitionID - the identity of the partition. 12505// replicaID - the identifier of the replica. 12506// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 12507// duration that the client is willing to wait for the requested operation to complete. The default value for 12508// this parameter is 60 seconds. 12509func (client BaseClient) GetReplicaInfo(ctx context.Context, partitionID uuid.UUID, replicaID string, timeout *int64) (result ReplicaInfoModel, err error) { 12510 if tracing.IsEnabled() { 12511 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetReplicaInfo") 12512 defer func() { 12513 sc := -1 12514 if result.Response.Response != nil { 12515 sc = result.Response.Response.StatusCode 12516 } 12517 tracing.EndSpan(ctx, sc, err) 12518 }() 12519 } 12520 if err := validation.Validate([]validation.Validation{ 12521 {TargetValue: timeout, 12522 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 12523 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 12524 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 12525 }}}}}); err != nil { 12526 return result, validation.NewError("servicefabric.BaseClient", "GetReplicaInfo", err.Error()) 12527 } 12528 12529 req, err := client.GetReplicaInfoPreparer(ctx, partitionID, replicaID, timeout) 12530 if err != nil { 12531 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetReplicaInfo", nil, "Failure preparing request") 12532 return 12533 } 12534 12535 resp, err := client.GetReplicaInfoSender(req) 12536 if err != nil { 12537 result.Response = autorest.Response{Response: resp} 12538 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetReplicaInfo", resp, "Failure sending request") 12539 return 12540 } 12541 12542 result, err = client.GetReplicaInfoResponder(resp) 12543 if err != nil { 12544 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetReplicaInfo", resp, "Failure responding to request") 12545 } 12546 12547 return 12548} 12549 12550// GetReplicaInfoPreparer prepares the GetReplicaInfo request. 12551func (client BaseClient) GetReplicaInfoPreparer(ctx context.Context, partitionID uuid.UUID, replicaID string, timeout *int64) (*http.Request, error) { 12552 pathParameters := map[string]interface{}{ 12553 "partitionId": partitionID, 12554 "replicaId": replicaID, 12555 } 12556 12557 const APIVersion = "6.0" 12558 queryParameters := map[string]interface{}{ 12559 "api-version": APIVersion, 12560 } 12561 if timeout != nil { 12562 queryParameters["timeout"] = autorest.Encode("query", *timeout) 12563 } else { 12564 queryParameters["timeout"] = autorest.Encode("query", 60) 12565 } 12566 12567 preparer := autorest.CreatePreparer( 12568 autorest.AsGet(), 12569 autorest.WithBaseURL(client.BaseURI), 12570 autorest.WithPathParameters("/Partitions/{partitionId}/$/GetReplicas/{replicaId}", pathParameters), 12571 autorest.WithQueryParameters(queryParameters)) 12572 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 12573} 12574 12575// GetReplicaInfoSender sends the GetReplicaInfo request. The method will close the 12576// http.Response Body if it receives an error. 12577func (client BaseClient) GetReplicaInfoSender(req *http.Request) (*http.Response, error) { 12578 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 12579 return autorest.SendWithSender(client, req, sd...) 12580} 12581 12582// GetReplicaInfoResponder handles the response to the GetReplicaInfo request. The method always 12583// closes the http.Response Body. 12584func (client BaseClient) GetReplicaInfoResponder(resp *http.Response) (result ReplicaInfoModel, err error) { 12585 err = autorest.Respond( 12586 resp, 12587 client.ByInspecting(), 12588 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), 12589 autorest.ByUnmarshallingJSON(&result), 12590 autorest.ByClosing()) 12591 result.Response = autorest.Response{Response: resp} 12592 return 12593} 12594 12595// GetReplicaInfoList the GetReplicas endpoint returns information about the replicas of the specified partition. The 12596// response includes the id, role, status, health, node name, uptime, and other details about the replica. 12597// Parameters: 12598// partitionID - the identity of the partition. 12599// continuationToken - the continuation token parameter is used to obtain next set of results. A continuation 12600// token with a non empty value is included in the response of the API when the results from the system do not 12601// fit in a single response. When this value is passed to the next API call, the API returns next set of 12602// results. If there are no further results then the continuation token does not contain a value. The value of 12603// this parameter should not be URL encoded. 12604// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 12605// duration that the client is willing to wait for the requested operation to complete. The default value for 12606// this parameter is 60 seconds. 12607func (client BaseClient) GetReplicaInfoList(ctx context.Context, partitionID uuid.UUID, continuationToken string, timeout *int64) (result PagedReplicaInfoList, err error) { 12608 if tracing.IsEnabled() { 12609 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetReplicaInfoList") 12610 defer func() { 12611 sc := -1 12612 if result.Response.Response != nil { 12613 sc = result.Response.Response.StatusCode 12614 } 12615 tracing.EndSpan(ctx, sc, err) 12616 }() 12617 } 12618 if err := validation.Validate([]validation.Validation{ 12619 {TargetValue: timeout, 12620 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 12621 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 12622 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 12623 }}}}}); err != nil { 12624 return result, validation.NewError("servicefabric.BaseClient", "GetReplicaInfoList", err.Error()) 12625 } 12626 12627 req, err := client.GetReplicaInfoListPreparer(ctx, partitionID, continuationToken, timeout) 12628 if err != nil { 12629 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetReplicaInfoList", nil, "Failure preparing request") 12630 return 12631 } 12632 12633 resp, err := client.GetReplicaInfoListSender(req) 12634 if err != nil { 12635 result.Response = autorest.Response{Response: resp} 12636 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetReplicaInfoList", resp, "Failure sending request") 12637 return 12638 } 12639 12640 result, err = client.GetReplicaInfoListResponder(resp) 12641 if err != nil { 12642 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetReplicaInfoList", resp, "Failure responding to request") 12643 } 12644 12645 return 12646} 12647 12648// GetReplicaInfoListPreparer prepares the GetReplicaInfoList request. 12649func (client BaseClient) GetReplicaInfoListPreparer(ctx context.Context, partitionID uuid.UUID, continuationToken string, timeout *int64) (*http.Request, error) { 12650 pathParameters := map[string]interface{}{ 12651 "partitionId": partitionID, 12652 } 12653 12654 const APIVersion = "6.0" 12655 queryParameters := map[string]interface{}{ 12656 "api-version": APIVersion, 12657 } 12658 if len(continuationToken) > 0 { 12659 queryParameters["ContinuationToken"] = continuationToken 12660 } 12661 if timeout != nil { 12662 queryParameters["timeout"] = autorest.Encode("query", *timeout) 12663 } else { 12664 queryParameters["timeout"] = autorest.Encode("query", 60) 12665 } 12666 12667 preparer := autorest.CreatePreparer( 12668 autorest.AsGet(), 12669 autorest.WithBaseURL(client.BaseURI), 12670 autorest.WithPathParameters("/Partitions/{partitionId}/$/GetReplicas", pathParameters), 12671 autorest.WithQueryParameters(queryParameters)) 12672 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 12673} 12674 12675// GetReplicaInfoListSender sends the GetReplicaInfoList request. The method will close the 12676// http.Response Body if it receives an error. 12677func (client BaseClient) GetReplicaInfoListSender(req *http.Request) (*http.Response, error) { 12678 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 12679 return autorest.SendWithSender(client, req, sd...) 12680} 12681 12682// GetReplicaInfoListResponder handles the response to the GetReplicaInfoList request. The method always 12683// closes the http.Response Body. 12684func (client BaseClient) GetReplicaInfoListResponder(resp *http.Response) (result PagedReplicaInfoList, err error) { 12685 err = autorest.Respond( 12686 resp, 12687 client.ByInspecting(), 12688 azure.WithErrorUnlessStatusCode(http.StatusOK), 12689 autorest.ByUnmarshallingJSON(&result), 12690 autorest.ByClosing()) 12691 result.Response = autorest.Response{Response: resp} 12692 return 12693} 12694 12695// GetServiceBackupConfigurationInfo gets the Service Fabric backup configuration information for the service and the 12696// partitions under this service. 12697// Parameters: 12698// serviceID - the identity of the service. This is typically the full name of the service without the 12699// 'fabric:' URI scheme. 12700// Starting from version 6.0, hierarchical names are delimited with the "~" character. 12701// For example, if the service name is "fabric:/myapp/app1/svc1", the service identity would be 12702// "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in previous versions. 12703// continuationToken - the continuation token parameter is used to obtain next set of results. A continuation 12704// token with a non empty value is included in the response of the API when the results from the system do not 12705// fit in a single response. When this value is passed to the next API call, the API returns next set of 12706// results. If there are no further results then the continuation token does not contain a value. The value of 12707// this parameter should not be URL encoded. 12708// maxResults - the maximum number of results to be returned as part of the paged queries. This parameter 12709// defines the upper bound on the number of results returned. The results returned can be less than the 12710// specified maximum results if they do not fit in the message as per the max message size restrictions defined 12711// in the configuration. If this parameter is zero or not specified, the paged queries includes as many results 12712// as possible that fit in the return message. 12713// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 12714// duration that the client is willing to wait for the requested operation to complete. The default value for 12715// this parameter is 60 seconds. 12716func (client BaseClient) GetServiceBackupConfigurationInfo(ctx context.Context, serviceID string, continuationToken string, maxResults *int64, timeout *int64) (result PagedBackupConfigurationInfoList, err error) { 12717 if tracing.IsEnabled() { 12718 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetServiceBackupConfigurationInfo") 12719 defer func() { 12720 sc := -1 12721 if result.Response.Response != nil { 12722 sc = result.Response.Response.StatusCode 12723 } 12724 tracing.EndSpan(ctx, sc, err) 12725 }() 12726 } 12727 if err := validation.Validate([]validation.Validation{ 12728 {TargetValue: maxResults, 12729 Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false, 12730 Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}, 12731 {TargetValue: timeout, 12732 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 12733 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 12734 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 12735 }}}}}); err != nil { 12736 return result, validation.NewError("servicefabric.BaseClient", "GetServiceBackupConfigurationInfo", err.Error()) 12737 } 12738 12739 req, err := client.GetServiceBackupConfigurationInfoPreparer(ctx, serviceID, continuationToken, maxResults, timeout) 12740 if err != nil { 12741 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceBackupConfigurationInfo", nil, "Failure preparing request") 12742 return 12743 } 12744 12745 resp, err := client.GetServiceBackupConfigurationInfoSender(req) 12746 if err != nil { 12747 result.Response = autorest.Response{Response: resp} 12748 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceBackupConfigurationInfo", resp, "Failure sending request") 12749 return 12750 } 12751 12752 result, err = client.GetServiceBackupConfigurationInfoResponder(resp) 12753 if err != nil { 12754 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceBackupConfigurationInfo", resp, "Failure responding to request") 12755 } 12756 12757 return 12758} 12759 12760// GetServiceBackupConfigurationInfoPreparer prepares the GetServiceBackupConfigurationInfo request. 12761func (client BaseClient) GetServiceBackupConfigurationInfoPreparer(ctx context.Context, serviceID string, continuationToken string, maxResults *int64, timeout *int64) (*http.Request, error) { 12762 pathParameters := map[string]interface{}{ 12763 "serviceId": serviceID, 12764 } 12765 12766 const APIVersion = "6.2-preview" 12767 queryParameters := map[string]interface{}{ 12768 "api-version": APIVersion, 12769 } 12770 if len(continuationToken) > 0 { 12771 queryParameters["ContinuationToken"] = continuationToken 12772 } 12773 if maxResults != nil { 12774 queryParameters["MaxResults"] = autorest.Encode("query", *maxResults) 12775 } else { 12776 queryParameters["MaxResults"] = autorest.Encode("query", 0) 12777 } 12778 if timeout != nil { 12779 queryParameters["timeout"] = autorest.Encode("query", *timeout) 12780 } else { 12781 queryParameters["timeout"] = autorest.Encode("query", 60) 12782 } 12783 12784 preparer := autorest.CreatePreparer( 12785 autorest.AsGet(), 12786 autorest.WithBaseURL(client.BaseURI), 12787 autorest.WithPathParameters("/Services/{serviceId}/$/GetBackupConfigurationInfo", pathParameters), 12788 autorest.WithQueryParameters(queryParameters)) 12789 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 12790} 12791 12792// GetServiceBackupConfigurationInfoSender sends the GetServiceBackupConfigurationInfo request. The method will close the 12793// http.Response Body if it receives an error. 12794func (client BaseClient) GetServiceBackupConfigurationInfoSender(req *http.Request) (*http.Response, error) { 12795 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 12796 return autorest.SendWithSender(client, req, sd...) 12797} 12798 12799// GetServiceBackupConfigurationInfoResponder handles the response to the GetServiceBackupConfigurationInfo request. The method always 12800// closes the http.Response Body. 12801func (client BaseClient) GetServiceBackupConfigurationInfoResponder(resp *http.Response) (result PagedBackupConfigurationInfoList, err error) { 12802 err = autorest.Respond( 12803 resp, 12804 client.ByInspecting(), 12805 azure.WithErrorUnlessStatusCode(http.StatusOK), 12806 autorest.ByUnmarshallingJSON(&result), 12807 autorest.ByClosing()) 12808 result.Response = autorest.Response{Response: resp} 12809 return 12810} 12811 12812// GetServiceBackupList returns a list of backups available for every partition in this Service Fabric service. The 12813// server enumerates all the backups available in the backup store configured in the backup policy. It also allows 12814// filtering of the result based on start and end datetime or just fetching the latest available backup for every 12815// partition. 12816// Parameters: 12817// serviceID - the identity of the service. This is typically the full name of the service without the 12818// 'fabric:' URI scheme. 12819// Starting from version 6.0, hierarchical names are delimited with the "~" character. 12820// For example, if the service name is "fabric:/myapp/app1/svc1", the service identity would be 12821// "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in previous versions. 12822// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 12823// duration that the client is willing to wait for the requested operation to complete. The default value for 12824// this parameter is 60 seconds. 12825// latest - specifies whether to get only the most recent backup available for a partition for the specified 12826// time range. 12827// startDateTimeFilter - specify the start date time from which to enumerate backups, in datetime format. The 12828// date time must be specified in ISO8601 format. This is an optional parameter. If not specified, all backups 12829// from the beginning are enumerated. 12830// endDateTimeFilter - specify the end date time till which to enumerate backups, in datetime format. The date 12831// time must be specified in ISO8601 format. This is an optional parameter. If not specified, enumeration is 12832// done till the most recent backup. 12833// continuationToken - the continuation token parameter is used to obtain next set of results. A continuation 12834// token with a non empty value is included in the response of the API when the results from the system do not 12835// fit in a single response. When this value is passed to the next API call, the API returns next set of 12836// results. If there are no further results then the continuation token does not contain a value. The value of 12837// this parameter should not be URL encoded. 12838// maxResults - the maximum number of results to be returned as part of the paged queries. This parameter 12839// defines the upper bound on the number of results returned. The results returned can be less than the 12840// specified maximum results if they do not fit in the message as per the max message size restrictions defined 12841// in the configuration. If this parameter is zero or not specified, the paged queries includes as many results 12842// as possible that fit in the return message. 12843func (client BaseClient) GetServiceBackupList(ctx context.Context, serviceID string, timeout *int64, latest *bool, startDateTimeFilter *date.Time, endDateTimeFilter *date.Time, continuationToken string, maxResults *int64) (result PagedBackupInfoList, err error) { 12844 if tracing.IsEnabled() { 12845 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetServiceBackupList") 12846 defer func() { 12847 sc := -1 12848 if result.Response.Response != nil { 12849 sc = result.Response.Response.StatusCode 12850 } 12851 tracing.EndSpan(ctx, sc, err) 12852 }() 12853 } 12854 if err := validation.Validate([]validation.Validation{ 12855 {TargetValue: timeout, 12856 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 12857 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 12858 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 12859 }}}}, 12860 {TargetValue: maxResults, 12861 Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false, 12862 Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}}); err != nil { 12863 return result, validation.NewError("servicefabric.BaseClient", "GetServiceBackupList", err.Error()) 12864 } 12865 12866 req, err := client.GetServiceBackupListPreparer(ctx, serviceID, timeout, latest, startDateTimeFilter, endDateTimeFilter, continuationToken, maxResults) 12867 if err != nil { 12868 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceBackupList", nil, "Failure preparing request") 12869 return 12870 } 12871 12872 resp, err := client.GetServiceBackupListSender(req) 12873 if err != nil { 12874 result.Response = autorest.Response{Response: resp} 12875 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceBackupList", resp, "Failure sending request") 12876 return 12877 } 12878 12879 result, err = client.GetServiceBackupListResponder(resp) 12880 if err != nil { 12881 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceBackupList", resp, "Failure responding to request") 12882 } 12883 12884 return 12885} 12886 12887// GetServiceBackupListPreparer prepares the GetServiceBackupList request. 12888func (client BaseClient) GetServiceBackupListPreparer(ctx context.Context, serviceID string, timeout *int64, latest *bool, startDateTimeFilter *date.Time, endDateTimeFilter *date.Time, continuationToken string, maxResults *int64) (*http.Request, error) { 12889 pathParameters := map[string]interface{}{ 12890 "serviceId": serviceID, 12891 } 12892 12893 const APIVersion = "6.2-preview" 12894 queryParameters := map[string]interface{}{ 12895 "api-version": APIVersion, 12896 } 12897 if timeout != nil { 12898 queryParameters["timeout"] = autorest.Encode("query", *timeout) 12899 } else { 12900 queryParameters["timeout"] = autorest.Encode("query", 60) 12901 } 12902 if latest != nil { 12903 queryParameters["Latest"] = autorest.Encode("query", *latest) 12904 } else { 12905 queryParameters["Latest"] = autorest.Encode("query", false) 12906 } 12907 if startDateTimeFilter != nil { 12908 queryParameters["StartDateTimeFilter"] = autorest.Encode("query", *startDateTimeFilter) 12909 } 12910 if endDateTimeFilter != nil { 12911 queryParameters["EndDateTimeFilter"] = autorest.Encode("query", *endDateTimeFilter) 12912 } 12913 if len(continuationToken) > 0 { 12914 queryParameters["ContinuationToken"] = continuationToken 12915 } 12916 if maxResults != nil { 12917 queryParameters["MaxResults"] = autorest.Encode("query", *maxResults) 12918 } else { 12919 queryParameters["MaxResults"] = autorest.Encode("query", 0) 12920 } 12921 12922 preparer := autorest.CreatePreparer( 12923 autorest.AsGet(), 12924 autorest.WithBaseURL(client.BaseURI), 12925 autorest.WithPathParameters("/Services/{serviceId}/$/GetBackups", pathParameters), 12926 autorest.WithQueryParameters(queryParameters)) 12927 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 12928} 12929 12930// GetServiceBackupListSender sends the GetServiceBackupList request. The method will close the 12931// http.Response Body if it receives an error. 12932func (client BaseClient) GetServiceBackupListSender(req *http.Request) (*http.Response, error) { 12933 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 12934 return autorest.SendWithSender(client, req, sd...) 12935} 12936 12937// GetServiceBackupListResponder handles the response to the GetServiceBackupList request. The method always 12938// closes the http.Response Body. 12939func (client BaseClient) GetServiceBackupListResponder(resp *http.Response) (result PagedBackupInfoList, err error) { 12940 err = autorest.Respond( 12941 resp, 12942 client.ByInspecting(), 12943 azure.WithErrorUnlessStatusCode(http.StatusOK), 12944 autorest.ByUnmarshallingJSON(&result), 12945 autorest.ByClosing()) 12946 result.Response = autorest.Response{Response: resp} 12947 return 12948} 12949 12950// GetServiceDescription gets the description of an existing Service Fabric service. A service must be created before 12951// its description can be obtained. 12952// Parameters: 12953// serviceID - the identity of the service. This is typically the full name of the service without the 12954// 'fabric:' URI scheme. 12955// Starting from version 6.0, hierarchical names are delimited with the "~" character. 12956// For example, if the service name is "fabric:/myapp/app1/svc1", the service identity would be 12957// "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in previous versions. 12958// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 12959// duration that the client is willing to wait for the requested operation to complete. The default value for 12960// this parameter is 60 seconds. 12961func (client BaseClient) GetServiceDescription(ctx context.Context, serviceID string, timeout *int64) (result ServiceDescriptionModel, err error) { 12962 if tracing.IsEnabled() { 12963 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetServiceDescription") 12964 defer func() { 12965 sc := -1 12966 if result.Response.Response != nil { 12967 sc = result.Response.Response.StatusCode 12968 } 12969 tracing.EndSpan(ctx, sc, err) 12970 }() 12971 } 12972 if err := validation.Validate([]validation.Validation{ 12973 {TargetValue: timeout, 12974 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 12975 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 12976 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 12977 }}}}}); err != nil { 12978 return result, validation.NewError("servicefabric.BaseClient", "GetServiceDescription", err.Error()) 12979 } 12980 12981 req, err := client.GetServiceDescriptionPreparer(ctx, serviceID, timeout) 12982 if err != nil { 12983 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceDescription", nil, "Failure preparing request") 12984 return 12985 } 12986 12987 resp, err := client.GetServiceDescriptionSender(req) 12988 if err != nil { 12989 result.Response = autorest.Response{Response: resp} 12990 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceDescription", resp, "Failure sending request") 12991 return 12992 } 12993 12994 result, err = client.GetServiceDescriptionResponder(resp) 12995 if err != nil { 12996 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceDescription", resp, "Failure responding to request") 12997 } 12998 12999 return 13000} 13001 13002// GetServiceDescriptionPreparer prepares the GetServiceDescription request. 13003func (client BaseClient) GetServiceDescriptionPreparer(ctx context.Context, serviceID string, timeout *int64) (*http.Request, error) { 13004 pathParameters := map[string]interface{}{ 13005 "serviceId": serviceID, 13006 } 13007 13008 const APIVersion = "6.0" 13009 queryParameters := map[string]interface{}{ 13010 "api-version": APIVersion, 13011 } 13012 if timeout != nil { 13013 queryParameters["timeout"] = autorest.Encode("query", *timeout) 13014 } else { 13015 queryParameters["timeout"] = autorest.Encode("query", 60) 13016 } 13017 13018 preparer := autorest.CreatePreparer( 13019 autorest.AsGet(), 13020 autorest.WithBaseURL(client.BaseURI), 13021 autorest.WithPathParameters("/Services/{serviceId}/$/GetDescription", pathParameters), 13022 autorest.WithQueryParameters(queryParameters)) 13023 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 13024} 13025 13026// GetServiceDescriptionSender sends the GetServiceDescription request. The method will close the 13027// http.Response Body if it receives an error. 13028func (client BaseClient) GetServiceDescriptionSender(req *http.Request) (*http.Response, error) { 13029 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 13030 return autorest.SendWithSender(client, req, sd...) 13031} 13032 13033// GetServiceDescriptionResponder handles the response to the GetServiceDescription request. The method always 13034// closes the http.Response Body. 13035func (client BaseClient) GetServiceDescriptionResponder(resp *http.Response) (result ServiceDescriptionModel, err error) { 13036 err = autorest.Respond( 13037 resp, 13038 client.ByInspecting(), 13039 azure.WithErrorUnlessStatusCode(http.StatusOK), 13040 autorest.ByUnmarshallingJSON(&result), 13041 autorest.ByClosing()) 13042 result.Response = autorest.Response{Response: resp} 13043 return 13044} 13045 13046// GetServiceEventList the response is list of ServiceEvent objects. 13047// Parameters: 13048// serviceID - the identity of the service. This is typically the full name of the service without the 13049// 'fabric:' URI scheme. 13050// Starting from version 6.0, hierarchical names are delimited with the "~" character. 13051// For example, if the service name is "fabric:/myapp/app1/svc1", the service identity would be 13052// "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in previous versions. 13053// startTimeUtc - the start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. 13054// endTimeUtc - the end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. 13055// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 13056// duration that the client is willing to wait for the requested operation to complete. The default value for 13057// this parameter is 60 seconds. 13058// eventsTypesFilter - this is a comma separated string specifying the types of FabricEvents that should only 13059// be included in the response. 13060// excludeAnalysisEvents - this param disables the retrieval of AnalysisEvents if true is passed. 13061// skipCorrelationLookup - this param disables the search of CorrelatedEvents information if true is passed. 13062// otherwise the CorrelationEvents get processed and HasCorrelatedEvents field in every FabricEvent gets 13063// populated. 13064func (client BaseClient) GetServiceEventList(ctx context.Context, serviceID string, startTimeUtc string, endTimeUtc string, timeout *int64, eventsTypesFilter string, excludeAnalysisEvents *bool, skipCorrelationLookup *bool) (result ListServiceEvent, err error) { 13065 if tracing.IsEnabled() { 13066 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetServiceEventList") 13067 defer func() { 13068 sc := -1 13069 if result.Response.Response != nil { 13070 sc = result.Response.Response.StatusCode 13071 } 13072 tracing.EndSpan(ctx, sc, err) 13073 }() 13074 } 13075 if err := validation.Validate([]validation.Validation{ 13076 {TargetValue: timeout, 13077 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 13078 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 13079 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 13080 }}}}}); err != nil { 13081 return result, validation.NewError("servicefabric.BaseClient", "GetServiceEventList", err.Error()) 13082 } 13083 13084 req, err := client.GetServiceEventListPreparer(ctx, serviceID, startTimeUtc, endTimeUtc, timeout, eventsTypesFilter, excludeAnalysisEvents, skipCorrelationLookup) 13085 if err != nil { 13086 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceEventList", nil, "Failure preparing request") 13087 return 13088 } 13089 13090 resp, err := client.GetServiceEventListSender(req) 13091 if err != nil { 13092 result.Response = autorest.Response{Response: resp} 13093 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceEventList", resp, "Failure sending request") 13094 return 13095 } 13096 13097 result, err = client.GetServiceEventListResponder(resp) 13098 if err != nil { 13099 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceEventList", resp, "Failure responding to request") 13100 } 13101 13102 return 13103} 13104 13105// GetServiceEventListPreparer prepares the GetServiceEventList request. 13106func (client BaseClient) GetServiceEventListPreparer(ctx context.Context, serviceID string, startTimeUtc string, endTimeUtc string, timeout *int64, eventsTypesFilter string, excludeAnalysisEvents *bool, skipCorrelationLookup *bool) (*http.Request, error) { 13107 pathParameters := map[string]interface{}{ 13108 "serviceId": serviceID, 13109 } 13110 13111 const APIVersion = "6.2-preview" 13112 queryParameters := map[string]interface{}{ 13113 "api-version": APIVersion, 13114 "EndTimeUtc": autorest.Encode("query", endTimeUtc), 13115 "StartTimeUtc": autorest.Encode("query", startTimeUtc), 13116 } 13117 if timeout != nil { 13118 queryParameters["timeout"] = autorest.Encode("query", *timeout) 13119 } else { 13120 queryParameters["timeout"] = autorest.Encode("query", 60) 13121 } 13122 if len(eventsTypesFilter) > 0 { 13123 queryParameters["EventsTypesFilter"] = autorest.Encode("query", eventsTypesFilter) 13124 } 13125 if excludeAnalysisEvents != nil { 13126 queryParameters["ExcludeAnalysisEvents"] = autorest.Encode("query", *excludeAnalysisEvents) 13127 } 13128 if skipCorrelationLookup != nil { 13129 queryParameters["SkipCorrelationLookup"] = autorest.Encode("query", *skipCorrelationLookup) 13130 } 13131 13132 preparer := autorest.CreatePreparer( 13133 autorest.AsGet(), 13134 autorest.WithBaseURL(client.BaseURI), 13135 autorest.WithPathParameters("/EventsStore/Services/{serviceId}/$/Events", pathParameters), 13136 autorest.WithQueryParameters(queryParameters)) 13137 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 13138} 13139 13140// GetServiceEventListSender sends the GetServiceEventList request. The method will close the 13141// http.Response Body if it receives an error. 13142func (client BaseClient) GetServiceEventListSender(req *http.Request) (*http.Response, error) { 13143 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 13144 return autorest.SendWithSender(client, req, sd...) 13145} 13146 13147// GetServiceEventListResponder handles the response to the GetServiceEventList request. The method always 13148// closes the http.Response Body. 13149func (client BaseClient) GetServiceEventListResponder(resp *http.Response) (result ListServiceEvent, err error) { 13150 err = autorest.Respond( 13151 resp, 13152 client.ByInspecting(), 13153 azure.WithErrorUnlessStatusCode(http.StatusOK), 13154 autorest.ByUnmarshallingJSON(&result), 13155 autorest.ByClosing()) 13156 result.Response = autorest.Response{Response: resp} 13157 return 13158} 13159 13160// GetServiceHealth gets the health information of the specified service. 13161// Use EventsHealthStateFilter to filter the collection of health events reported on the service based on the health 13162// state. 13163// Use PartitionsHealthStateFilter to filter the collection of partitions returned. 13164// If you specify a service that does not exist in the health store, this request returns an error. 13165// Parameters: 13166// serviceID - the identity of the service. This is typically the full name of the service without the 13167// 'fabric:' URI scheme. 13168// Starting from version 6.0, hierarchical names are delimited with the "~" character. 13169// For example, if the service name is "fabric:/myapp/app1/svc1", the service identity would be 13170// "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in previous versions. 13171// eventsHealthStateFilter - allows filtering the collection of HealthEvent objects returned based on health 13172// state. 13173// The possible values for this parameter include integer value of one of the following health states. 13174// Only events that match the filter are returned. All events are used to evaluate the aggregated health state. 13175// If not specified, all entries are returned. The state values are flag based enumeration, so the value could 13176// be a combination of these value obtained using bitwise 'OR' operator. For example, If the provided value is 13177// 6 then all of the events with HealthState value of OK (2) and Warning (4) are returned. 13178// 13179// - Default - Default value. Matches any HealthState. The value is zero. 13180// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given 13181// collection of states. The value is 1. 13182// - Ok - Filter that matches input with HealthState value Ok. The value is 2. 13183// - Warning - Filter that matches input with HealthState value Warning. The value is 4. 13184// - Error - Filter that matches input with HealthState value Error. The value is 8. 13185// - All - Filter that matches input with any HealthState value. The value is 65535. 13186// partitionsHealthStateFilter - allows filtering of the partitions health state objects returned in the result 13187// of service health query based on their health state. 13188// The possible values for this parameter include integer value of one of the following health states. 13189// Only partitions that match the filter are returned. All partitions are used to evaluate the aggregated 13190// health state. 13191// If not specified, all entries are returned. The state values are flag based enumeration, so the value could 13192// be a combination of these value 13193// obtained using bitwise 'OR' operator. For example, if the provided value is 6 then health state of 13194// partitions with HealthState value of OK (2) and Warning (4) will be returned. 13195// 13196// - Default - Default value. Matches any HealthState. The value is zero. 13197// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given 13198// collection of states. The value is 1. 13199// - Ok - Filter that matches input with HealthState value Ok. The value is 2. 13200// - Warning - Filter that matches input with HealthState value Warning. The value is 4. 13201// - Error - Filter that matches input with HealthState value Error. The value is 8. 13202// - All - Filter that matches input with any HealthState value. The value is 65535. 13203// excludeHealthStatistics - indicates whether the health statistics should be returned as part of the query 13204// result. False by default. 13205// The statistics show the number of children entities in health state Ok, Warning, and Error. 13206// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 13207// duration that the client is willing to wait for the requested operation to complete. The default value for 13208// this parameter is 60 seconds. 13209func (client BaseClient) GetServiceHealth(ctx context.Context, serviceID string, eventsHealthStateFilter *int32, partitionsHealthStateFilter *int32, excludeHealthStatistics *bool, timeout *int64) (result ServiceHealth, err error) { 13210 if tracing.IsEnabled() { 13211 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetServiceHealth") 13212 defer func() { 13213 sc := -1 13214 if result.Response.Response != nil { 13215 sc = result.Response.Response.StatusCode 13216 } 13217 tracing.EndSpan(ctx, sc, err) 13218 }() 13219 } 13220 if err := validation.Validate([]validation.Validation{ 13221 {TargetValue: timeout, 13222 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 13223 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 13224 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 13225 }}}}}); err != nil { 13226 return result, validation.NewError("servicefabric.BaseClient", "GetServiceHealth", err.Error()) 13227 } 13228 13229 req, err := client.GetServiceHealthPreparer(ctx, serviceID, eventsHealthStateFilter, partitionsHealthStateFilter, excludeHealthStatistics, timeout) 13230 if err != nil { 13231 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceHealth", nil, "Failure preparing request") 13232 return 13233 } 13234 13235 resp, err := client.GetServiceHealthSender(req) 13236 if err != nil { 13237 result.Response = autorest.Response{Response: resp} 13238 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceHealth", resp, "Failure sending request") 13239 return 13240 } 13241 13242 result, err = client.GetServiceHealthResponder(resp) 13243 if err != nil { 13244 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceHealth", resp, "Failure responding to request") 13245 } 13246 13247 return 13248} 13249 13250// GetServiceHealthPreparer prepares the GetServiceHealth request. 13251func (client BaseClient) GetServiceHealthPreparer(ctx context.Context, serviceID string, eventsHealthStateFilter *int32, partitionsHealthStateFilter *int32, excludeHealthStatistics *bool, timeout *int64) (*http.Request, error) { 13252 pathParameters := map[string]interface{}{ 13253 "serviceId": serviceID, 13254 } 13255 13256 const APIVersion = "6.0" 13257 queryParameters := map[string]interface{}{ 13258 "api-version": APIVersion, 13259 } 13260 if eventsHealthStateFilter != nil { 13261 queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", *eventsHealthStateFilter) 13262 } else { 13263 queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", 0) 13264 } 13265 if partitionsHealthStateFilter != nil { 13266 queryParameters["PartitionsHealthStateFilter"] = autorest.Encode("query", *partitionsHealthStateFilter) 13267 } else { 13268 queryParameters["PartitionsHealthStateFilter"] = autorest.Encode("query", 0) 13269 } 13270 if excludeHealthStatistics != nil { 13271 queryParameters["ExcludeHealthStatistics"] = autorest.Encode("query", *excludeHealthStatistics) 13272 } else { 13273 queryParameters["ExcludeHealthStatistics"] = autorest.Encode("query", false) 13274 } 13275 if timeout != nil { 13276 queryParameters["timeout"] = autorest.Encode("query", *timeout) 13277 } else { 13278 queryParameters["timeout"] = autorest.Encode("query", 60) 13279 } 13280 13281 preparer := autorest.CreatePreparer( 13282 autorest.AsGet(), 13283 autorest.WithBaseURL(client.BaseURI), 13284 autorest.WithPathParameters("/Services/{serviceId}/$/GetHealth", pathParameters), 13285 autorest.WithQueryParameters(queryParameters)) 13286 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 13287} 13288 13289// GetServiceHealthSender sends the GetServiceHealth request. The method will close the 13290// http.Response Body if it receives an error. 13291func (client BaseClient) GetServiceHealthSender(req *http.Request) (*http.Response, error) { 13292 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 13293 return autorest.SendWithSender(client, req, sd...) 13294} 13295 13296// GetServiceHealthResponder handles the response to the GetServiceHealth request. The method always 13297// closes the http.Response Body. 13298func (client BaseClient) GetServiceHealthResponder(resp *http.Response) (result ServiceHealth, err error) { 13299 err = autorest.Respond( 13300 resp, 13301 client.ByInspecting(), 13302 azure.WithErrorUnlessStatusCode(http.StatusOK), 13303 autorest.ByUnmarshallingJSON(&result), 13304 autorest.ByClosing()) 13305 result.Response = autorest.Response{Response: resp} 13306 return 13307} 13308 13309// GetServiceHealthUsingPolicy gets the health information of the specified service. 13310// If the application health policy is specified, the health evaluation uses it to get the aggregated health state. 13311// If the policy is not specified, the health evaluation uses the application health policy defined in the application 13312// manifest, or the default health policy, if no policy is defined in the manifest. 13313// Use EventsHealthStateFilter to filter the collection of health events reported on the service based on the health 13314// state. 13315// Use PartitionsHealthStateFilter to filter the collection of partitions returned. 13316// If you specify a service that does not exist in the health store, this request returns an error. 13317// Parameters: 13318// serviceID - the identity of the service. This is typically the full name of the service without the 13319// 'fabric:' URI scheme. 13320// Starting from version 6.0, hierarchical names are delimited with the "~" character. 13321// For example, if the service name is "fabric:/myapp/app1/svc1", the service identity would be 13322// "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in previous versions. 13323// eventsHealthStateFilter - allows filtering the collection of HealthEvent objects returned based on health 13324// state. 13325// The possible values for this parameter include integer value of one of the following health states. 13326// Only events that match the filter are returned. All events are used to evaluate the aggregated health state. 13327// If not specified, all entries are returned. The state values are flag based enumeration, so the value could 13328// be a combination of these value obtained using bitwise 'OR' operator. For example, If the provided value is 13329// 6 then all of the events with HealthState value of OK (2) and Warning (4) are returned. 13330// 13331// - Default - Default value. Matches any HealthState. The value is zero. 13332// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given 13333// collection of states. The value is 1. 13334// - Ok - Filter that matches input with HealthState value Ok. The value is 2. 13335// - Warning - Filter that matches input with HealthState value Warning. The value is 4. 13336// - Error - Filter that matches input with HealthState value Error. The value is 8. 13337// - All - Filter that matches input with any HealthState value. The value is 65535. 13338// partitionsHealthStateFilter - allows filtering of the partitions health state objects returned in the result 13339// of service health query based on their health state. 13340// The possible values for this parameter include integer value of one of the following health states. 13341// Only partitions that match the filter are returned. All partitions are used to evaluate the aggregated 13342// health state. 13343// If not specified, all entries are returned. The state values are flag based enumeration, so the value could 13344// be a combination of these value 13345// obtained using bitwise 'OR' operator. For example, if the provided value is 6 then health state of 13346// partitions with HealthState value of OK (2) and Warning (4) will be returned. 13347// 13348// - Default - Default value. Matches any HealthState. The value is zero. 13349// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given 13350// collection of states. The value is 1. 13351// - Ok - Filter that matches input with HealthState value Ok. The value is 2. 13352// - Warning - Filter that matches input with HealthState value Warning. The value is 4. 13353// - Error - Filter that matches input with HealthState value Error. The value is 8. 13354// - All - Filter that matches input with any HealthState value. The value is 65535. 13355// applicationHealthPolicy - describes the health policies used to evaluate the health of an application or one 13356// of its children. 13357// If not present, the health evaluation uses the health policy from application manifest or the default health 13358// policy. 13359// excludeHealthStatistics - indicates whether the health statistics should be returned as part of the query 13360// result. False by default. 13361// The statistics show the number of children entities in health state Ok, Warning, and Error. 13362// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 13363// duration that the client is willing to wait for the requested operation to complete. The default value for 13364// this parameter is 60 seconds. 13365func (client BaseClient) GetServiceHealthUsingPolicy(ctx context.Context, serviceID string, eventsHealthStateFilter *int32, partitionsHealthStateFilter *int32, applicationHealthPolicy *ApplicationHealthPolicy, excludeHealthStatistics *bool, timeout *int64) (result ServiceHealth, err error) { 13366 if tracing.IsEnabled() { 13367 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetServiceHealthUsingPolicy") 13368 defer func() { 13369 sc := -1 13370 if result.Response.Response != nil { 13371 sc = result.Response.Response.StatusCode 13372 } 13373 tracing.EndSpan(ctx, sc, err) 13374 }() 13375 } 13376 if err := validation.Validate([]validation.Validation{ 13377 {TargetValue: timeout, 13378 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 13379 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 13380 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 13381 }}}}}); err != nil { 13382 return result, validation.NewError("servicefabric.BaseClient", "GetServiceHealthUsingPolicy", err.Error()) 13383 } 13384 13385 req, err := client.GetServiceHealthUsingPolicyPreparer(ctx, serviceID, eventsHealthStateFilter, partitionsHealthStateFilter, applicationHealthPolicy, excludeHealthStatistics, timeout) 13386 if err != nil { 13387 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceHealthUsingPolicy", nil, "Failure preparing request") 13388 return 13389 } 13390 13391 resp, err := client.GetServiceHealthUsingPolicySender(req) 13392 if err != nil { 13393 result.Response = autorest.Response{Response: resp} 13394 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceHealthUsingPolicy", resp, "Failure sending request") 13395 return 13396 } 13397 13398 result, err = client.GetServiceHealthUsingPolicyResponder(resp) 13399 if err != nil { 13400 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceHealthUsingPolicy", resp, "Failure responding to request") 13401 } 13402 13403 return 13404} 13405 13406// GetServiceHealthUsingPolicyPreparer prepares the GetServiceHealthUsingPolicy request. 13407func (client BaseClient) GetServiceHealthUsingPolicyPreparer(ctx context.Context, serviceID string, eventsHealthStateFilter *int32, partitionsHealthStateFilter *int32, applicationHealthPolicy *ApplicationHealthPolicy, excludeHealthStatistics *bool, timeout *int64) (*http.Request, error) { 13408 pathParameters := map[string]interface{}{ 13409 "serviceId": serviceID, 13410 } 13411 13412 const APIVersion = "6.0" 13413 queryParameters := map[string]interface{}{ 13414 "api-version": APIVersion, 13415 } 13416 if eventsHealthStateFilter != nil { 13417 queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", *eventsHealthStateFilter) 13418 } else { 13419 queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", 0) 13420 } 13421 if partitionsHealthStateFilter != nil { 13422 queryParameters["PartitionsHealthStateFilter"] = autorest.Encode("query", *partitionsHealthStateFilter) 13423 } else { 13424 queryParameters["PartitionsHealthStateFilter"] = autorest.Encode("query", 0) 13425 } 13426 if excludeHealthStatistics != nil { 13427 queryParameters["ExcludeHealthStatistics"] = autorest.Encode("query", *excludeHealthStatistics) 13428 } else { 13429 queryParameters["ExcludeHealthStatistics"] = autorest.Encode("query", false) 13430 } 13431 if timeout != nil { 13432 queryParameters["timeout"] = autorest.Encode("query", *timeout) 13433 } else { 13434 queryParameters["timeout"] = autorest.Encode("query", 60) 13435 } 13436 13437 preparer := autorest.CreatePreparer( 13438 autorest.AsContentType("application/json; charset=utf-8"), 13439 autorest.AsPost(), 13440 autorest.WithBaseURL(client.BaseURI), 13441 autorest.WithPathParameters("/Services/{serviceId}/$/GetHealth", pathParameters), 13442 autorest.WithQueryParameters(queryParameters)) 13443 if applicationHealthPolicy != nil { 13444 preparer = autorest.DecoratePreparer(preparer, 13445 autorest.WithJSON(applicationHealthPolicy)) 13446 } 13447 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 13448} 13449 13450// GetServiceHealthUsingPolicySender sends the GetServiceHealthUsingPolicy request. The method will close the 13451// http.Response Body if it receives an error. 13452func (client BaseClient) GetServiceHealthUsingPolicySender(req *http.Request) (*http.Response, error) { 13453 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 13454 return autorest.SendWithSender(client, req, sd...) 13455} 13456 13457// GetServiceHealthUsingPolicyResponder handles the response to the GetServiceHealthUsingPolicy request. The method always 13458// closes the http.Response Body. 13459func (client BaseClient) GetServiceHealthUsingPolicyResponder(resp *http.Response) (result ServiceHealth, err error) { 13460 err = autorest.Respond( 13461 resp, 13462 client.ByInspecting(), 13463 azure.WithErrorUnlessStatusCode(http.StatusOK), 13464 autorest.ByUnmarshallingJSON(&result), 13465 autorest.ByClosing()) 13466 result.Response = autorest.Response{Response: resp} 13467 return 13468} 13469 13470// GetServiceInfo returns the information about the specified service belonging to the specified Service Fabric 13471// application. 13472// Parameters: 13473// applicationID - the identity of the application. This is typically the full name of the application without 13474// the 'fabric:' URI scheme. 13475// Starting from version 6.0, hierarchical names are delimited with the "~" character. 13476// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" 13477// in 6.0+ and "myapp/app1" in previous versions. 13478// serviceID - the identity of the service. This is typically the full name of the service without the 13479// 'fabric:' URI scheme. 13480// Starting from version 6.0, hierarchical names are delimited with the "~" character. 13481// For example, if the service name is "fabric:/myapp/app1/svc1", the service identity would be 13482// "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in previous versions. 13483// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 13484// duration that the client is willing to wait for the requested operation to complete. The default value for 13485// this parameter is 60 seconds. 13486func (client BaseClient) GetServiceInfo(ctx context.Context, applicationID string, serviceID string, timeout *int64) (result ServiceInfoModel, err error) { 13487 if tracing.IsEnabled() { 13488 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetServiceInfo") 13489 defer func() { 13490 sc := -1 13491 if result.Response.Response != nil { 13492 sc = result.Response.Response.StatusCode 13493 } 13494 tracing.EndSpan(ctx, sc, err) 13495 }() 13496 } 13497 if err := validation.Validate([]validation.Validation{ 13498 {TargetValue: timeout, 13499 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 13500 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 13501 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 13502 }}}}}); err != nil { 13503 return result, validation.NewError("servicefabric.BaseClient", "GetServiceInfo", err.Error()) 13504 } 13505 13506 req, err := client.GetServiceInfoPreparer(ctx, applicationID, serviceID, timeout) 13507 if err != nil { 13508 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceInfo", nil, "Failure preparing request") 13509 return 13510 } 13511 13512 resp, err := client.GetServiceInfoSender(req) 13513 if err != nil { 13514 result.Response = autorest.Response{Response: resp} 13515 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceInfo", resp, "Failure sending request") 13516 return 13517 } 13518 13519 result, err = client.GetServiceInfoResponder(resp) 13520 if err != nil { 13521 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceInfo", resp, "Failure responding to request") 13522 } 13523 13524 return 13525} 13526 13527// GetServiceInfoPreparer prepares the GetServiceInfo request. 13528func (client BaseClient) GetServiceInfoPreparer(ctx context.Context, applicationID string, serviceID string, timeout *int64) (*http.Request, error) { 13529 pathParameters := map[string]interface{}{ 13530 "applicationId": applicationID, 13531 "serviceId": serviceID, 13532 } 13533 13534 const APIVersion = "6.0" 13535 queryParameters := map[string]interface{}{ 13536 "api-version": APIVersion, 13537 } 13538 if timeout != nil { 13539 queryParameters["timeout"] = autorest.Encode("query", *timeout) 13540 } else { 13541 queryParameters["timeout"] = autorest.Encode("query", 60) 13542 } 13543 13544 preparer := autorest.CreatePreparer( 13545 autorest.AsGet(), 13546 autorest.WithBaseURL(client.BaseURI), 13547 autorest.WithPathParameters("/Applications/{applicationId}/$/GetServices/{serviceId}", pathParameters), 13548 autorest.WithQueryParameters(queryParameters)) 13549 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 13550} 13551 13552// GetServiceInfoSender sends the GetServiceInfo request. The method will close the 13553// http.Response Body if it receives an error. 13554func (client BaseClient) GetServiceInfoSender(req *http.Request) (*http.Response, error) { 13555 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 13556 return autorest.SendWithSender(client, req, sd...) 13557} 13558 13559// GetServiceInfoResponder handles the response to the GetServiceInfo request. The method always 13560// closes the http.Response Body. 13561func (client BaseClient) GetServiceInfoResponder(resp *http.Response) (result ServiceInfoModel, err error) { 13562 err = autorest.Respond( 13563 resp, 13564 client.ByInspecting(), 13565 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), 13566 autorest.ByUnmarshallingJSON(&result), 13567 autorest.ByClosing()) 13568 result.Response = autorest.Response{Response: resp} 13569 return 13570} 13571 13572// GetServiceInfoList returns the information about all services belonging to the application specified by the 13573// application id. 13574// Parameters: 13575// applicationID - the identity of the application. This is typically the full name of the application without 13576// the 'fabric:' URI scheme. 13577// Starting from version 6.0, hierarchical names are delimited with the "~" character. 13578// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" 13579// in 6.0+ and "myapp/app1" in previous versions. 13580// serviceTypeName - the service type name used to filter the services to query for. 13581// continuationToken - the continuation token parameter is used to obtain next set of results. A continuation 13582// token with a non empty value is included in the response of the API when the results from the system do not 13583// fit in a single response. When this value is passed to the next API call, the API returns next set of 13584// results. If there are no further results then the continuation token does not contain a value. The value of 13585// this parameter should not be URL encoded. 13586// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 13587// duration that the client is willing to wait for the requested operation to complete. The default value for 13588// this parameter is 60 seconds. 13589func (client BaseClient) GetServiceInfoList(ctx context.Context, applicationID string, serviceTypeName string, continuationToken string, timeout *int64) (result PagedServiceInfoList, err error) { 13590 if tracing.IsEnabled() { 13591 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetServiceInfoList") 13592 defer func() { 13593 sc := -1 13594 if result.Response.Response != nil { 13595 sc = result.Response.Response.StatusCode 13596 } 13597 tracing.EndSpan(ctx, sc, err) 13598 }() 13599 } 13600 if err := validation.Validate([]validation.Validation{ 13601 {TargetValue: timeout, 13602 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 13603 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 13604 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 13605 }}}}}); err != nil { 13606 return result, validation.NewError("servicefabric.BaseClient", "GetServiceInfoList", err.Error()) 13607 } 13608 13609 req, err := client.GetServiceInfoListPreparer(ctx, applicationID, serviceTypeName, continuationToken, timeout) 13610 if err != nil { 13611 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceInfoList", nil, "Failure preparing request") 13612 return 13613 } 13614 13615 resp, err := client.GetServiceInfoListSender(req) 13616 if err != nil { 13617 result.Response = autorest.Response{Response: resp} 13618 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceInfoList", resp, "Failure sending request") 13619 return 13620 } 13621 13622 result, err = client.GetServiceInfoListResponder(resp) 13623 if err != nil { 13624 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceInfoList", resp, "Failure responding to request") 13625 } 13626 13627 return 13628} 13629 13630// GetServiceInfoListPreparer prepares the GetServiceInfoList request. 13631func (client BaseClient) GetServiceInfoListPreparer(ctx context.Context, applicationID string, serviceTypeName string, continuationToken string, timeout *int64) (*http.Request, error) { 13632 pathParameters := map[string]interface{}{ 13633 "applicationId": applicationID, 13634 } 13635 13636 const APIVersion = "6.0" 13637 queryParameters := map[string]interface{}{ 13638 "api-version": APIVersion, 13639 } 13640 if len(serviceTypeName) > 0 { 13641 queryParameters["ServiceTypeName"] = autorest.Encode("query", serviceTypeName) 13642 } 13643 if len(continuationToken) > 0 { 13644 queryParameters["ContinuationToken"] = continuationToken 13645 } 13646 if timeout != nil { 13647 queryParameters["timeout"] = autorest.Encode("query", *timeout) 13648 } else { 13649 queryParameters["timeout"] = autorest.Encode("query", 60) 13650 } 13651 13652 preparer := autorest.CreatePreparer( 13653 autorest.AsGet(), 13654 autorest.WithBaseURL(client.BaseURI), 13655 autorest.WithPathParameters("/Applications/{applicationId}/$/GetServices", pathParameters), 13656 autorest.WithQueryParameters(queryParameters)) 13657 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 13658} 13659 13660// GetServiceInfoListSender sends the GetServiceInfoList request. The method will close the 13661// http.Response Body if it receives an error. 13662func (client BaseClient) GetServiceInfoListSender(req *http.Request) (*http.Response, error) { 13663 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 13664 return autorest.SendWithSender(client, req, sd...) 13665} 13666 13667// GetServiceInfoListResponder handles the response to the GetServiceInfoList request. The method always 13668// closes the http.Response Body. 13669func (client BaseClient) GetServiceInfoListResponder(resp *http.Response) (result PagedServiceInfoList, err error) { 13670 err = autorest.Respond( 13671 resp, 13672 client.ByInspecting(), 13673 azure.WithErrorUnlessStatusCode(http.StatusOK), 13674 autorest.ByUnmarshallingJSON(&result), 13675 autorest.ByClosing()) 13676 result.Response = autorest.Response{Response: resp} 13677 return 13678} 13679 13680// GetServiceManifest gets the manifest describing a service type. The response contains the service manifest XML as a 13681// string. 13682// Parameters: 13683// applicationTypeName - the name of the application type. 13684// applicationTypeVersion - the version of the application type. 13685// serviceManifestName - the name of a service manifest registered as part of an application type in a Service 13686// Fabric cluster. 13687// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 13688// duration that the client is willing to wait for the requested operation to complete. The default value for 13689// this parameter is 60 seconds. 13690func (client BaseClient) GetServiceManifest(ctx context.Context, applicationTypeName string, applicationTypeVersion string, serviceManifestName string, timeout *int64) (result ServiceTypeManifest, err error) { 13691 if tracing.IsEnabled() { 13692 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetServiceManifest") 13693 defer func() { 13694 sc := -1 13695 if result.Response.Response != nil { 13696 sc = result.Response.Response.StatusCode 13697 } 13698 tracing.EndSpan(ctx, sc, err) 13699 }() 13700 } 13701 if err := validation.Validate([]validation.Validation{ 13702 {TargetValue: timeout, 13703 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 13704 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 13705 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 13706 }}}}}); err != nil { 13707 return result, validation.NewError("servicefabric.BaseClient", "GetServiceManifest", err.Error()) 13708 } 13709 13710 req, err := client.GetServiceManifestPreparer(ctx, applicationTypeName, applicationTypeVersion, serviceManifestName, timeout) 13711 if err != nil { 13712 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceManifest", nil, "Failure preparing request") 13713 return 13714 } 13715 13716 resp, err := client.GetServiceManifestSender(req) 13717 if err != nil { 13718 result.Response = autorest.Response{Response: resp} 13719 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceManifest", resp, "Failure sending request") 13720 return 13721 } 13722 13723 result, err = client.GetServiceManifestResponder(resp) 13724 if err != nil { 13725 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceManifest", resp, "Failure responding to request") 13726 } 13727 13728 return 13729} 13730 13731// GetServiceManifestPreparer prepares the GetServiceManifest request. 13732func (client BaseClient) GetServiceManifestPreparer(ctx context.Context, applicationTypeName string, applicationTypeVersion string, serviceManifestName string, timeout *int64) (*http.Request, error) { 13733 pathParameters := map[string]interface{}{ 13734 "applicationTypeName": autorest.Encode("path", applicationTypeName), 13735 } 13736 13737 const APIVersion = "6.0" 13738 queryParameters := map[string]interface{}{ 13739 "api-version": APIVersion, 13740 "ApplicationTypeVersion": autorest.Encode("query", applicationTypeVersion), 13741 "ServiceManifestName": autorest.Encode("query", serviceManifestName), 13742 } 13743 if timeout != nil { 13744 queryParameters["timeout"] = autorest.Encode("query", *timeout) 13745 } else { 13746 queryParameters["timeout"] = autorest.Encode("query", 60) 13747 } 13748 13749 preparer := autorest.CreatePreparer( 13750 autorest.AsGet(), 13751 autorest.WithBaseURL(client.BaseURI), 13752 autorest.WithPathParameters("/ApplicationTypes/{applicationTypeName}/$/GetServiceManifest", pathParameters), 13753 autorest.WithQueryParameters(queryParameters)) 13754 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 13755} 13756 13757// GetServiceManifestSender sends the GetServiceManifest request. The method will close the 13758// http.Response Body if it receives an error. 13759func (client BaseClient) GetServiceManifestSender(req *http.Request) (*http.Response, error) { 13760 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 13761 return autorest.SendWithSender(client, req, sd...) 13762} 13763 13764// GetServiceManifestResponder handles the response to the GetServiceManifest request. The method always 13765// closes the http.Response Body. 13766func (client BaseClient) GetServiceManifestResponder(resp *http.Response) (result ServiceTypeManifest, err error) { 13767 err = autorest.Respond( 13768 resp, 13769 client.ByInspecting(), 13770 azure.WithErrorUnlessStatusCode(http.StatusOK), 13771 autorest.ByUnmarshallingJSON(&result), 13772 autorest.ByClosing()) 13773 result.Response = autorest.Response{Response: resp} 13774 return 13775} 13776 13777// GetServiceNameInfo gets name of the service for the specified partition. A 404 error is returned if the partition ID 13778// does not exist in the cluster. 13779// Parameters: 13780// partitionID - the identity of the partition. 13781// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 13782// duration that the client is willing to wait for the requested operation to complete. The default value for 13783// this parameter is 60 seconds. 13784func (client BaseClient) GetServiceNameInfo(ctx context.Context, partitionID uuid.UUID, timeout *int64) (result ServiceNameInfo, err error) { 13785 if tracing.IsEnabled() { 13786 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetServiceNameInfo") 13787 defer func() { 13788 sc := -1 13789 if result.Response.Response != nil { 13790 sc = result.Response.Response.StatusCode 13791 } 13792 tracing.EndSpan(ctx, sc, err) 13793 }() 13794 } 13795 if err := validation.Validate([]validation.Validation{ 13796 {TargetValue: timeout, 13797 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 13798 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 13799 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 13800 }}}}}); err != nil { 13801 return result, validation.NewError("servicefabric.BaseClient", "GetServiceNameInfo", err.Error()) 13802 } 13803 13804 req, err := client.GetServiceNameInfoPreparer(ctx, partitionID, timeout) 13805 if err != nil { 13806 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceNameInfo", nil, "Failure preparing request") 13807 return 13808 } 13809 13810 resp, err := client.GetServiceNameInfoSender(req) 13811 if err != nil { 13812 result.Response = autorest.Response{Response: resp} 13813 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceNameInfo", resp, "Failure sending request") 13814 return 13815 } 13816 13817 result, err = client.GetServiceNameInfoResponder(resp) 13818 if err != nil { 13819 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceNameInfo", resp, "Failure responding to request") 13820 } 13821 13822 return 13823} 13824 13825// GetServiceNameInfoPreparer prepares the GetServiceNameInfo request. 13826func (client BaseClient) GetServiceNameInfoPreparer(ctx context.Context, partitionID uuid.UUID, timeout *int64) (*http.Request, error) { 13827 pathParameters := map[string]interface{}{ 13828 "partitionId": partitionID, 13829 } 13830 13831 const APIVersion = "6.0" 13832 queryParameters := map[string]interface{}{ 13833 "api-version": APIVersion, 13834 } 13835 if timeout != nil { 13836 queryParameters["timeout"] = autorest.Encode("query", *timeout) 13837 } else { 13838 queryParameters["timeout"] = autorest.Encode("query", 60) 13839 } 13840 13841 preparer := autorest.CreatePreparer( 13842 autorest.AsGet(), 13843 autorest.WithBaseURL(client.BaseURI), 13844 autorest.WithPathParameters("/Partitions/{partitionId}/$/GetServiceName", pathParameters), 13845 autorest.WithQueryParameters(queryParameters)) 13846 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 13847} 13848 13849// GetServiceNameInfoSender sends the GetServiceNameInfo request. The method will close the 13850// http.Response Body if it receives an error. 13851func (client BaseClient) GetServiceNameInfoSender(req *http.Request) (*http.Response, error) { 13852 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 13853 return autorest.SendWithSender(client, req, sd...) 13854} 13855 13856// GetServiceNameInfoResponder handles the response to the GetServiceNameInfo request. The method always 13857// closes the http.Response Body. 13858func (client BaseClient) GetServiceNameInfoResponder(resp *http.Response) (result ServiceNameInfo, err error) { 13859 err = autorest.Respond( 13860 resp, 13861 client.ByInspecting(), 13862 azure.WithErrorUnlessStatusCode(http.StatusOK), 13863 autorest.ByUnmarshallingJSON(&result), 13864 autorest.ByClosing()) 13865 result.Response = autorest.Response{Response: resp} 13866 return 13867} 13868 13869// GetServicesEventList the response is list of ServiceEvent objects. 13870// Parameters: 13871// startTimeUtc - the start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. 13872// endTimeUtc - the end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. 13873// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 13874// duration that the client is willing to wait for the requested operation to complete. The default value for 13875// this parameter is 60 seconds. 13876// eventsTypesFilter - this is a comma separated string specifying the types of FabricEvents that should only 13877// be included in the response. 13878// excludeAnalysisEvents - this param disables the retrieval of AnalysisEvents if true is passed. 13879// skipCorrelationLookup - this param disables the search of CorrelatedEvents information if true is passed. 13880// otherwise the CorrelationEvents get processed and HasCorrelatedEvents field in every FabricEvent gets 13881// populated. 13882func (client BaseClient) GetServicesEventList(ctx context.Context, startTimeUtc string, endTimeUtc string, timeout *int64, eventsTypesFilter string, excludeAnalysisEvents *bool, skipCorrelationLookup *bool) (result ListServiceEvent, err error) { 13883 if tracing.IsEnabled() { 13884 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetServicesEventList") 13885 defer func() { 13886 sc := -1 13887 if result.Response.Response != nil { 13888 sc = result.Response.Response.StatusCode 13889 } 13890 tracing.EndSpan(ctx, sc, err) 13891 }() 13892 } 13893 if err := validation.Validate([]validation.Validation{ 13894 {TargetValue: timeout, 13895 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 13896 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 13897 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 13898 }}}}}); err != nil { 13899 return result, validation.NewError("servicefabric.BaseClient", "GetServicesEventList", err.Error()) 13900 } 13901 13902 req, err := client.GetServicesEventListPreparer(ctx, startTimeUtc, endTimeUtc, timeout, eventsTypesFilter, excludeAnalysisEvents, skipCorrelationLookup) 13903 if err != nil { 13904 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServicesEventList", nil, "Failure preparing request") 13905 return 13906 } 13907 13908 resp, err := client.GetServicesEventListSender(req) 13909 if err != nil { 13910 result.Response = autorest.Response{Response: resp} 13911 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServicesEventList", resp, "Failure sending request") 13912 return 13913 } 13914 13915 result, err = client.GetServicesEventListResponder(resp) 13916 if err != nil { 13917 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServicesEventList", resp, "Failure responding to request") 13918 } 13919 13920 return 13921} 13922 13923// GetServicesEventListPreparer prepares the GetServicesEventList request. 13924func (client BaseClient) GetServicesEventListPreparer(ctx context.Context, startTimeUtc string, endTimeUtc string, timeout *int64, eventsTypesFilter string, excludeAnalysisEvents *bool, skipCorrelationLookup *bool) (*http.Request, error) { 13925 const APIVersion = "6.2-preview" 13926 queryParameters := map[string]interface{}{ 13927 "api-version": APIVersion, 13928 "EndTimeUtc": autorest.Encode("query", endTimeUtc), 13929 "StartTimeUtc": autorest.Encode("query", startTimeUtc), 13930 } 13931 if timeout != nil { 13932 queryParameters["timeout"] = autorest.Encode("query", *timeout) 13933 } else { 13934 queryParameters["timeout"] = autorest.Encode("query", 60) 13935 } 13936 if len(eventsTypesFilter) > 0 { 13937 queryParameters["EventsTypesFilter"] = autorest.Encode("query", eventsTypesFilter) 13938 } 13939 if excludeAnalysisEvents != nil { 13940 queryParameters["ExcludeAnalysisEvents"] = autorest.Encode("query", *excludeAnalysisEvents) 13941 } 13942 if skipCorrelationLookup != nil { 13943 queryParameters["SkipCorrelationLookup"] = autorest.Encode("query", *skipCorrelationLookup) 13944 } 13945 13946 preparer := autorest.CreatePreparer( 13947 autorest.AsGet(), 13948 autorest.WithBaseURL(client.BaseURI), 13949 autorest.WithPath("/EventsStore/Services/Events"), 13950 autorest.WithQueryParameters(queryParameters)) 13951 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 13952} 13953 13954// GetServicesEventListSender sends the GetServicesEventList request. The method will close the 13955// http.Response Body if it receives an error. 13956func (client BaseClient) GetServicesEventListSender(req *http.Request) (*http.Response, error) { 13957 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 13958 return autorest.SendWithSender(client, req, sd...) 13959} 13960 13961// GetServicesEventListResponder handles the response to the GetServicesEventList request. The method always 13962// closes the http.Response Body. 13963func (client BaseClient) GetServicesEventListResponder(resp *http.Response) (result ListServiceEvent, err error) { 13964 err = autorest.Respond( 13965 resp, 13966 client.ByInspecting(), 13967 azure.WithErrorUnlessStatusCode(http.StatusOK), 13968 autorest.ByUnmarshallingJSON(&result), 13969 autorest.ByClosing()) 13970 result.Response = autorest.Response{Response: resp} 13971 return 13972} 13973 13974// GetServiceTypeInfoByName gets the information about a specific service type that is supported by a provisioned 13975// application type in a Service Fabric cluster. The provided application type must exist. Otherwise, a 404 status is 13976// returned. A 204 response is returned if the specified service type is not found in the cluster. 13977// Parameters: 13978// applicationTypeName - the name of the application type. 13979// applicationTypeVersion - the version of the application type. 13980// serviceTypeName - specifies the name of a Service Fabric service type. 13981// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 13982// duration that the client is willing to wait for the requested operation to complete. The default value for 13983// this parameter is 60 seconds. 13984func (client BaseClient) GetServiceTypeInfoByName(ctx context.Context, applicationTypeName string, applicationTypeVersion string, serviceTypeName string, timeout *int64) (result ServiceTypeInfo, err error) { 13985 if tracing.IsEnabled() { 13986 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetServiceTypeInfoByName") 13987 defer func() { 13988 sc := -1 13989 if result.Response.Response != nil { 13990 sc = result.Response.Response.StatusCode 13991 } 13992 tracing.EndSpan(ctx, sc, err) 13993 }() 13994 } 13995 if err := validation.Validate([]validation.Validation{ 13996 {TargetValue: timeout, 13997 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 13998 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 13999 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 14000 }}}}}); err != nil { 14001 return result, validation.NewError("servicefabric.BaseClient", "GetServiceTypeInfoByName", err.Error()) 14002 } 14003 14004 req, err := client.GetServiceTypeInfoByNamePreparer(ctx, applicationTypeName, applicationTypeVersion, serviceTypeName, timeout) 14005 if err != nil { 14006 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceTypeInfoByName", nil, "Failure preparing request") 14007 return 14008 } 14009 14010 resp, err := client.GetServiceTypeInfoByNameSender(req) 14011 if err != nil { 14012 result.Response = autorest.Response{Response: resp} 14013 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceTypeInfoByName", resp, "Failure sending request") 14014 return 14015 } 14016 14017 result, err = client.GetServiceTypeInfoByNameResponder(resp) 14018 if err != nil { 14019 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceTypeInfoByName", resp, "Failure responding to request") 14020 } 14021 14022 return 14023} 14024 14025// GetServiceTypeInfoByNamePreparer prepares the GetServiceTypeInfoByName request. 14026func (client BaseClient) GetServiceTypeInfoByNamePreparer(ctx context.Context, applicationTypeName string, applicationTypeVersion string, serviceTypeName string, timeout *int64) (*http.Request, error) { 14027 pathParameters := map[string]interface{}{ 14028 "applicationTypeName": autorest.Encode("path", applicationTypeName), 14029 "serviceTypeName": serviceTypeName, 14030 } 14031 14032 const APIVersion = "6.0" 14033 queryParameters := map[string]interface{}{ 14034 "api-version": APIVersion, 14035 "ApplicationTypeVersion": autorest.Encode("query", applicationTypeVersion), 14036 } 14037 if timeout != nil { 14038 queryParameters["timeout"] = autorest.Encode("query", *timeout) 14039 } else { 14040 queryParameters["timeout"] = autorest.Encode("query", 60) 14041 } 14042 14043 preparer := autorest.CreatePreparer( 14044 autorest.AsGet(), 14045 autorest.WithBaseURL(client.BaseURI), 14046 autorest.WithPathParameters("/ApplicationTypes/{applicationTypeName}/$/GetServiceTypes/{serviceTypeName}", pathParameters), 14047 autorest.WithQueryParameters(queryParameters)) 14048 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 14049} 14050 14051// GetServiceTypeInfoByNameSender sends the GetServiceTypeInfoByName request. The method will close the 14052// http.Response Body if it receives an error. 14053func (client BaseClient) GetServiceTypeInfoByNameSender(req *http.Request) (*http.Response, error) { 14054 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 14055 return autorest.SendWithSender(client, req, sd...) 14056} 14057 14058// GetServiceTypeInfoByNameResponder handles the response to the GetServiceTypeInfoByName request. The method always 14059// closes the http.Response Body. 14060func (client BaseClient) GetServiceTypeInfoByNameResponder(resp *http.Response) (result ServiceTypeInfo, err error) { 14061 err = autorest.Respond( 14062 resp, 14063 client.ByInspecting(), 14064 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), 14065 autorest.ByUnmarshallingJSON(&result), 14066 autorest.ByClosing()) 14067 result.Response = autorest.Response{Response: resp} 14068 return 14069} 14070 14071// GetServiceTypeInfoList gets the list containing the information about service types that are supported by a 14072// provisioned application type in a Service Fabric cluster. The provided application type must exist. Otherwise, a 404 14073// status is returned. 14074// Parameters: 14075// applicationTypeName - the name of the application type. 14076// applicationTypeVersion - the version of the application type. 14077// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 14078// duration that the client is willing to wait for the requested operation to complete. The default value for 14079// this parameter is 60 seconds. 14080func (client BaseClient) GetServiceTypeInfoList(ctx context.Context, applicationTypeName string, applicationTypeVersion string, timeout *int64) (result ListServiceTypeInfo, err error) { 14081 if tracing.IsEnabled() { 14082 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetServiceTypeInfoList") 14083 defer func() { 14084 sc := -1 14085 if result.Response.Response != nil { 14086 sc = result.Response.Response.StatusCode 14087 } 14088 tracing.EndSpan(ctx, sc, err) 14089 }() 14090 } 14091 if err := validation.Validate([]validation.Validation{ 14092 {TargetValue: timeout, 14093 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 14094 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 14095 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 14096 }}}}}); err != nil { 14097 return result, validation.NewError("servicefabric.BaseClient", "GetServiceTypeInfoList", err.Error()) 14098 } 14099 14100 req, err := client.GetServiceTypeInfoListPreparer(ctx, applicationTypeName, applicationTypeVersion, timeout) 14101 if err != nil { 14102 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceTypeInfoList", nil, "Failure preparing request") 14103 return 14104 } 14105 14106 resp, err := client.GetServiceTypeInfoListSender(req) 14107 if err != nil { 14108 result.Response = autorest.Response{Response: resp} 14109 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceTypeInfoList", resp, "Failure sending request") 14110 return 14111 } 14112 14113 result, err = client.GetServiceTypeInfoListResponder(resp) 14114 if err != nil { 14115 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceTypeInfoList", resp, "Failure responding to request") 14116 } 14117 14118 return 14119} 14120 14121// GetServiceTypeInfoListPreparer prepares the GetServiceTypeInfoList request. 14122func (client BaseClient) GetServiceTypeInfoListPreparer(ctx context.Context, applicationTypeName string, applicationTypeVersion string, timeout *int64) (*http.Request, error) { 14123 pathParameters := map[string]interface{}{ 14124 "applicationTypeName": autorest.Encode("path", applicationTypeName), 14125 } 14126 14127 const APIVersion = "6.0" 14128 queryParameters := map[string]interface{}{ 14129 "api-version": APIVersion, 14130 "ApplicationTypeVersion": autorest.Encode("query", applicationTypeVersion), 14131 } 14132 if timeout != nil { 14133 queryParameters["timeout"] = autorest.Encode("query", *timeout) 14134 } else { 14135 queryParameters["timeout"] = autorest.Encode("query", 60) 14136 } 14137 14138 preparer := autorest.CreatePreparer( 14139 autorest.AsGet(), 14140 autorest.WithBaseURL(client.BaseURI), 14141 autorest.WithPathParameters("/ApplicationTypes/{applicationTypeName}/$/GetServiceTypes", pathParameters), 14142 autorest.WithQueryParameters(queryParameters)) 14143 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 14144} 14145 14146// GetServiceTypeInfoListSender sends the GetServiceTypeInfoList request. The method will close the 14147// http.Response Body if it receives an error. 14148func (client BaseClient) GetServiceTypeInfoListSender(req *http.Request) (*http.Response, error) { 14149 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 14150 return autorest.SendWithSender(client, req, sd...) 14151} 14152 14153// GetServiceTypeInfoListResponder handles the response to the GetServiceTypeInfoList request. The method always 14154// closes the http.Response Body. 14155func (client BaseClient) GetServiceTypeInfoListResponder(resp *http.Response) (result ListServiceTypeInfo, err error) { 14156 err = autorest.Respond( 14157 resp, 14158 client.ByInspecting(), 14159 azure.WithErrorUnlessStatusCode(http.StatusOK), 14160 autorest.ByUnmarshallingJSON(&result.Value), 14161 autorest.ByClosing()) 14162 result.Response = autorest.Response{Response: resp} 14163 return 14164} 14165 14166// GetSubNameInfoList enumerates all the Service Fabric names under a given name. If the subnames do not fit in a page, 14167// one page of results is returned as well as a continuation token which can be used to get the next page. Querying a 14168// name that doesn't exist will fail. 14169// Parameters: 14170// nameID - the Service Fabric name, without the 'fabric:' URI scheme. 14171// recursive - allows specifying that the search performed should be recursive. 14172// continuationToken - the continuation token parameter is used to obtain next set of results. A continuation 14173// token with a non empty value is included in the response of the API when the results from the system do not 14174// fit in a single response. When this value is passed to the next API call, the API returns next set of 14175// results. If there are no further results then the continuation token does not contain a value. The value of 14176// this parameter should not be URL encoded. 14177// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 14178// duration that the client is willing to wait for the requested operation to complete. The default value for 14179// this parameter is 60 seconds. 14180func (client BaseClient) GetSubNameInfoList(ctx context.Context, nameID string, recursive *bool, continuationToken string, timeout *int64) (result PagedSubNameInfoList, err error) { 14181 if tracing.IsEnabled() { 14182 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetSubNameInfoList") 14183 defer func() { 14184 sc := -1 14185 if result.Response.Response != nil { 14186 sc = result.Response.Response.StatusCode 14187 } 14188 tracing.EndSpan(ctx, sc, err) 14189 }() 14190 } 14191 if err := validation.Validate([]validation.Validation{ 14192 {TargetValue: timeout, 14193 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 14194 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 14195 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 14196 }}}}}); err != nil { 14197 return result, validation.NewError("servicefabric.BaseClient", "GetSubNameInfoList", err.Error()) 14198 } 14199 14200 req, err := client.GetSubNameInfoListPreparer(ctx, nameID, recursive, continuationToken, timeout) 14201 if err != nil { 14202 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetSubNameInfoList", nil, "Failure preparing request") 14203 return 14204 } 14205 14206 resp, err := client.GetSubNameInfoListSender(req) 14207 if err != nil { 14208 result.Response = autorest.Response{Response: resp} 14209 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetSubNameInfoList", resp, "Failure sending request") 14210 return 14211 } 14212 14213 result, err = client.GetSubNameInfoListResponder(resp) 14214 if err != nil { 14215 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetSubNameInfoList", resp, "Failure responding to request") 14216 } 14217 14218 return 14219} 14220 14221// GetSubNameInfoListPreparer prepares the GetSubNameInfoList request. 14222func (client BaseClient) GetSubNameInfoListPreparer(ctx context.Context, nameID string, recursive *bool, continuationToken string, timeout *int64) (*http.Request, error) { 14223 pathParameters := map[string]interface{}{ 14224 "nameId": nameID, 14225 } 14226 14227 const APIVersion = "6.0" 14228 queryParameters := map[string]interface{}{ 14229 "api-version": APIVersion, 14230 } 14231 if recursive != nil { 14232 queryParameters["Recursive"] = autorest.Encode("query", *recursive) 14233 } else { 14234 queryParameters["Recursive"] = autorest.Encode("query", false) 14235 } 14236 if len(continuationToken) > 0 { 14237 queryParameters["ContinuationToken"] = continuationToken 14238 } 14239 if timeout != nil { 14240 queryParameters["timeout"] = autorest.Encode("query", *timeout) 14241 } else { 14242 queryParameters["timeout"] = autorest.Encode("query", 60) 14243 } 14244 14245 preparer := autorest.CreatePreparer( 14246 autorest.AsGet(), 14247 autorest.WithBaseURL(client.BaseURI), 14248 autorest.WithPathParameters("/Names/{nameId}/$/GetSubNames", pathParameters), 14249 autorest.WithQueryParameters(queryParameters)) 14250 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 14251} 14252 14253// GetSubNameInfoListSender sends the GetSubNameInfoList request. The method will close the 14254// http.Response Body if it receives an error. 14255func (client BaseClient) GetSubNameInfoListSender(req *http.Request) (*http.Response, error) { 14256 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 14257 return autorest.SendWithSender(client, req, sd...) 14258} 14259 14260// GetSubNameInfoListResponder handles the response to the GetSubNameInfoList request. The method always 14261// closes the http.Response Body. 14262func (client BaseClient) GetSubNameInfoListResponder(resp *http.Response) (result PagedSubNameInfoList, err error) { 14263 err = autorest.Respond( 14264 resp, 14265 client.ByInspecting(), 14266 azure.WithErrorUnlessStatusCode(http.StatusOK), 14267 autorest.ByUnmarshallingJSON(&result), 14268 autorest.ByClosing()) 14269 result.Response = autorest.Response{Response: resp} 14270 return 14271} 14272 14273// GetUpgradeOrchestrationServiceState get the service state of Service Fabric Upgrade Orchestration Service. This API 14274// is internally used for support purposes. 14275// Parameters: 14276// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 14277// duration that the client is willing to wait for the requested operation to complete. The default value for 14278// this parameter is 60 seconds. 14279func (client BaseClient) GetUpgradeOrchestrationServiceState(ctx context.Context, timeout *int64) (result UpgradeOrchestrationServiceState, err error) { 14280 if tracing.IsEnabled() { 14281 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetUpgradeOrchestrationServiceState") 14282 defer func() { 14283 sc := -1 14284 if result.Response.Response != nil { 14285 sc = result.Response.Response.StatusCode 14286 } 14287 tracing.EndSpan(ctx, sc, err) 14288 }() 14289 } 14290 if err := validation.Validate([]validation.Validation{ 14291 {TargetValue: timeout, 14292 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 14293 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 14294 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 14295 }}}}}); err != nil { 14296 return result, validation.NewError("servicefabric.BaseClient", "GetUpgradeOrchestrationServiceState", err.Error()) 14297 } 14298 14299 req, err := client.GetUpgradeOrchestrationServiceStatePreparer(ctx, timeout) 14300 if err != nil { 14301 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetUpgradeOrchestrationServiceState", nil, "Failure preparing request") 14302 return 14303 } 14304 14305 resp, err := client.GetUpgradeOrchestrationServiceStateSender(req) 14306 if err != nil { 14307 result.Response = autorest.Response{Response: resp} 14308 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetUpgradeOrchestrationServiceState", resp, "Failure sending request") 14309 return 14310 } 14311 14312 result, err = client.GetUpgradeOrchestrationServiceStateResponder(resp) 14313 if err != nil { 14314 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetUpgradeOrchestrationServiceState", resp, "Failure responding to request") 14315 } 14316 14317 return 14318} 14319 14320// GetUpgradeOrchestrationServiceStatePreparer prepares the GetUpgradeOrchestrationServiceState request. 14321func (client BaseClient) GetUpgradeOrchestrationServiceStatePreparer(ctx context.Context, timeout *int64) (*http.Request, error) { 14322 const APIVersion = "6.0" 14323 queryParameters := map[string]interface{}{ 14324 "api-version": APIVersion, 14325 } 14326 if timeout != nil { 14327 queryParameters["timeout"] = autorest.Encode("query", *timeout) 14328 } else { 14329 queryParameters["timeout"] = autorest.Encode("query", 60) 14330 } 14331 14332 preparer := autorest.CreatePreparer( 14333 autorest.AsGet(), 14334 autorest.WithBaseURL(client.BaseURI), 14335 autorest.WithPath("/$/GetUpgradeOrchestrationServiceState"), 14336 autorest.WithQueryParameters(queryParameters)) 14337 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 14338} 14339 14340// GetUpgradeOrchestrationServiceStateSender sends the GetUpgradeOrchestrationServiceState request. The method will close the 14341// http.Response Body if it receives an error. 14342func (client BaseClient) GetUpgradeOrchestrationServiceStateSender(req *http.Request) (*http.Response, error) { 14343 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 14344 return autorest.SendWithSender(client, req, sd...) 14345} 14346 14347// GetUpgradeOrchestrationServiceStateResponder handles the response to the GetUpgradeOrchestrationServiceState request. The method always 14348// closes the http.Response Body. 14349func (client BaseClient) GetUpgradeOrchestrationServiceStateResponder(resp *http.Response) (result UpgradeOrchestrationServiceState, err error) { 14350 err = autorest.Respond( 14351 resp, 14352 client.ByInspecting(), 14353 azure.WithErrorUnlessStatusCode(http.StatusOK), 14354 autorest.ByUnmarshallingJSON(&result), 14355 autorest.ByClosing()) 14356 result.Response = autorest.Response{Response: resp} 14357 return 14358} 14359 14360// InvokeContainerAPI invoke container API on a container deployed on a Service Fabric node for the given code package. 14361// Parameters: 14362// nodeName - the name of the node. 14363// applicationID - the identity of the application. This is typically the full name of the application without 14364// the 'fabric:' URI scheme. 14365// Starting from version 6.0, hierarchical names are delimited with the "~" character. 14366// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" 14367// in 6.0+ and "myapp/app1" in previous versions. 14368// serviceManifestName - the name of a service manifest registered as part of an application type in a Service 14369// Fabric cluster. 14370// codePackageName - the name of code package specified in service manifest registered as part of an 14371// application type in a Service Fabric cluster. 14372// codePackageInstanceID - ID that uniquely identifies a code package instance deployed on a service fabric 14373// node. 14374// containerAPIRequestBody - parameters for making container API call 14375// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 14376// duration that the client is willing to wait for the requested operation to complete. The default value for 14377// this parameter is 60 seconds. 14378func (client BaseClient) InvokeContainerAPI(ctx context.Context, nodeName string, applicationID string, serviceManifestName string, codePackageName string, codePackageInstanceID string, containerAPIRequestBody ContainerAPIRequestBody, timeout *int64) (result ContainerAPIResponse, err error) { 14379 if tracing.IsEnabled() { 14380 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.InvokeContainerAPI") 14381 defer func() { 14382 sc := -1 14383 if result.Response.Response != nil { 14384 sc = result.Response.Response.StatusCode 14385 } 14386 tracing.EndSpan(ctx, sc, err) 14387 }() 14388 } 14389 if err := validation.Validate([]validation.Validation{ 14390 {TargetValue: timeout, 14391 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 14392 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 14393 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 14394 }}}}, 14395 {TargetValue: containerAPIRequestBody, 14396 Constraints: []validation.Constraint{{Target: "containerAPIRequestBody.URIPath", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { 14397 return result, validation.NewError("servicefabric.BaseClient", "InvokeContainerAPI", err.Error()) 14398 } 14399 14400 req, err := client.InvokeContainerAPIPreparer(ctx, nodeName, applicationID, serviceManifestName, codePackageName, codePackageInstanceID, containerAPIRequestBody, timeout) 14401 if err != nil { 14402 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "InvokeContainerAPI", nil, "Failure preparing request") 14403 return 14404 } 14405 14406 resp, err := client.InvokeContainerAPISender(req) 14407 if err != nil { 14408 result.Response = autorest.Response{Response: resp} 14409 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "InvokeContainerAPI", resp, "Failure sending request") 14410 return 14411 } 14412 14413 result, err = client.InvokeContainerAPIResponder(resp) 14414 if err != nil { 14415 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "InvokeContainerAPI", resp, "Failure responding to request") 14416 } 14417 14418 return 14419} 14420 14421// InvokeContainerAPIPreparer prepares the InvokeContainerAPI request. 14422func (client BaseClient) InvokeContainerAPIPreparer(ctx context.Context, nodeName string, applicationID string, serviceManifestName string, codePackageName string, codePackageInstanceID string, containerAPIRequestBody ContainerAPIRequestBody, timeout *int64) (*http.Request, error) { 14423 pathParameters := map[string]interface{}{ 14424 "applicationId": applicationID, 14425 "nodeName": autorest.Encode("path", nodeName), 14426 } 14427 14428 const APIVersion = "6.2" 14429 queryParameters := map[string]interface{}{ 14430 "api-version": APIVersion, 14431 "CodePackageInstanceId": autorest.Encode("query", codePackageInstanceID), 14432 "CodePackageName": autorest.Encode("query", codePackageName), 14433 "ServiceManifestName": autorest.Encode("query", serviceManifestName), 14434 } 14435 if timeout != nil { 14436 queryParameters["timeout"] = autorest.Encode("query", *timeout) 14437 } else { 14438 queryParameters["timeout"] = autorest.Encode("query", 60) 14439 } 14440 14441 preparer := autorest.CreatePreparer( 14442 autorest.AsContentType("application/json; charset=utf-8"), 14443 autorest.AsPost(), 14444 autorest.WithBaseURL(client.BaseURI), 14445 autorest.WithPathParameters("/Nodes/{nodeName}/$/GetApplications/{applicationId}/$/GetCodePackages/$/ContainerApi", pathParameters), 14446 autorest.WithJSON(containerAPIRequestBody), 14447 autorest.WithQueryParameters(queryParameters)) 14448 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 14449} 14450 14451// InvokeContainerAPISender sends the InvokeContainerAPI request. The method will close the 14452// http.Response Body if it receives an error. 14453func (client BaseClient) InvokeContainerAPISender(req *http.Request) (*http.Response, error) { 14454 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 14455 return autorest.SendWithSender(client, req, sd...) 14456} 14457 14458// InvokeContainerAPIResponder handles the response to the InvokeContainerAPI request. The method always 14459// closes the http.Response Body. 14460func (client BaseClient) InvokeContainerAPIResponder(resp *http.Response) (result ContainerAPIResponse, err error) { 14461 err = autorest.Respond( 14462 resp, 14463 client.ByInspecting(), 14464 azure.WithErrorUnlessStatusCode(http.StatusOK), 14465 autorest.ByUnmarshallingJSON(&result), 14466 autorest.ByClosing()) 14467 result.Response = autorest.Response{Response: resp} 14468 return 14469} 14470 14471// InvokeInfrastructureCommand for clusters that have one or more instances of the Infrastructure Service configured, 14472// this API provides a way to send infrastructure-specific commands to a particular 14473// instance of the Infrastructure Service. 14474// 14475// Available commands and their corresponding response formats vary depending upon 14476// the infrastructure on which the cluster is running. 14477// 14478// This API supports the Service Fabric platform; it is not meant to be used directly from your code. 14479// Parameters: 14480// command - the text of the command to be invoked. The content of the command is infrastructure-specific. 14481// serviceID - the identity of the infrastructure service. This is the full name of the infrastructure service 14482// without the 'fabric:' URI scheme. This parameter required only for the cluster that have more than one 14483// instance of infrastructure service running. 14484// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 14485// duration that the client is willing to wait for the requested operation to complete. The default value for 14486// this parameter is 60 seconds. 14487func (client BaseClient) InvokeInfrastructureCommand(ctx context.Context, command string, serviceID string, timeout *int64) (result String, err error) { 14488 if tracing.IsEnabled() { 14489 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.InvokeInfrastructureCommand") 14490 defer func() { 14491 sc := -1 14492 if result.Response.Response != nil { 14493 sc = result.Response.Response.StatusCode 14494 } 14495 tracing.EndSpan(ctx, sc, err) 14496 }() 14497 } 14498 if err := validation.Validate([]validation.Validation{ 14499 {TargetValue: timeout, 14500 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 14501 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 14502 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 14503 }}}}}); err != nil { 14504 return result, validation.NewError("servicefabric.BaseClient", "InvokeInfrastructureCommand", err.Error()) 14505 } 14506 14507 req, err := client.InvokeInfrastructureCommandPreparer(ctx, command, serviceID, timeout) 14508 if err != nil { 14509 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "InvokeInfrastructureCommand", nil, "Failure preparing request") 14510 return 14511 } 14512 14513 resp, err := client.InvokeInfrastructureCommandSender(req) 14514 if err != nil { 14515 result.Response = autorest.Response{Response: resp} 14516 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "InvokeInfrastructureCommand", resp, "Failure sending request") 14517 return 14518 } 14519 14520 result, err = client.InvokeInfrastructureCommandResponder(resp) 14521 if err != nil { 14522 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "InvokeInfrastructureCommand", resp, "Failure responding to request") 14523 } 14524 14525 return 14526} 14527 14528// InvokeInfrastructureCommandPreparer prepares the InvokeInfrastructureCommand request. 14529func (client BaseClient) InvokeInfrastructureCommandPreparer(ctx context.Context, command string, serviceID string, timeout *int64) (*http.Request, error) { 14530 const APIVersion = "6.0" 14531 queryParameters := map[string]interface{}{ 14532 "api-version": APIVersion, 14533 "Command": autorest.Encode("query", command), 14534 } 14535 if len(serviceID) > 0 { 14536 queryParameters["ServiceId"] = autorest.Encode("query", serviceID) 14537 } 14538 if timeout != nil { 14539 queryParameters["timeout"] = autorest.Encode("query", *timeout) 14540 } else { 14541 queryParameters["timeout"] = autorest.Encode("query", 60) 14542 } 14543 14544 preparer := autorest.CreatePreparer( 14545 autorest.AsPost(), 14546 autorest.WithBaseURL(client.BaseURI), 14547 autorest.WithPath("/$/InvokeInfrastructureCommand"), 14548 autorest.WithQueryParameters(queryParameters)) 14549 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 14550} 14551 14552// InvokeInfrastructureCommandSender sends the InvokeInfrastructureCommand request. The method will close the 14553// http.Response Body if it receives an error. 14554func (client BaseClient) InvokeInfrastructureCommandSender(req *http.Request) (*http.Response, error) { 14555 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 14556 return autorest.SendWithSender(client, req, sd...) 14557} 14558 14559// InvokeInfrastructureCommandResponder handles the response to the InvokeInfrastructureCommand request. The method always 14560// closes the http.Response Body. 14561func (client BaseClient) InvokeInfrastructureCommandResponder(resp *http.Response) (result String, err error) { 14562 err = autorest.Respond( 14563 resp, 14564 client.ByInspecting(), 14565 azure.WithErrorUnlessStatusCode(http.StatusOK), 14566 autorest.ByUnmarshallingJSON(&result.Value), 14567 autorest.ByClosing()) 14568 result.Response = autorest.Response{Response: resp} 14569 return 14570} 14571 14572// InvokeInfrastructureQuery for clusters that have one or more instances of the Infrastructure Service configured, 14573// this API provides a way to send infrastructure-specific queries to a particular 14574// instance of the Infrastructure Service. 14575// 14576// Available commands and their corresponding response formats vary depending upon 14577// the infrastructure on which the cluster is running. 14578// 14579// This API supports the Service Fabric platform; it is not meant to be used directly from your code. 14580// Parameters: 14581// command - the text of the command to be invoked. The content of the command is infrastructure-specific. 14582// serviceID - the identity of the infrastructure service. This is the full name of the infrastructure service 14583// without the 'fabric:' URI scheme. This parameter required only for the cluster that have more than one 14584// instance of infrastructure service running. 14585// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 14586// duration that the client is willing to wait for the requested operation to complete. The default value for 14587// this parameter is 60 seconds. 14588func (client BaseClient) InvokeInfrastructureQuery(ctx context.Context, command string, serviceID string, timeout *int64) (result String, err error) { 14589 if tracing.IsEnabled() { 14590 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.InvokeInfrastructureQuery") 14591 defer func() { 14592 sc := -1 14593 if result.Response.Response != nil { 14594 sc = result.Response.Response.StatusCode 14595 } 14596 tracing.EndSpan(ctx, sc, err) 14597 }() 14598 } 14599 if err := validation.Validate([]validation.Validation{ 14600 {TargetValue: timeout, 14601 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 14602 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 14603 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 14604 }}}}}); err != nil { 14605 return result, validation.NewError("servicefabric.BaseClient", "InvokeInfrastructureQuery", err.Error()) 14606 } 14607 14608 req, err := client.InvokeInfrastructureQueryPreparer(ctx, command, serviceID, timeout) 14609 if err != nil { 14610 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "InvokeInfrastructureQuery", nil, "Failure preparing request") 14611 return 14612 } 14613 14614 resp, err := client.InvokeInfrastructureQuerySender(req) 14615 if err != nil { 14616 result.Response = autorest.Response{Response: resp} 14617 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "InvokeInfrastructureQuery", resp, "Failure sending request") 14618 return 14619 } 14620 14621 result, err = client.InvokeInfrastructureQueryResponder(resp) 14622 if err != nil { 14623 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "InvokeInfrastructureQuery", resp, "Failure responding to request") 14624 } 14625 14626 return 14627} 14628 14629// InvokeInfrastructureQueryPreparer prepares the InvokeInfrastructureQuery request. 14630func (client BaseClient) InvokeInfrastructureQueryPreparer(ctx context.Context, command string, serviceID string, timeout *int64) (*http.Request, error) { 14631 const APIVersion = "6.0" 14632 queryParameters := map[string]interface{}{ 14633 "api-version": APIVersion, 14634 "Command": autorest.Encode("query", command), 14635 } 14636 if len(serviceID) > 0 { 14637 queryParameters["ServiceId"] = autorest.Encode("query", serviceID) 14638 } 14639 if timeout != nil { 14640 queryParameters["timeout"] = autorest.Encode("query", *timeout) 14641 } else { 14642 queryParameters["timeout"] = autorest.Encode("query", 60) 14643 } 14644 14645 preparer := autorest.CreatePreparer( 14646 autorest.AsGet(), 14647 autorest.WithBaseURL(client.BaseURI), 14648 autorest.WithPath("/$/InvokeInfrastructureQuery"), 14649 autorest.WithQueryParameters(queryParameters)) 14650 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 14651} 14652 14653// InvokeInfrastructureQuerySender sends the InvokeInfrastructureQuery request. The method will close the 14654// http.Response Body if it receives an error. 14655func (client BaseClient) InvokeInfrastructureQuerySender(req *http.Request) (*http.Response, error) { 14656 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 14657 return autorest.SendWithSender(client, req, sd...) 14658} 14659 14660// InvokeInfrastructureQueryResponder handles the response to the InvokeInfrastructureQuery request. The method always 14661// closes the http.Response Body. 14662func (client BaseClient) InvokeInfrastructureQueryResponder(resp *http.Response) (result String, err error) { 14663 err = autorest.Respond( 14664 resp, 14665 client.ByInspecting(), 14666 azure.WithErrorUnlessStatusCode(http.StatusOK), 14667 autorest.ByUnmarshallingJSON(&result.Value), 14668 autorest.ByClosing()) 14669 result.Response = autorest.Response{Response: resp} 14670 return 14671} 14672 14673// PostChaosSchedule set the Chaos Schedule currently in use by Chaos. Chaos will automatically schedule runs based on 14674// the Chaos Schedule. 14675// The version in the provided input schedule must match the version of the Chaos Schedule on the server. 14676// If the version provided does not match the version on the server, the Chaos Schedule is not updated. 14677// If the version provided matches the version on the server, then the Chaos Schedule is updated and the version of the 14678// Chaos Schedule on the server is incremented up by one and wraps back to 0 after 2,147,483,647. 14679// If Chaos is running when this call is made, the call will fail. 14680// Parameters: 14681// chaosSchedule - describes the schedule used by Chaos. 14682func (client BaseClient) PostChaosSchedule(ctx context.Context, chaosSchedule ChaosScheduleDescription) (result autorest.Response, err error) { 14683 if tracing.IsEnabled() { 14684 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.PostChaosSchedule") 14685 defer func() { 14686 sc := -1 14687 if result.Response != nil { 14688 sc = result.Response.StatusCode 14689 } 14690 tracing.EndSpan(ctx, sc, err) 14691 }() 14692 } 14693 if err := validation.Validate([]validation.Validation{ 14694 {TargetValue: chaosSchedule, 14695 Constraints: []validation.Constraint{{Target: "chaosSchedule.Version", Name: validation.Null, Rule: false, 14696 Chain: []validation.Constraint{{Target: "chaosSchedule.Version", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}}}}); err != nil { 14697 return result, validation.NewError("servicefabric.BaseClient", "PostChaosSchedule", err.Error()) 14698 } 14699 14700 req, err := client.PostChaosSchedulePreparer(ctx, chaosSchedule) 14701 if err != nil { 14702 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "PostChaosSchedule", nil, "Failure preparing request") 14703 return 14704 } 14705 14706 resp, err := client.PostChaosScheduleSender(req) 14707 if err != nil { 14708 result.Response = resp 14709 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "PostChaosSchedule", resp, "Failure sending request") 14710 return 14711 } 14712 14713 result, err = client.PostChaosScheduleResponder(resp) 14714 if err != nil { 14715 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "PostChaosSchedule", resp, "Failure responding to request") 14716 } 14717 14718 return 14719} 14720 14721// PostChaosSchedulePreparer prepares the PostChaosSchedule request. 14722func (client BaseClient) PostChaosSchedulePreparer(ctx context.Context, chaosSchedule ChaosScheduleDescription) (*http.Request, error) { 14723 const APIVersion = "6.2" 14724 queryParameters := map[string]interface{}{ 14725 "api-version": APIVersion, 14726 } 14727 14728 preparer := autorest.CreatePreparer( 14729 autorest.AsContentType("application/json; charset=utf-8"), 14730 autorest.AsPost(), 14731 autorest.WithBaseURL(client.BaseURI), 14732 autorest.WithPath("/Tools/Chaos/Schedule"), 14733 autorest.WithJSON(chaosSchedule), 14734 autorest.WithQueryParameters(queryParameters)) 14735 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 14736} 14737 14738// PostChaosScheduleSender sends the PostChaosSchedule request. The method will close the 14739// http.Response Body if it receives an error. 14740func (client BaseClient) PostChaosScheduleSender(req *http.Request) (*http.Response, error) { 14741 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 14742 return autorest.SendWithSender(client, req, sd...) 14743} 14744 14745// PostChaosScheduleResponder handles the response to the PostChaosSchedule request. The method always 14746// closes the http.Response Body. 14747func (client BaseClient) PostChaosScheduleResponder(resp *http.Response) (result autorest.Response, err error) { 14748 err = autorest.Respond( 14749 resp, 14750 client.ByInspecting(), 14751 azure.WithErrorUnlessStatusCode(http.StatusOK), 14752 autorest.ByClosing()) 14753 result.Response = resp 14754 return 14755} 14756 14757// ProvisionApplicationType provisions a Service Fabric application type with the cluster. The provision is required 14758// before any new applications can be instantiated. 14759// The provision operation can be performed either on the application package specified by the 14760// relativePathInImageStore, or by using the URI of the external '.sfpkg'. 14761// Parameters: 14762// provisionApplicationTypeDescriptionBaseRequiredBodyParam - the base type of provision application type 14763// description which supports either image store-based provision or external store-based provision. 14764// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 14765// duration that the client is willing to wait for the requested operation to complete. The default value for 14766// this parameter is 60 seconds. 14767func (client BaseClient) ProvisionApplicationType(ctx context.Context, provisionApplicationTypeDescriptionBaseRequiredBodyParam BasicProvisionApplicationTypeDescriptionBase, timeout *int64) (result autorest.Response, err error) { 14768 if tracing.IsEnabled() { 14769 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ProvisionApplicationType") 14770 defer func() { 14771 sc := -1 14772 if result.Response != nil { 14773 sc = result.Response.StatusCode 14774 } 14775 tracing.EndSpan(ctx, sc, err) 14776 }() 14777 } 14778 if err := validation.Validate([]validation.Validation{ 14779 {TargetValue: provisionApplicationTypeDescriptionBaseRequiredBodyParam, 14780 Constraints: []validation.Constraint{{Target: "provisionApplicationTypeDescriptionBaseRequiredBodyParam.Async", Name: validation.Null, Rule: true, Chain: nil}}}, 14781 {TargetValue: timeout, 14782 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 14783 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 14784 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 14785 }}}}}); err != nil { 14786 return result, validation.NewError("servicefabric.BaseClient", "ProvisionApplicationType", err.Error()) 14787 } 14788 14789 req, err := client.ProvisionApplicationTypePreparer(ctx, provisionApplicationTypeDescriptionBaseRequiredBodyParam, timeout) 14790 if err != nil { 14791 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ProvisionApplicationType", nil, "Failure preparing request") 14792 return 14793 } 14794 14795 resp, err := client.ProvisionApplicationTypeSender(req) 14796 if err != nil { 14797 result.Response = resp 14798 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ProvisionApplicationType", resp, "Failure sending request") 14799 return 14800 } 14801 14802 result, err = client.ProvisionApplicationTypeResponder(resp) 14803 if err != nil { 14804 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ProvisionApplicationType", resp, "Failure responding to request") 14805 } 14806 14807 return 14808} 14809 14810// ProvisionApplicationTypePreparer prepares the ProvisionApplicationType request. 14811func (client BaseClient) ProvisionApplicationTypePreparer(ctx context.Context, provisionApplicationTypeDescriptionBaseRequiredBodyParam BasicProvisionApplicationTypeDescriptionBase, timeout *int64) (*http.Request, error) { 14812 const APIVersion = "6.2" 14813 queryParameters := map[string]interface{}{ 14814 "api-version": APIVersion, 14815 } 14816 if timeout != nil { 14817 queryParameters["timeout"] = autorest.Encode("query", *timeout) 14818 } else { 14819 queryParameters["timeout"] = autorest.Encode("query", 60) 14820 } 14821 14822 preparer := autorest.CreatePreparer( 14823 autorest.AsContentType("application/json; charset=utf-8"), 14824 autorest.AsPost(), 14825 autorest.WithBaseURL(client.BaseURI), 14826 autorest.WithPath("/ApplicationTypes/$/Provision"), 14827 autorest.WithJSON(provisionApplicationTypeDescriptionBaseRequiredBodyParam), 14828 autorest.WithQueryParameters(queryParameters)) 14829 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 14830} 14831 14832// ProvisionApplicationTypeSender sends the ProvisionApplicationType request. The method will close the 14833// http.Response Body if it receives an error. 14834func (client BaseClient) ProvisionApplicationTypeSender(req *http.Request) (*http.Response, error) { 14835 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 14836 return autorest.SendWithSender(client, req, sd...) 14837} 14838 14839// ProvisionApplicationTypeResponder handles the response to the ProvisionApplicationType request. The method always 14840// closes the http.Response Body. 14841func (client BaseClient) ProvisionApplicationTypeResponder(resp *http.Response) (result autorest.Response, err error) { 14842 err = autorest.Respond( 14843 resp, 14844 client.ByInspecting(), 14845 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), 14846 autorest.ByClosing()) 14847 result.Response = resp 14848 return 14849} 14850 14851// ProvisionCluster validate and provision the code or configuration packages of a Service Fabric cluster. 14852// Parameters: 14853// provisionFabricDescription - describes the parameters for provisioning a cluster. 14854// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 14855// duration that the client is willing to wait for the requested operation to complete. The default value for 14856// this parameter is 60 seconds. 14857func (client BaseClient) ProvisionCluster(ctx context.Context, provisionFabricDescription ProvisionFabricDescription, timeout *int64) (result autorest.Response, err error) { 14858 if tracing.IsEnabled() { 14859 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ProvisionCluster") 14860 defer func() { 14861 sc := -1 14862 if result.Response != nil { 14863 sc = result.Response.StatusCode 14864 } 14865 tracing.EndSpan(ctx, sc, err) 14866 }() 14867 } 14868 if err := validation.Validate([]validation.Validation{ 14869 {TargetValue: timeout, 14870 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 14871 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 14872 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 14873 }}}}}); err != nil { 14874 return result, validation.NewError("servicefabric.BaseClient", "ProvisionCluster", err.Error()) 14875 } 14876 14877 req, err := client.ProvisionClusterPreparer(ctx, provisionFabricDescription, timeout) 14878 if err != nil { 14879 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ProvisionCluster", nil, "Failure preparing request") 14880 return 14881 } 14882 14883 resp, err := client.ProvisionClusterSender(req) 14884 if err != nil { 14885 result.Response = resp 14886 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ProvisionCluster", resp, "Failure sending request") 14887 return 14888 } 14889 14890 result, err = client.ProvisionClusterResponder(resp) 14891 if err != nil { 14892 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ProvisionCluster", resp, "Failure responding to request") 14893 } 14894 14895 return 14896} 14897 14898// ProvisionClusterPreparer prepares the ProvisionCluster request. 14899func (client BaseClient) ProvisionClusterPreparer(ctx context.Context, provisionFabricDescription ProvisionFabricDescription, timeout *int64) (*http.Request, error) { 14900 const APIVersion = "6.0" 14901 queryParameters := map[string]interface{}{ 14902 "api-version": APIVersion, 14903 } 14904 if timeout != nil { 14905 queryParameters["timeout"] = autorest.Encode("query", *timeout) 14906 } else { 14907 queryParameters["timeout"] = autorest.Encode("query", 60) 14908 } 14909 14910 preparer := autorest.CreatePreparer( 14911 autorest.AsContentType("application/json; charset=utf-8"), 14912 autorest.AsPost(), 14913 autorest.WithBaseURL(client.BaseURI), 14914 autorest.WithPath("/$/Provision"), 14915 autorest.WithJSON(provisionFabricDescription), 14916 autorest.WithQueryParameters(queryParameters)) 14917 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 14918} 14919 14920// ProvisionClusterSender sends the ProvisionCluster request. The method will close the 14921// http.Response Body if it receives an error. 14922func (client BaseClient) ProvisionClusterSender(req *http.Request) (*http.Response, error) { 14923 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 14924 return autorest.SendWithSender(client, req, sd...) 14925} 14926 14927// ProvisionClusterResponder handles the response to the ProvisionCluster request. The method always 14928// closes the http.Response Body. 14929func (client BaseClient) ProvisionClusterResponder(resp *http.Response) (result autorest.Response, err error) { 14930 err = autorest.Respond( 14931 resp, 14932 client.ByInspecting(), 14933 azure.WithErrorUnlessStatusCode(http.StatusOK), 14934 autorest.ByClosing()) 14935 result.Response = resp 14936 return 14937} 14938 14939// PutProperty creates or updates the specified Service Fabric property under a given name. 14940// Parameters: 14941// nameID - the Service Fabric name, without the 'fabric:' URI scheme. 14942// propertyDescription - describes the Service Fabric property to be created. 14943// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 14944// duration that the client is willing to wait for the requested operation to complete. The default value for 14945// this parameter is 60 seconds. 14946func (client BaseClient) PutProperty(ctx context.Context, nameID string, propertyDescription PropertyDescription, timeout *int64) (result autorest.Response, err error) { 14947 if tracing.IsEnabled() { 14948 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.PutProperty") 14949 defer func() { 14950 sc := -1 14951 if result.Response != nil { 14952 sc = result.Response.StatusCode 14953 } 14954 tracing.EndSpan(ctx, sc, err) 14955 }() 14956 } 14957 if err := validation.Validate([]validation.Validation{ 14958 {TargetValue: propertyDescription, 14959 Constraints: []validation.Constraint{{Target: "propertyDescription.PropertyName", Name: validation.Null, Rule: true, Chain: nil}, 14960 {Target: "propertyDescription.Value", Name: validation.Null, Rule: true, Chain: nil}}}, 14961 {TargetValue: timeout, 14962 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 14963 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 14964 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 14965 }}}}}); err != nil { 14966 return result, validation.NewError("servicefabric.BaseClient", "PutProperty", err.Error()) 14967 } 14968 14969 req, err := client.PutPropertyPreparer(ctx, nameID, propertyDescription, timeout) 14970 if err != nil { 14971 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "PutProperty", nil, "Failure preparing request") 14972 return 14973 } 14974 14975 resp, err := client.PutPropertySender(req) 14976 if err != nil { 14977 result.Response = resp 14978 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "PutProperty", resp, "Failure sending request") 14979 return 14980 } 14981 14982 result, err = client.PutPropertyResponder(resp) 14983 if err != nil { 14984 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "PutProperty", resp, "Failure responding to request") 14985 } 14986 14987 return 14988} 14989 14990// PutPropertyPreparer prepares the PutProperty request. 14991func (client BaseClient) PutPropertyPreparer(ctx context.Context, nameID string, propertyDescription PropertyDescription, timeout *int64) (*http.Request, error) { 14992 pathParameters := map[string]interface{}{ 14993 "nameId": nameID, 14994 } 14995 14996 const APIVersion = "6.0" 14997 queryParameters := map[string]interface{}{ 14998 "api-version": APIVersion, 14999 } 15000 if timeout != nil { 15001 queryParameters["timeout"] = autorest.Encode("query", *timeout) 15002 } else { 15003 queryParameters["timeout"] = autorest.Encode("query", 60) 15004 } 15005 15006 preparer := autorest.CreatePreparer( 15007 autorest.AsContentType("application/json; charset=utf-8"), 15008 autorest.AsPut(), 15009 autorest.WithBaseURL(client.BaseURI), 15010 autorest.WithPathParameters("/Names/{nameId}/$/GetProperty", pathParameters), 15011 autorest.WithJSON(propertyDescription), 15012 autorest.WithQueryParameters(queryParameters)) 15013 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 15014} 15015 15016// PutPropertySender sends the PutProperty request. The method will close the 15017// http.Response Body if it receives an error. 15018func (client BaseClient) PutPropertySender(req *http.Request) (*http.Response, error) { 15019 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 15020 return autorest.SendWithSender(client, req, sd...) 15021} 15022 15023// PutPropertyResponder handles the response to the PutProperty request. The method always 15024// closes the http.Response Body. 15025func (client BaseClient) PutPropertyResponder(resp *http.Response) (result autorest.Response, err error) { 15026 err = autorest.Respond( 15027 resp, 15028 client.ByInspecting(), 15029 azure.WithErrorUnlessStatusCode(http.StatusOK), 15030 autorest.ByClosing()) 15031 result.Response = resp 15032 return 15033} 15034 15035// RecoverAllPartitions indicates to the Service Fabric cluster that it should attempt to recover any services 15036// (including system services) which are currently stuck in quorum loss. This operation should only be performed if it 15037// is known that the replicas that are down cannot be recovered. Incorrect use of this API can cause potential data 15038// loss. 15039// Parameters: 15040// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 15041// duration that the client is willing to wait for the requested operation to complete. The default value for 15042// this parameter is 60 seconds. 15043func (client BaseClient) RecoverAllPartitions(ctx context.Context, timeout *int64) (result autorest.Response, err error) { 15044 if tracing.IsEnabled() { 15045 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.RecoverAllPartitions") 15046 defer func() { 15047 sc := -1 15048 if result.Response != nil { 15049 sc = result.Response.StatusCode 15050 } 15051 tracing.EndSpan(ctx, sc, err) 15052 }() 15053 } 15054 if err := validation.Validate([]validation.Validation{ 15055 {TargetValue: timeout, 15056 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 15057 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 15058 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 15059 }}}}}); err != nil { 15060 return result, validation.NewError("servicefabric.BaseClient", "RecoverAllPartitions", err.Error()) 15061 } 15062 15063 req, err := client.RecoverAllPartitionsPreparer(ctx, timeout) 15064 if err != nil { 15065 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RecoverAllPartitions", nil, "Failure preparing request") 15066 return 15067 } 15068 15069 resp, err := client.RecoverAllPartitionsSender(req) 15070 if err != nil { 15071 result.Response = resp 15072 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RecoverAllPartitions", resp, "Failure sending request") 15073 return 15074 } 15075 15076 result, err = client.RecoverAllPartitionsResponder(resp) 15077 if err != nil { 15078 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RecoverAllPartitions", resp, "Failure responding to request") 15079 } 15080 15081 return 15082} 15083 15084// RecoverAllPartitionsPreparer prepares the RecoverAllPartitions request. 15085func (client BaseClient) RecoverAllPartitionsPreparer(ctx context.Context, timeout *int64) (*http.Request, error) { 15086 const APIVersion = "6.0" 15087 queryParameters := map[string]interface{}{ 15088 "api-version": APIVersion, 15089 } 15090 if timeout != nil { 15091 queryParameters["timeout"] = autorest.Encode("query", *timeout) 15092 } else { 15093 queryParameters["timeout"] = autorest.Encode("query", 60) 15094 } 15095 15096 preparer := autorest.CreatePreparer( 15097 autorest.AsPost(), 15098 autorest.WithBaseURL(client.BaseURI), 15099 autorest.WithPath("/$/RecoverAllPartitions"), 15100 autorest.WithQueryParameters(queryParameters)) 15101 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 15102} 15103 15104// RecoverAllPartitionsSender sends the RecoverAllPartitions request. The method will close the 15105// http.Response Body if it receives an error. 15106func (client BaseClient) RecoverAllPartitionsSender(req *http.Request) (*http.Response, error) { 15107 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 15108 return autorest.SendWithSender(client, req, sd...) 15109} 15110 15111// RecoverAllPartitionsResponder handles the response to the RecoverAllPartitions request. The method always 15112// closes the http.Response Body. 15113func (client BaseClient) RecoverAllPartitionsResponder(resp *http.Response) (result autorest.Response, err error) { 15114 err = autorest.Respond( 15115 resp, 15116 client.ByInspecting(), 15117 azure.WithErrorUnlessStatusCode(http.StatusOK), 15118 autorest.ByClosing()) 15119 result.Response = resp 15120 return 15121} 15122 15123// RecoverPartition indicates to the Service Fabric cluster that it should attempt to recover a specific partition 15124// which is currently stuck in quorum loss. This operation should only be performed if it is known that the replicas 15125// that are down cannot be recovered. Incorrect use of this API can cause potential data loss. 15126// Parameters: 15127// partitionID - the identity of the partition. 15128// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 15129// duration that the client is willing to wait for the requested operation to complete. The default value for 15130// this parameter is 60 seconds. 15131func (client BaseClient) RecoverPartition(ctx context.Context, partitionID uuid.UUID, timeout *int64) (result autorest.Response, err error) { 15132 if tracing.IsEnabled() { 15133 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.RecoverPartition") 15134 defer func() { 15135 sc := -1 15136 if result.Response != nil { 15137 sc = result.Response.StatusCode 15138 } 15139 tracing.EndSpan(ctx, sc, err) 15140 }() 15141 } 15142 if err := validation.Validate([]validation.Validation{ 15143 {TargetValue: timeout, 15144 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 15145 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 15146 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 15147 }}}}}); err != nil { 15148 return result, validation.NewError("servicefabric.BaseClient", "RecoverPartition", err.Error()) 15149 } 15150 15151 req, err := client.RecoverPartitionPreparer(ctx, partitionID, timeout) 15152 if err != nil { 15153 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RecoverPartition", nil, "Failure preparing request") 15154 return 15155 } 15156 15157 resp, err := client.RecoverPartitionSender(req) 15158 if err != nil { 15159 result.Response = resp 15160 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RecoverPartition", resp, "Failure sending request") 15161 return 15162 } 15163 15164 result, err = client.RecoverPartitionResponder(resp) 15165 if err != nil { 15166 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RecoverPartition", resp, "Failure responding to request") 15167 } 15168 15169 return 15170} 15171 15172// RecoverPartitionPreparer prepares the RecoverPartition request. 15173func (client BaseClient) RecoverPartitionPreparer(ctx context.Context, partitionID uuid.UUID, timeout *int64) (*http.Request, error) { 15174 pathParameters := map[string]interface{}{ 15175 "partitionId": partitionID, 15176 } 15177 15178 const APIVersion = "6.0" 15179 queryParameters := map[string]interface{}{ 15180 "api-version": APIVersion, 15181 } 15182 if timeout != nil { 15183 queryParameters["timeout"] = autorest.Encode("query", *timeout) 15184 } else { 15185 queryParameters["timeout"] = autorest.Encode("query", 60) 15186 } 15187 15188 preparer := autorest.CreatePreparer( 15189 autorest.AsPost(), 15190 autorest.WithBaseURL(client.BaseURI), 15191 autorest.WithPathParameters("/Partitions/{partitionId}/$/Recover", pathParameters), 15192 autorest.WithQueryParameters(queryParameters)) 15193 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 15194} 15195 15196// RecoverPartitionSender sends the RecoverPartition request. The method will close the 15197// http.Response Body if it receives an error. 15198func (client BaseClient) RecoverPartitionSender(req *http.Request) (*http.Response, error) { 15199 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 15200 return autorest.SendWithSender(client, req, sd...) 15201} 15202 15203// RecoverPartitionResponder handles the response to the RecoverPartition request. The method always 15204// closes the http.Response Body. 15205func (client BaseClient) RecoverPartitionResponder(resp *http.Response) (result autorest.Response, err error) { 15206 err = autorest.Respond( 15207 resp, 15208 client.ByInspecting(), 15209 azure.WithErrorUnlessStatusCode(http.StatusOK), 15210 autorest.ByClosing()) 15211 result.Response = resp 15212 return 15213} 15214 15215// RecoverServicePartitions indicates to the Service Fabric cluster that it should attempt to recover the specified 15216// service which is currently stuck in quorum loss. This operation should only be performed if it is known that the 15217// replicas that are down cannot be recovered. Incorrect use of this API can cause potential data loss. 15218// Parameters: 15219// serviceID - the identity of the service. This is typically the full name of the service without the 15220// 'fabric:' URI scheme. 15221// Starting from version 6.0, hierarchical names are delimited with the "~" character. 15222// For example, if the service name is "fabric:/myapp/app1/svc1", the service identity would be 15223// "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in previous versions. 15224// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 15225// duration that the client is willing to wait for the requested operation to complete. The default value for 15226// this parameter is 60 seconds. 15227func (client BaseClient) RecoverServicePartitions(ctx context.Context, serviceID string, timeout *int64) (result autorest.Response, err error) { 15228 if tracing.IsEnabled() { 15229 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.RecoverServicePartitions") 15230 defer func() { 15231 sc := -1 15232 if result.Response != nil { 15233 sc = result.Response.StatusCode 15234 } 15235 tracing.EndSpan(ctx, sc, err) 15236 }() 15237 } 15238 if err := validation.Validate([]validation.Validation{ 15239 {TargetValue: timeout, 15240 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 15241 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 15242 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 15243 }}}}}); err != nil { 15244 return result, validation.NewError("servicefabric.BaseClient", "RecoverServicePartitions", err.Error()) 15245 } 15246 15247 req, err := client.RecoverServicePartitionsPreparer(ctx, serviceID, timeout) 15248 if err != nil { 15249 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RecoverServicePartitions", nil, "Failure preparing request") 15250 return 15251 } 15252 15253 resp, err := client.RecoverServicePartitionsSender(req) 15254 if err != nil { 15255 result.Response = resp 15256 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RecoverServicePartitions", resp, "Failure sending request") 15257 return 15258 } 15259 15260 result, err = client.RecoverServicePartitionsResponder(resp) 15261 if err != nil { 15262 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RecoverServicePartitions", resp, "Failure responding to request") 15263 } 15264 15265 return 15266} 15267 15268// RecoverServicePartitionsPreparer prepares the RecoverServicePartitions request. 15269func (client BaseClient) RecoverServicePartitionsPreparer(ctx context.Context, serviceID string, timeout *int64) (*http.Request, error) { 15270 pathParameters := map[string]interface{}{ 15271 "serviceId": serviceID, 15272 } 15273 15274 const APIVersion = "6.0" 15275 queryParameters := map[string]interface{}{ 15276 "api-version": APIVersion, 15277 } 15278 if timeout != nil { 15279 queryParameters["timeout"] = autorest.Encode("query", *timeout) 15280 } else { 15281 queryParameters["timeout"] = autorest.Encode("query", 60) 15282 } 15283 15284 preparer := autorest.CreatePreparer( 15285 autorest.AsPost(), 15286 autorest.WithBaseURL(client.BaseURI), 15287 autorest.WithPathParameters("/Services/$/{serviceId}/$/GetPartitions/$/Recover", pathParameters), 15288 autorest.WithQueryParameters(queryParameters)) 15289 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 15290} 15291 15292// RecoverServicePartitionsSender sends the RecoverServicePartitions request. The method will close the 15293// http.Response Body if it receives an error. 15294func (client BaseClient) RecoverServicePartitionsSender(req *http.Request) (*http.Response, error) { 15295 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 15296 return autorest.SendWithSender(client, req, sd...) 15297} 15298 15299// RecoverServicePartitionsResponder handles the response to the RecoverServicePartitions request. The method always 15300// closes the http.Response Body. 15301func (client BaseClient) RecoverServicePartitionsResponder(resp *http.Response) (result autorest.Response, err error) { 15302 err = autorest.Respond( 15303 resp, 15304 client.ByInspecting(), 15305 azure.WithErrorUnlessStatusCode(http.StatusOK), 15306 autorest.ByClosing()) 15307 result.Response = resp 15308 return 15309} 15310 15311// RecoverSystemPartitions indicates to the Service Fabric cluster that it should attempt to recover the system 15312// services which are currently stuck in quorum loss. This operation should only be performed if it is known that the 15313// replicas that are down cannot be recovered. Incorrect use of this API can cause potential data loss. 15314// Parameters: 15315// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 15316// duration that the client is willing to wait for the requested operation to complete. The default value for 15317// this parameter is 60 seconds. 15318func (client BaseClient) RecoverSystemPartitions(ctx context.Context, timeout *int64) (result autorest.Response, err error) { 15319 if tracing.IsEnabled() { 15320 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.RecoverSystemPartitions") 15321 defer func() { 15322 sc := -1 15323 if result.Response != nil { 15324 sc = result.Response.StatusCode 15325 } 15326 tracing.EndSpan(ctx, sc, err) 15327 }() 15328 } 15329 if err := validation.Validate([]validation.Validation{ 15330 {TargetValue: timeout, 15331 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 15332 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 15333 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 15334 }}}}}); err != nil { 15335 return result, validation.NewError("servicefabric.BaseClient", "RecoverSystemPartitions", err.Error()) 15336 } 15337 15338 req, err := client.RecoverSystemPartitionsPreparer(ctx, timeout) 15339 if err != nil { 15340 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RecoverSystemPartitions", nil, "Failure preparing request") 15341 return 15342 } 15343 15344 resp, err := client.RecoverSystemPartitionsSender(req) 15345 if err != nil { 15346 result.Response = resp 15347 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RecoverSystemPartitions", resp, "Failure sending request") 15348 return 15349 } 15350 15351 result, err = client.RecoverSystemPartitionsResponder(resp) 15352 if err != nil { 15353 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RecoverSystemPartitions", resp, "Failure responding to request") 15354 } 15355 15356 return 15357} 15358 15359// RecoverSystemPartitionsPreparer prepares the RecoverSystemPartitions request. 15360func (client BaseClient) RecoverSystemPartitionsPreparer(ctx context.Context, timeout *int64) (*http.Request, error) { 15361 const APIVersion = "6.0" 15362 queryParameters := map[string]interface{}{ 15363 "api-version": APIVersion, 15364 } 15365 if timeout != nil { 15366 queryParameters["timeout"] = autorest.Encode("query", *timeout) 15367 } else { 15368 queryParameters["timeout"] = autorest.Encode("query", 60) 15369 } 15370 15371 preparer := autorest.CreatePreparer( 15372 autorest.AsPost(), 15373 autorest.WithBaseURL(client.BaseURI), 15374 autorest.WithPath("/$/RecoverSystemPartitions"), 15375 autorest.WithQueryParameters(queryParameters)) 15376 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 15377} 15378 15379// RecoverSystemPartitionsSender sends the RecoverSystemPartitions request. The method will close the 15380// http.Response Body if it receives an error. 15381func (client BaseClient) RecoverSystemPartitionsSender(req *http.Request) (*http.Response, error) { 15382 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 15383 return autorest.SendWithSender(client, req, sd...) 15384} 15385 15386// RecoverSystemPartitionsResponder handles the response to the RecoverSystemPartitions request. The method always 15387// closes the http.Response Body. 15388func (client BaseClient) RecoverSystemPartitionsResponder(resp *http.Response) (result autorest.Response, err error) { 15389 err = autorest.Respond( 15390 resp, 15391 client.ByInspecting(), 15392 azure.WithErrorUnlessStatusCode(http.StatusOK), 15393 autorest.ByClosing()) 15394 result.Response = resp 15395 return 15396} 15397 15398// RemoveComposeDeployment deletes an existing Service Fabric compose deployment. 15399// Parameters: 15400// deploymentName - the identity of the deployment. 15401// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 15402// duration that the client is willing to wait for the requested operation to complete. The default value for 15403// this parameter is 60 seconds. 15404func (client BaseClient) RemoveComposeDeployment(ctx context.Context, deploymentName string, timeout *int64) (result autorest.Response, err error) { 15405 if tracing.IsEnabled() { 15406 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.RemoveComposeDeployment") 15407 defer func() { 15408 sc := -1 15409 if result.Response != nil { 15410 sc = result.Response.StatusCode 15411 } 15412 tracing.EndSpan(ctx, sc, err) 15413 }() 15414 } 15415 if err := validation.Validate([]validation.Validation{ 15416 {TargetValue: timeout, 15417 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 15418 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 15419 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 15420 }}}}}); err != nil { 15421 return result, validation.NewError("servicefabric.BaseClient", "RemoveComposeDeployment", err.Error()) 15422 } 15423 15424 req, err := client.RemoveComposeDeploymentPreparer(ctx, deploymentName, timeout) 15425 if err != nil { 15426 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RemoveComposeDeployment", nil, "Failure preparing request") 15427 return 15428 } 15429 15430 resp, err := client.RemoveComposeDeploymentSender(req) 15431 if err != nil { 15432 result.Response = resp 15433 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RemoveComposeDeployment", resp, "Failure sending request") 15434 return 15435 } 15436 15437 result, err = client.RemoveComposeDeploymentResponder(resp) 15438 if err != nil { 15439 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RemoveComposeDeployment", resp, "Failure responding to request") 15440 } 15441 15442 return 15443} 15444 15445// RemoveComposeDeploymentPreparer prepares the RemoveComposeDeployment request. 15446func (client BaseClient) RemoveComposeDeploymentPreparer(ctx context.Context, deploymentName string, timeout *int64) (*http.Request, error) { 15447 pathParameters := map[string]interface{}{ 15448 "deploymentName": deploymentName, 15449 } 15450 15451 const APIVersion = "6.0-preview" 15452 queryParameters := map[string]interface{}{ 15453 "api-version": APIVersion, 15454 } 15455 if timeout != nil { 15456 queryParameters["timeout"] = autorest.Encode("query", *timeout) 15457 } else { 15458 queryParameters["timeout"] = autorest.Encode("query", 60) 15459 } 15460 15461 preparer := autorest.CreatePreparer( 15462 autorest.AsPost(), 15463 autorest.WithBaseURL(client.BaseURI), 15464 autorest.WithPathParameters("/ComposeDeployments/{deploymentName}/$/Delete", pathParameters), 15465 autorest.WithQueryParameters(queryParameters)) 15466 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 15467} 15468 15469// RemoveComposeDeploymentSender sends the RemoveComposeDeployment request. The method will close the 15470// http.Response Body if it receives an error. 15471func (client BaseClient) RemoveComposeDeploymentSender(req *http.Request) (*http.Response, error) { 15472 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 15473 return autorest.SendWithSender(client, req, sd...) 15474} 15475 15476// RemoveComposeDeploymentResponder handles the response to the RemoveComposeDeployment request. The method always 15477// closes the http.Response Body. 15478func (client BaseClient) RemoveComposeDeploymentResponder(resp *http.Response) (result autorest.Response, err error) { 15479 err = autorest.Respond( 15480 resp, 15481 client.ByInspecting(), 15482 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), 15483 autorest.ByClosing()) 15484 result.Response = resp 15485 return 15486} 15487 15488// RemoveNodeState notifies Service Fabric that the persisted state on a node has been permanently removed or lost. 15489// This implies that it is not possible to recover the persisted state of that node. This generally happens if a hard 15490// disk has been wiped clean, or if a hard disk crashes. The node has to be down for this operation to be successful. 15491// This operation lets Service Fabric know that the replicas on that node no longer exist, and that Service Fabric 15492// should stop waiting for those replicas to come back up. Do not run this cmdlet if the state on the node has not been 15493// removed and the node can comes back up with its state intact. 15494// Parameters: 15495// nodeName - the name of the node. 15496// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 15497// duration that the client is willing to wait for the requested operation to complete. The default value for 15498// this parameter is 60 seconds. 15499func (client BaseClient) RemoveNodeState(ctx context.Context, nodeName string, timeout *int64) (result autorest.Response, err error) { 15500 if tracing.IsEnabled() { 15501 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.RemoveNodeState") 15502 defer func() { 15503 sc := -1 15504 if result.Response != nil { 15505 sc = result.Response.StatusCode 15506 } 15507 tracing.EndSpan(ctx, sc, err) 15508 }() 15509 } 15510 if err := validation.Validate([]validation.Validation{ 15511 {TargetValue: timeout, 15512 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 15513 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 15514 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 15515 }}}}}); err != nil { 15516 return result, validation.NewError("servicefabric.BaseClient", "RemoveNodeState", err.Error()) 15517 } 15518 15519 req, err := client.RemoveNodeStatePreparer(ctx, nodeName, timeout) 15520 if err != nil { 15521 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RemoveNodeState", nil, "Failure preparing request") 15522 return 15523 } 15524 15525 resp, err := client.RemoveNodeStateSender(req) 15526 if err != nil { 15527 result.Response = resp 15528 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RemoveNodeState", resp, "Failure sending request") 15529 return 15530 } 15531 15532 result, err = client.RemoveNodeStateResponder(resp) 15533 if err != nil { 15534 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RemoveNodeState", resp, "Failure responding to request") 15535 } 15536 15537 return 15538} 15539 15540// RemoveNodeStatePreparer prepares the RemoveNodeState request. 15541func (client BaseClient) RemoveNodeStatePreparer(ctx context.Context, nodeName string, timeout *int64) (*http.Request, error) { 15542 pathParameters := map[string]interface{}{ 15543 "nodeName": autorest.Encode("path", nodeName), 15544 } 15545 15546 const APIVersion = "6.0" 15547 queryParameters := map[string]interface{}{ 15548 "api-version": APIVersion, 15549 } 15550 if timeout != nil { 15551 queryParameters["timeout"] = autorest.Encode("query", *timeout) 15552 } else { 15553 queryParameters["timeout"] = autorest.Encode("query", 60) 15554 } 15555 15556 preparer := autorest.CreatePreparer( 15557 autorest.AsPost(), 15558 autorest.WithBaseURL(client.BaseURI), 15559 autorest.WithPathParameters("/Nodes/{nodeName}/$/RemoveNodeState", pathParameters), 15560 autorest.WithQueryParameters(queryParameters)) 15561 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 15562} 15563 15564// RemoveNodeStateSender sends the RemoveNodeState request. The method will close the 15565// http.Response Body if it receives an error. 15566func (client BaseClient) RemoveNodeStateSender(req *http.Request) (*http.Response, error) { 15567 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 15568 return autorest.SendWithSender(client, req, sd...) 15569} 15570 15571// RemoveNodeStateResponder handles the response to the RemoveNodeState request. The method always 15572// closes the http.Response Body. 15573func (client BaseClient) RemoveNodeStateResponder(resp *http.Response) (result autorest.Response, err error) { 15574 err = autorest.Respond( 15575 resp, 15576 client.ByInspecting(), 15577 azure.WithErrorUnlessStatusCode(http.StatusOK), 15578 autorest.ByClosing()) 15579 result.Response = resp 15580 return 15581} 15582 15583// RemoveReplica this API simulates a Service Fabric replica failure by removing a replica from a Service Fabric 15584// cluster. The removal closes the replica, transitions the replica to the role None, and then removes all of the state 15585// information of the replica from the cluster. This API tests the replica state removal path, and simulates the report 15586// fault permanent path through client APIs. Warning - There are no safety checks performed when this API is used. 15587// Incorrect use of this API can lead to data loss for stateful services.In addition, the forceRemove flag impacts all 15588// other replicas hosted in the same process. 15589// Parameters: 15590// nodeName - the name of the node. 15591// partitionID - the identity of the partition. 15592// replicaID - the identifier of the replica. 15593// forceRemove - remove a Service Fabric application or service forcefully without going through the graceful 15594// shutdown sequence. This parameter can be used to forcefully delete an application or service for which 15595// delete is timing out due to issues in the service code that prevents graceful close of replicas. 15596// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 15597// duration that the client is willing to wait for the requested operation to complete. The default value for 15598// this parameter is 60 seconds. 15599func (client BaseClient) RemoveReplica(ctx context.Context, nodeName string, partitionID uuid.UUID, replicaID string, forceRemove *bool, timeout *int64) (result autorest.Response, err error) { 15600 if tracing.IsEnabled() { 15601 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.RemoveReplica") 15602 defer func() { 15603 sc := -1 15604 if result.Response != nil { 15605 sc = result.Response.StatusCode 15606 } 15607 tracing.EndSpan(ctx, sc, err) 15608 }() 15609 } 15610 if err := validation.Validate([]validation.Validation{ 15611 {TargetValue: timeout, 15612 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 15613 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 15614 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 15615 }}}}}); err != nil { 15616 return result, validation.NewError("servicefabric.BaseClient", "RemoveReplica", err.Error()) 15617 } 15618 15619 req, err := client.RemoveReplicaPreparer(ctx, nodeName, partitionID, replicaID, forceRemove, timeout) 15620 if err != nil { 15621 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RemoveReplica", nil, "Failure preparing request") 15622 return 15623 } 15624 15625 resp, err := client.RemoveReplicaSender(req) 15626 if err != nil { 15627 result.Response = resp 15628 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RemoveReplica", resp, "Failure sending request") 15629 return 15630 } 15631 15632 result, err = client.RemoveReplicaResponder(resp) 15633 if err != nil { 15634 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RemoveReplica", resp, "Failure responding to request") 15635 } 15636 15637 return 15638} 15639 15640// RemoveReplicaPreparer prepares the RemoveReplica request. 15641func (client BaseClient) RemoveReplicaPreparer(ctx context.Context, nodeName string, partitionID uuid.UUID, replicaID string, forceRemove *bool, timeout *int64) (*http.Request, error) { 15642 pathParameters := map[string]interface{}{ 15643 "nodeName": autorest.Encode("path", nodeName), 15644 "partitionId": partitionID, 15645 "replicaId": replicaID, 15646 } 15647 15648 const APIVersion = "6.0" 15649 queryParameters := map[string]interface{}{ 15650 "api-version": APIVersion, 15651 } 15652 if forceRemove != nil { 15653 queryParameters["ForceRemove"] = autorest.Encode("query", *forceRemove) 15654 } 15655 if timeout != nil { 15656 queryParameters["timeout"] = autorest.Encode("query", *timeout) 15657 } else { 15658 queryParameters["timeout"] = autorest.Encode("query", 60) 15659 } 15660 15661 preparer := autorest.CreatePreparer( 15662 autorest.AsPost(), 15663 autorest.WithBaseURL(client.BaseURI), 15664 autorest.WithPathParameters("/Nodes/{nodeName}/$/GetPartitions/{partitionId}/$/GetReplicas/{replicaId}/$/Delete", pathParameters), 15665 autorest.WithQueryParameters(queryParameters)) 15666 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 15667} 15668 15669// RemoveReplicaSender sends the RemoveReplica request. The method will close the 15670// http.Response Body if it receives an error. 15671func (client BaseClient) RemoveReplicaSender(req *http.Request) (*http.Response, error) { 15672 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 15673 return autorest.SendWithSender(client, req, sd...) 15674} 15675 15676// RemoveReplicaResponder handles the response to the RemoveReplica request. The method always 15677// closes the http.Response Body. 15678func (client BaseClient) RemoveReplicaResponder(resp *http.Response) (result autorest.Response, err error) { 15679 err = autorest.Respond( 15680 resp, 15681 client.ByInspecting(), 15682 azure.WithErrorUnlessStatusCode(http.StatusOK), 15683 autorest.ByClosing()) 15684 result.Response = resp 15685 return 15686} 15687 15688// ReportApplicationHealth reports health state of the specified Service Fabric application. The report must contain 15689// the information about the source of the health report and property on which it is reported. 15690// The report is sent to a Service Fabric gateway Application, which forwards to the health store. 15691// The report may be accepted by the gateway, but rejected by the health store after extra validation. 15692// For example, the health store may reject the report because of an invalid parameter, like a stale sequence number. 15693// To see whether the report was applied in the health store, get application health and check that the report appears 15694// in the HealthEvents section. 15695// Parameters: 15696// applicationID - the identity of the application. This is typically the full name of the application without 15697// the 'fabric:' URI scheme. 15698// Starting from version 6.0, hierarchical names are delimited with the "~" character. 15699// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" 15700// in 6.0+ and "myapp/app1" in previous versions. 15701// healthInformation - describes the health information for the health report. This information needs to be 15702// present in all of the health reports sent to the health manager. 15703// immediate - a flag which indicates whether the report should be sent immediately. 15704// A health report is sent to a Service Fabric gateway Application, which forwards to the health store. 15705// If Immediate is set to true, the report is sent immediately from HTTP Gateway to the health store, 15706// regardless of the fabric client settings that the HTTP Gateway Application is using. 15707// This is useful for critical reports that should be sent as soon as possible. 15708// Depending on timing and other conditions, sending the report may still fail, for example if the HTTP Gateway 15709// is closed or the message doesn't reach the Gateway. 15710// If Immediate is set to false, the report is sent based on the health client settings from the HTTP Gateway. 15711// Therefore, it will be batched according to the HealthReportSendInterval configuration. 15712// This is the recommended setting because it allows the health client to optimize health reporting messages to 15713// health store as well as health report processing. 15714// By default, reports are not sent immediately. 15715// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 15716// duration that the client is willing to wait for the requested operation to complete. The default value for 15717// this parameter is 60 seconds. 15718func (client BaseClient) ReportApplicationHealth(ctx context.Context, applicationID string, healthInformation HealthInformation, immediate *bool, timeout *int64) (result autorest.Response, err error) { 15719 if tracing.IsEnabled() { 15720 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ReportApplicationHealth") 15721 defer func() { 15722 sc := -1 15723 if result.Response != nil { 15724 sc = result.Response.StatusCode 15725 } 15726 tracing.EndSpan(ctx, sc, err) 15727 }() 15728 } 15729 if err := validation.Validate([]validation.Validation{ 15730 {TargetValue: healthInformation, 15731 Constraints: []validation.Constraint{{Target: "healthInformation.SourceID", Name: validation.Null, Rule: true, Chain: nil}, 15732 {Target: "healthInformation.Property", Name: validation.Null, Rule: true, Chain: nil}}}, 15733 {TargetValue: timeout, 15734 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 15735 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 15736 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 15737 }}}}}); err != nil { 15738 return result, validation.NewError("servicefabric.BaseClient", "ReportApplicationHealth", err.Error()) 15739 } 15740 15741 req, err := client.ReportApplicationHealthPreparer(ctx, applicationID, healthInformation, immediate, timeout) 15742 if err != nil { 15743 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ReportApplicationHealth", nil, "Failure preparing request") 15744 return 15745 } 15746 15747 resp, err := client.ReportApplicationHealthSender(req) 15748 if err != nil { 15749 result.Response = resp 15750 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ReportApplicationHealth", resp, "Failure sending request") 15751 return 15752 } 15753 15754 result, err = client.ReportApplicationHealthResponder(resp) 15755 if err != nil { 15756 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ReportApplicationHealth", resp, "Failure responding to request") 15757 } 15758 15759 return 15760} 15761 15762// ReportApplicationHealthPreparer prepares the ReportApplicationHealth request. 15763func (client BaseClient) ReportApplicationHealthPreparer(ctx context.Context, applicationID string, healthInformation HealthInformation, immediate *bool, timeout *int64) (*http.Request, error) { 15764 pathParameters := map[string]interface{}{ 15765 "applicationId": applicationID, 15766 } 15767 15768 const APIVersion = "6.0" 15769 queryParameters := map[string]interface{}{ 15770 "api-version": APIVersion, 15771 } 15772 if immediate != nil { 15773 queryParameters["Immediate"] = autorest.Encode("query", *immediate) 15774 } else { 15775 queryParameters["Immediate"] = autorest.Encode("query", false) 15776 } 15777 if timeout != nil { 15778 queryParameters["timeout"] = autorest.Encode("query", *timeout) 15779 } else { 15780 queryParameters["timeout"] = autorest.Encode("query", 60) 15781 } 15782 15783 preparer := autorest.CreatePreparer( 15784 autorest.AsContentType("application/json; charset=utf-8"), 15785 autorest.AsPost(), 15786 autorest.WithBaseURL(client.BaseURI), 15787 autorest.WithPathParameters("/Applications/{applicationId}/$/ReportHealth", pathParameters), 15788 autorest.WithJSON(healthInformation), 15789 autorest.WithQueryParameters(queryParameters)) 15790 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 15791} 15792 15793// ReportApplicationHealthSender sends the ReportApplicationHealth request. The method will close the 15794// http.Response Body if it receives an error. 15795func (client BaseClient) ReportApplicationHealthSender(req *http.Request) (*http.Response, error) { 15796 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 15797 return autorest.SendWithSender(client, req, sd...) 15798} 15799 15800// ReportApplicationHealthResponder handles the response to the ReportApplicationHealth request. The method always 15801// closes the http.Response Body. 15802func (client BaseClient) ReportApplicationHealthResponder(resp *http.Response) (result autorest.Response, err error) { 15803 err = autorest.Respond( 15804 resp, 15805 client.ByInspecting(), 15806 azure.WithErrorUnlessStatusCode(http.StatusOK), 15807 autorest.ByClosing()) 15808 result.Response = resp 15809 return 15810} 15811 15812// ReportClusterHealth sends a health report on a Service Fabric cluster. The report must contain the information about 15813// the source of the health report and property on which it is reported. 15814// The report is sent to a Service Fabric gateway node, which forwards to the health store. 15815// The report may be accepted by the gateway, but rejected by the health store after extra validation. 15816// For example, the health store may reject the report because of an invalid parameter, like a stale sequence number. 15817// To see whether the report was applied in the health store, run GetClusterHealth and check that the report appears in 15818// the HealthEvents section. 15819// Parameters: 15820// healthInformation - describes the health information for the health report. This information needs to be 15821// present in all of the health reports sent to the health manager. 15822// immediate - a flag which indicates whether the report should be sent immediately. 15823// A health report is sent to a Service Fabric gateway Application, which forwards to the health store. 15824// If Immediate is set to true, the report is sent immediately from HTTP Gateway to the health store, 15825// regardless of the fabric client settings that the HTTP Gateway Application is using. 15826// This is useful for critical reports that should be sent as soon as possible. 15827// Depending on timing and other conditions, sending the report may still fail, for example if the HTTP Gateway 15828// is closed or the message doesn't reach the Gateway. 15829// If Immediate is set to false, the report is sent based on the health client settings from the HTTP Gateway. 15830// Therefore, it will be batched according to the HealthReportSendInterval configuration. 15831// This is the recommended setting because it allows the health client to optimize health reporting messages to 15832// health store as well as health report processing. 15833// By default, reports are not sent immediately. 15834// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 15835// duration that the client is willing to wait for the requested operation to complete. The default value for 15836// this parameter is 60 seconds. 15837func (client BaseClient) ReportClusterHealth(ctx context.Context, healthInformation HealthInformation, immediate *bool, timeout *int64) (result autorest.Response, err error) { 15838 if tracing.IsEnabled() { 15839 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ReportClusterHealth") 15840 defer func() { 15841 sc := -1 15842 if result.Response != nil { 15843 sc = result.Response.StatusCode 15844 } 15845 tracing.EndSpan(ctx, sc, err) 15846 }() 15847 } 15848 if err := validation.Validate([]validation.Validation{ 15849 {TargetValue: healthInformation, 15850 Constraints: []validation.Constraint{{Target: "healthInformation.SourceID", Name: validation.Null, Rule: true, Chain: nil}, 15851 {Target: "healthInformation.Property", Name: validation.Null, Rule: true, Chain: nil}}}, 15852 {TargetValue: timeout, 15853 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 15854 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 15855 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 15856 }}}}}); err != nil { 15857 return result, validation.NewError("servicefabric.BaseClient", "ReportClusterHealth", err.Error()) 15858 } 15859 15860 req, err := client.ReportClusterHealthPreparer(ctx, healthInformation, immediate, timeout) 15861 if err != nil { 15862 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ReportClusterHealth", nil, "Failure preparing request") 15863 return 15864 } 15865 15866 resp, err := client.ReportClusterHealthSender(req) 15867 if err != nil { 15868 result.Response = resp 15869 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ReportClusterHealth", resp, "Failure sending request") 15870 return 15871 } 15872 15873 result, err = client.ReportClusterHealthResponder(resp) 15874 if err != nil { 15875 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ReportClusterHealth", resp, "Failure responding to request") 15876 } 15877 15878 return 15879} 15880 15881// ReportClusterHealthPreparer prepares the ReportClusterHealth request. 15882func (client BaseClient) ReportClusterHealthPreparer(ctx context.Context, healthInformation HealthInformation, immediate *bool, timeout *int64) (*http.Request, error) { 15883 const APIVersion = "6.0" 15884 queryParameters := map[string]interface{}{ 15885 "api-version": APIVersion, 15886 } 15887 if immediate != nil { 15888 queryParameters["Immediate"] = autorest.Encode("query", *immediate) 15889 } else { 15890 queryParameters["Immediate"] = autorest.Encode("query", false) 15891 } 15892 if timeout != nil { 15893 queryParameters["timeout"] = autorest.Encode("query", *timeout) 15894 } else { 15895 queryParameters["timeout"] = autorest.Encode("query", 60) 15896 } 15897 15898 preparer := autorest.CreatePreparer( 15899 autorest.AsContentType("application/json; charset=utf-8"), 15900 autorest.AsPost(), 15901 autorest.WithBaseURL(client.BaseURI), 15902 autorest.WithPath("/$/ReportClusterHealth"), 15903 autorest.WithJSON(healthInformation), 15904 autorest.WithQueryParameters(queryParameters)) 15905 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 15906} 15907 15908// ReportClusterHealthSender sends the ReportClusterHealth request. The method will close the 15909// http.Response Body if it receives an error. 15910func (client BaseClient) ReportClusterHealthSender(req *http.Request) (*http.Response, error) { 15911 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 15912 return autorest.SendWithSender(client, req, sd...) 15913} 15914 15915// ReportClusterHealthResponder handles the response to the ReportClusterHealth request. The method always 15916// closes the http.Response Body. 15917func (client BaseClient) ReportClusterHealthResponder(resp *http.Response) (result autorest.Response, err error) { 15918 err = autorest.Respond( 15919 resp, 15920 client.ByInspecting(), 15921 azure.WithErrorUnlessStatusCode(http.StatusOK), 15922 autorest.ByClosing()) 15923 result.Response = resp 15924 return 15925} 15926 15927// ReportDeployedApplicationHealth reports health state of the application deployed on a Service Fabric node. The 15928// report must contain the information about the source of the health report and property on which it is reported. 15929// The report is sent to a Service Fabric gateway Service, which forwards to the health store. 15930// The report may be accepted by the gateway, but rejected by the health store after extra validation. 15931// For example, the health store may reject the report because of an invalid parameter, like a stale sequence number. 15932// To see whether the report was applied in the health store, get deployed application health and check that the report 15933// appears in the HealthEvents section. 15934// Parameters: 15935// nodeName - the name of the node. 15936// applicationID - the identity of the application. This is typically the full name of the application without 15937// the 'fabric:' URI scheme. 15938// Starting from version 6.0, hierarchical names are delimited with the "~" character. 15939// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" 15940// in 6.0+ and "myapp/app1" in previous versions. 15941// healthInformation - describes the health information for the health report. This information needs to be 15942// present in all of the health reports sent to the health manager. 15943// immediate - a flag which indicates whether the report should be sent immediately. 15944// A health report is sent to a Service Fabric gateway Application, which forwards to the health store. 15945// If Immediate is set to true, the report is sent immediately from HTTP Gateway to the health store, 15946// regardless of the fabric client settings that the HTTP Gateway Application is using. 15947// This is useful for critical reports that should be sent as soon as possible. 15948// Depending on timing and other conditions, sending the report may still fail, for example if the HTTP Gateway 15949// is closed or the message doesn't reach the Gateway. 15950// If Immediate is set to false, the report is sent based on the health client settings from the HTTP Gateway. 15951// Therefore, it will be batched according to the HealthReportSendInterval configuration. 15952// This is the recommended setting because it allows the health client to optimize health reporting messages to 15953// health store as well as health report processing. 15954// By default, reports are not sent immediately. 15955// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 15956// duration that the client is willing to wait for the requested operation to complete. The default value for 15957// this parameter is 60 seconds. 15958func (client BaseClient) ReportDeployedApplicationHealth(ctx context.Context, nodeName string, applicationID string, healthInformation HealthInformation, immediate *bool, timeout *int64) (result autorest.Response, err error) { 15959 if tracing.IsEnabled() { 15960 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ReportDeployedApplicationHealth") 15961 defer func() { 15962 sc := -1 15963 if result.Response != nil { 15964 sc = result.Response.StatusCode 15965 } 15966 tracing.EndSpan(ctx, sc, err) 15967 }() 15968 } 15969 if err := validation.Validate([]validation.Validation{ 15970 {TargetValue: healthInformation, 15971 Constraints: []validation.Constraint{{Target: "healthInformation.SourceID", Name: validation.Null, Rule: true, Chain: nil}, 15972 {Target: "healthInformation.Property", Name: validation.Null, Rule: true, Chain: nil}}}, 15973 {TargetValue: timeout, 15974 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 15975 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 15976 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 15977 }}}}}); err != nil { 15978 return result, validation.NewError("servicefabric.BaseClient", "ReportDeployedApplicationHealth", err.Error()) 15979 } 15980 15981 req, err := client.ReportDeployedApplicationHealthPreparer(ctx, nodeName, applicationID, healthInformation, immediate, timeout) 15982 if err != nil { 15983 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ReportDeployedApplicationHealth", nil, "Failure preparing request") 15984 return 15985 } 15986 15987 resp, err := client.ReportDeployedApplicationHealthSender(req) 15988 if err != nil { 15989 result.Response = resp 15990 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ReportDeployedApplicationHealth", resp, "Failure sending request") 15991 return 15992 } 15993 15994 result, err = client.ReportDeployedApplicationHealthResponder(resp) 15995 if err != nil { 15996 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ReportDeployedApplicationHealth", resp, "Failure responding to request") 15997 } 15998 15999 return 16000} 16001 16002// ReportDeployedApplicationHealthPreparer prepares the ReportDeployedApplicationHealth request. 16003func (client BaseClient) ReportDeployedApplicationHealthPreparer(ctx context.Context, nodeName string, applicationID string, healthInformation HealthInformation, immediate *bool, timeout *int64) (*http.Request, error) { 16004 pathParameters := map[string]interface{}{ 16005 "applicationId": applicationID, 16006 "nodeName": autorest.Encode("path", nodeName), 16007 } 16008 16009 const APIVersion = "6.0" 16010 queryParameters := map[string]interface{}{ 16011 "api-version": APIVersion, 16012 } 16013 if immediate != nil { 16014 queryParameters["Immediate"] = autorest.Encode("query", *immediate) 16015 } else { 16016 queryParameters["Immediate"] = autorest.Encode("query", false) 16017 } 16018 if timeout != nil { 16019 queryParameters["timeout"] = autorest.Encode("query", *timeout) 16020 } else { 16021 queryParameters["timeout"] = autorest.Encode("query", 60) 16022 } 16023 16024 preparer := autorest.CreatePreparer( 16025 autorest.AsContentType("application/json; charset=utf-8"), 16026 autorest.AsPost(), 16027 autorest.WithBaseURL(client.BaseURI), 16028 autorest.WithPathParameters("/Nodes/{nodeName}/$/GetApplications/{applicationId}/$/ReportHealth", pathParameters), 16029 autorest.WithJSON(healthInformation), 16030 autorest.WithQueryParameters(queryParameters)) 16031 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 16032} 16033 16034// ReportDeployedApplicationHealthSender sends the ReportDeployedApplicationHealth request. The method will close the 16035// http.Response Body if it receives an error. 16036func (client BaseClient) ReportDeployedApplicationHealthSender(req *http.Request) (*http.Response, error) { 16037 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 16038 return autorest.SendWithSender(client, req, sd...) 16039} 16040 16041// ReportDeployedApplicationHealthResponder handles the response to the ReportDeployedApplicationHealth request. The method always 16042// closes the http.Response Body. 16043func (client BaseClient) ReportDeployedApplicationHealthResponder(resp *http.Response) (result autorest.Response, err error) { 16044 err = autorest.Respond( 16045 resp, 16046 client.ByInspecting(), 16047 azure.WithErrorUnlessStatusCode(http.StatusOK), 16048 autorest.ByClosing()) 16049 result.Response = resp 16050 return 16051} 16052 16053// ReportDeployedServicePackageHealth reports health state of the service package of the application deployed on a 16054// Service Fabric node. The report must contain the information about the source of the health report and property on 16055// which it is reported. 16056// The report is sent to a Service Fabric gateway Service, which forwards to the health store. 16057// The report may be accepted by the gateway, but rejected by the health store after extra validation. 16058// For example, the health store may reject the report because of an invalid parameter, like a stale sequence number. 16059// To see whether the report was applied in the health store, get deployed service package health and check that the 16060// report appears in the HealthEvents section. 16061// Parameters: 16062// nodeName - the name of the node. 16063// applicationID - the identity of the application. This is typically the full name of the application without 16064// the 'fabric:' URI scheme. 16065// Starting from version 6.0, hierarchical names are delimited with the "~" character. 16066// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" 16067// in 6.0+ and "myapp/app1" in previous versions. 16068// servicePackageName - the name of the service package. 16069// healthInformation - describes the health information for the health report. This information needs to be 16070// present in all of the health reports sent to the health manager. 16071// immediate - a flag which indicates whether the report should be sent immediately. 16072// A health report is sent to a Service Fabric gateway Application, which forwards to the health store. 16073// If Immediate is set to true, the report is sent immediately from HTTP Gateway to the health store, 16074// regardless of the fabric client settings that the HTTP Gateway Application is using. 16075// This is useful for critical reports that should be sent as soon as possible. 16076// Depending on timing and other conditions, sending the report may still fail, for example if the HTTP Gateway 16077// is closed or the message doesn't reach the Gateway. 16078// If Immediate is set to false, the report is sent based on the health client settings from the HTTP Gateway. 16079// Therefore, it will be batched according to the HealthReportSendInterval configuration. 16080// This is the recommended setting because it allows the health client to optimize health reporting messages to 16081// health store as well as health report processing. 16082// By default, reports are not sent immediately. 16083// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 16084// duration that the client is willing to wait for the requested operation to complete. The default value for 16085// this parameter is 60 seconds. 16086func (client BaseClient) ReportDeployedServicePackageHealth(ctx context.Context, nodeName string, applicationID string, servicePackageName string, healthInformation HealthInformation, immediate *bool, timeout *int64) (result autorest.Response, err error) { 16087 if tracing.IsEnabled() { 16088 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ReportDeployedServicePackageHealth") 16089 defer func() { 16090 sc := -1 16091 if result.Response != nil { 16092 sc = result.Response.StatusCode 16093 } 16094 tracing.EndSpan(ctx, sc, err) 16095 }() 16096 } 16097 if err := validation.Validate([]validation.Validation{ 16098 {TargetValue: healthInformation, 16099 Constraints: []validation.Constraint{{Target: "healthInformation.SourceID", Name: validation.Null, Rule: true, Chain: nil}, 16100 {Target: "healthInformation.Property", Name: validation.Null, Rule: true, Chain: nil}}}, 16101 {TargetValue: timeout, 16102 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 16103 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 16104 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 16105 }}}}}); err != nil { 16106 return result, validation.NewError("servicefabric.BaseClient", "ReportDeployedServicePackageHealth", err.Error()) 16107 } 16108 16109 req, err := client.ReportDeployedServicePackageHealthPreparer(ctx, nodeName, applicationID, servicePackageName, healthInformation, immediate, timeout) 16110 if err != nil { 16111 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ReportDeployedServicePackageHealth", nil, "Failure preparing request") 16112 return 16113 } 16114 16115 resp, err := client.ReportDeployedServicePackageHealthSender(req) 16116 if err != nil { 16117 result.Response = resp 16118 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ReportDeployedServicePackageHealth", resp, "Failure sending request") 16119 return 16120 } 16121 16122 result, err = client.ReportDeployedServicePackageHealthResponder(resp) 16123 if err != nil { 16124 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ReportDeployedServicePackageHealth", resp, "Failure responding to request") 16125 } 16126 16127 return 16128} 16129 16130// ReportDeployedServicePackageHealthPreparer prepares the ReportDeployedServicePackageHealth request. 16131func (client BaseClient) ReportDeployedServicePackageHealthPreparer(ctx context.Context, nodeName string, applicationID string, servicePackageName string, healthInformation HealthInformation, immediate *bool, timeout *int64) (*http.Request, error) { 16132 pathParameters := map[string]interface{}{ 16133 "applicationId": applicationID, 16134 "nodeName": autorest.Encode("path", nodeName), 16135 "servicePackageName": servicePackageName, 16136 } 16137 16138 const APIVersion = "6.0" 16139 queryParameters := map[string]interface{}{ 16140 "api-version": APIVersion, 16141 } 16142 if immediate != nil { 16143 queryParameters["Immediate"] = autorest.Encode("query", *immediate) 16144 } else { 16145 queryParameters["Immediate"] = autorest.Encode("query", false) 16146 } 16147 if timeout != nil { 16148 queryParameters["timeout"] = autorest.Encode("query", *timeout) 16149 } else { 16150 queryParameters["timeout"] = autorest.Encode("query", 60) 16151 } 16152 16153 preparer := autorest.CreatePreparer( 16154 autorest.AsContentType("application/json; charset=utf-8"), 16155 autorest.AsPost(), 16156 autorest.WithBaseURL(client.BaseURI), 16157 autorest.WithPathParameters("/Nodes/{nodeName}/$/GetApplications/{applicationId}/$/GetServicePackages/{servicePackageName}/$/ReportHealth", pathParameters), 16158 autorest.WithJSON(healthInformation), 16159 autorest.WithQueryParameters(queryParameters)) 16160 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 16161} 16162 16163// ReportDeployedServicePackageHealthSender sends the ReportDeployedServicePackageHealth request. The method will close the 16164// http.Response Body if it receives an error. 16165func (client BaseClient) ReportDeployedServicePackageHealthSender(req *http.Request) (*http.Response, error) { 16166 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 16167 return autorest.SendWithSender(client, req, sd...) 16168} 16169 16170// ReportDeployedServicePackageHealthResponder handles the response to the ReportDeployedServicePackageHealth request. The method always 16171// closes the http.Response Body. 16172func (client BaseClient) ReportDeployedServicePackageHealthResponder(resp *http.Response) (result autorest.Response, err error) { 16173 err = autorest.Respond( 16174 resp, 16175 client.ByInspecting(), 16176 azure.WithErrorUnlessStatusCode(http.StatusOK), 16177 autorest.ByClosing()) 16178 result.Response = resp 16179 return 16180} 16181 16182// ReportNodeHealth reports health state of the specified Service Fabric node. The report must contain the information 16183// about the source of the health report and property on which it is reported. 16184// The report is sent to a Service Fabric gateway node, which forwards to the health store. 16185// The report may be accepted by the gateway, but rejected by the health store after extra validation. 16186// For example, the health store may reject the report because of an invalid parameter, like a stale sequence number. 16187// To see whether the report was applied in the health store, run GetNodeHealth and check that the report appears in 16188// the HealthEvents section. 16189// Parameters: 16190// nodeName - the name of the node. 16191// healthInformation - describes the health information for the health report. This information needs to be 16192// present in all of the health reports sent to the health manager. 16193// immediate - a flag which indicates whether the report should be sent immediately. 16194// A health report is sent to a Service Fabric gateway Application, which forwards to the health store. 16195// If Immediate is set to true, the report is sent immediately from HTTP Gateway to the health store, 16196// regardless of the fabric client settings that the HTTP Gateway Application is using. 16197// This is useful for critical reports that should be sent as soon as possible. 16198// Depending on timing and other conditions, sending the report may still fail, for example if the HTTP Gateway 16199// is closed or the message doesn't reach the Gateway. 16200// If Immediate is set to false, the report is sent based on the health client settings from the HTTP Gateway. 16201// Therefore, it will be batched according to the HealthReportSendInterval configuration. 16202// This is the recommended setting because it allows the health client to optimize health reporting messages to 16203// health store as well as health report processing. 16204// By default, reports are not sent immediately. 16205// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 16206// duration that the client is willing to wait for the requested operation to complete. The default value for 16207// this parameter is 60 seconds. 16208func (client BaseClient) ReportNodeHealth(ctx context.Context, nodeName string, healthInformation HealthInformation, immediate *bool, timeout *int64) (result autorest.Response, err error) { 16209 if tracing.IsEnabled() { 16210 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ReportNodeHealth") 16211 defer func() { 16212 sc := -1 16213 if result.Response != nil { 16214 sc = result.Response.StatusCode 16215 } 16216 tracing.EndSpan(ctx, sc, err) 16217 }() 16218 } 16219 if err := validation.Validate([]validation.Validation{ 16220 {TargetValue: healthInformation, 16221 Constraints: []validation.Constraint{{Target: "healthInformation.SourceID", Name: validation.Null, Rule: true, Chain: nil}, 16222 {Target: "healthInformation.Property", Name: validation.Null, Rule: true, Chain: nil}}}, 16223 {TargetValue: timeout, 16224 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 16225 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 16226 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 16227 }}}}}); err != nil { 16228 return result, validation.NewError("servicefabric.BaseClient", "ReportNodeHealth", err.Error()) 16229 } 16230 16231 req, err := client.ReportNodeHealthPreparer(ctx, nodeName, healthInformation, immediate, timeout) 16232 if err != nil { 16233 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ReportNodeHealth", nil, "Failure preparing request") 16234 return 16235 } 16236 16237 resp, err := client.ReportNodeHealthSender(req) 16238 if err != nil { 16239 result.Response = resp 16240 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ReportNodeHealth", resp, "Failure sending request") 16241 return 16242 } 16243 16244 result, err = client.ReportNodeHealthResponder(resp) 16245 if err != nil { 16246 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ReportNodeHealth", resp, "Failure responding to request") 16247 } 16248 16249 return 16250} 16251 16252// ReportNodeHealthPreparer prepares the ReportNodeHealth request. 16253func (client BaseClient) ReportNodeHealthPreparer(ctx context.Context, nodeName string, healthInformation HealthInformation, immediate *bool, timeout *int64) (*http.Request, error) { 16254 pathParameters := map[string]interface{}{ 16255 "nodeName": autorest.Encode("path", nodeName), 16256 } 16257 16258 const APIVersion = "6.0" 16259 queryParameters := map[string]interface{}{ 16260 "api-version": APIVersion, 16261 } 16262 if immediate != nil { 16263 queryParameters["Immediate"] = autorest.Encode("query", *immediate) 16264 } else { 16265 queryParameters["Immediate"] = autorest.Encode("query", false) 16266 } 16267 if timeout != nil { 16268 queryParameters["timeout"] = autorest.Encode("query", *timeout) 16269 } else { 16270 queryParameters["timeout"] = autorest.Encode("query", 60) 16271 } 16272 16273 preparer := autorest.CreatePreparer( 16274 autorest.AsContentType("application/json; charset=utf-8"), 16275 autorest.AsPost(), 16276 autorest.WithBaseURL(client.BaseURI), 16277 autorest.WithPathParameters("/Nodes/{nodeName}/$/ReportHealth", pathParameters), 16278 autorest.WithJSON(healthInformation), 16279 autorest.WithQueryParameters(queryParameters)) 16280 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 16281} 16282 16283// ReportNodeHealthSender sends the ReportNodeHealth request. The method will close the 16284// http.Response Body if it receives an error. 16285func (client BaseClient) ReportNodeHealthSender(req *http.Request) (*http.Response, error) { 16286 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 16287 return autorest.SendWithSender(client, req, sd...) 16288} 16289 16290// ReportNodeHealthResponder handles the response to the ReportNodeHealth request. The method always 16291// closes the http.Response Body. 16292func (client BaseClient) ReportNodeHealthResponder(resp *http.Response) (result autorest.Response, err error) { 16293 err = autorest.Respond( 16294 resp, 16295 client.ByInspecting(), 16296 azure.WithErrorUnlessStatusCode(http.StatusOK), 16297 autorest.ByClosing()) 16298 result.Response = resp 16299 return 16300} 16301 16302// ReportPartitionHealth reports health state of the specified Service Fabric partition. The report must contain the 16303// information about the source of the health report and property on which it is reported. 16304// The report is sent to a Service Fabric gateway Partition, which forwards to the health store. 16305// The report may be accepted by the gateway, but rejected by the health store after extra validation. 16306// For example, the health store may reject the report because of an invalid parameter, like a stale sequence number. 16307// To see whether the report was applied in the health store, run GetPartitionHealth and check that the report appears 16308// in the HealthEvents section. 16309// Parameters: 16310// partitionID - the identity of the partition. 16311// healthInformation - describes the health information for the health report. This information needs to be 16312// present in all of the health reports sent to the health manager. 16313// immediate - a flag which indicates whether the report should be sent immediately. 16314// A health report is sent to a Service Fabric gateway Application, which forwards to the health store. 16315// If Immediate is set to true, the report is sent immediately from HTTP Gateway to the health store, 16316// regardless of the fabric client settings that the HTTP Gateway Application is using. 16317// This is useful for critical reports that should be sent as soon as possible. 16318// Depending on timing and other conditions, sending the report may still fail, for example if the HTTP Gateway 16319// is closed or the message doesn't reach the Gateway. 16320// If Immediate is set to false, the report is sent based on the health client settings from the HTTP Gateway. 16321// Therefore, it will be batched according to the HealthReportSendInterval configuration. 16322// This is the recommended setting because it allows the health client to optimize health reporting messages to 16323// health store as well as health report processing. 16324// By default, reports are not sent immediately. 16325// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 16326// duration that the client is willing to wait for the requested operation to complete. The default value for 16327// this parameter is 60 seconds. 16328func (client BaseClient) ReportPartitionHealth(ctx context.Context, partitionID uuid.UUID, healthInformation HealthInformation, immediate *bool, timeout *int64) (result autorest.Response, err error) { 16329 if tracing.IsEnabled() { 16330 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ReportPartitionHealth") 16331 defer func() { 16332 sc := -1 16333 if result.Response != nil { 16334 sc = result.Response.StatusCode 16335 } 16336 tracing.EndSpan(ctx, sc, err) 16337 }() 16338 } 16339 if err := validation.Validate([]validation.Validation{ 16340 {TargetValue: healthInformation, 16341 Constraints: []validation.Constraint{{Target: "healthInformation.SourceID", Name: validation.Null, Rule: true, Chain: nil}, 16342 {Target: "healthInformation.Property", Name: validation.Null, Rule: true, Chain: nil}}}, 16343 {TargetValue: timeout, 16344 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 16345 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 16346 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 16347 }}}}}); err != nil { 16348 return result, validation.NewError("servicefabric.BaseClient", "ReportPartitionHealth", err.Error()) 16349 } 16350 16351 req, err := client.ReportPartitionHealthPreparer(ctx, partitionID, healthInformation, immediate, timeout) 16352 if err != nil { 16353 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ReportPartitionHealth", nil, "Failure preparing request") 16354 return 16355 } 16356 16357 resp, err := client.ReportPartitionHealthSender(req) 16358 if err != nil { 16359 result.Response = resp 16360 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ReportPartitionHealth", resp, "Failure sending request") 16361 return 16362 } 16363 16364 result, err = client.ReportPartitionHealthResponder(resp) 16365 if err != nil { 16366 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ReportPartitionHealth", resp, "Failure responding to request") 16367 } 16368 16369 return 16370} 16371 16372// ReportPartitionHealthPreparer prepares the ReportPartitionHealth request. 16373func (client BaseClient) ReportPartitionHealthPreparer(ctx context.Context, partitionID uuid.UUID, healthInformation HealthInformation, immediate *bool, timeout *int64) (*http.Request, error) { 16374 pathParameters := map[string]interface{}{ 16375 "partitionId": partitionID, 16376 } 16377 16378 const APIVersion = "6.0" 16379 queryParameters := map[string]interface{}{ 16380 "api-version": APIVersion, 16381 } 16382 if immediate != nil { 16383 queryParameters["Immediate"] = autorest.Encode("query", *immediate) 16384 } else { 16385 queryParameters["Immediate"] = autorest.Encode("query", false) 16386 } 16387 if timeout != nil { 16388 queryParameters["timeout"] = autorest.Encode("query", *timeout) 16389 } else { 16390 queryParameters["timeout"] = autorest.Encode("query", 60) 16391 } 16392 16393 preparer := autorest.CreatePreparer( 16394 autorest.AsContentType("application/json; charset=utf-8"), 16395 autorest.AsPost(), 16396 autorest.WithBaseURL(client.BaseURI), 16397 autorest.WithPathParameters("/Partitions/{partitionId}/$/ReportHealth", pathParameters), 16398 autorest.WithJSON(healthInformation), 16399 autorest.WithQueryParameters(queryParameters)) 16400 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 16401} 16402 16403// ReportPartitionHealthSender sends the ReportPartitionHealth request. The method will close the 16404// http.Response Body if it receives an error. 16405func (client BaseClient) ReportPartitionHealthSender(req *http.Request) (*http.Response, error) { 16406 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 16407 return autorest.SendWithSender(client, req, sd...) 16408} 16409 16410// ReportPartitionHealthResponder handles the response to the ReportPartitionHealth request. The method always 16411// closes the http.Response Body. 16412func (client BaseClient) ReportPartitionHealthResponder(resp *http.Response) (result autorest.Response, err error) { 16413 err = autorest.Respond( 16414 resp, 16415 client.ByInspecting(), 16416 azure.WithErrorUnlessStatusCode(http.StatusOK), 16417 autorest.ByClosing()) 16418 result.Response = resp 16419 return 16420} 16421 16422// ReportReplicaHealth reports health state of the specified Service Fabric replica. The report must contain the 16423// information about the source of the health report and property on which it is reported. 16424// The report is sent to a Service Fabric gateway Replica, which forwards to the health store. 16425// The report may be accepted by the gateway, but rejected by the health store after extra validation. 16426// For example, the health store may reject the report because of an invalid parameter, like a stale sequence number. 16427// To see whether the report was applied in the health store, run GetReplicaHealth and check that the report appears in 16428// the HealthEvents section. 16429// Parameters: 16430// partitionID - the identity of the partition. 16431// replicaID - the identifier of the replica. 16432// replicaHealthReportServiceKind - the kind of service replica (Stateless or Stateful) for which the health is 16433// being reported. Following are the possible values. 16434// healthInformation - describes the health information for the health report. This information needs to be 16435// present in all of the health reports sent to the health manager. 16436// immediate - a flag which indicates whether the report should be sent immediately. 16437// A health report is sent to a Service Fabric gateway Application, which forwards to the health store. 16438// If Immediate is set to true, the report is sent immediately from HTTP Gateway to the health store, 16439// regardless of the fabric client settings that the HTTP Gateway Application is using. 16440// This is useful for critical reports that should be sent as soon as possible. 16441// Depending on timing and other conditions, sending the report may still fail, for example if the HTTP Gateway 16442// is closed or the message doesn't reach the Gateway. 16443// If Immediate is set to false, the report is sent based on the health client settings from the HTTP Gateway. 16444// Therefore, it will be batched according to the HealthReportSendInterval configuration. 16445// This is the recommended setting because it allows the health client to optimize health reporting messages to 16446// health store as well as health report processing. 16447// By default, reports are not sent immediately. 16448// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 16449// duration that the client is willing to wait for the requested operation to complete. The default value for 16450// this parameter is 60 seconds. 16451func (client BaseClient) ReportReplicaHealth(ctx context.Context, partitionID uuid.UUID, replicaID string, replicaHealthReportServiceKind ReplicaHealthReportServiceKind, healthInformation HealthInformation, immediate *bool, timeout *int64) (result autorest.Response, err error) { 16452 if tracing.IsEnabled() { 16453 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ReportReplicaHealth") 16454 defer func() { 16455 sc := -1 16456 if result.Response != nil { 16457 sc = result.Response.StatusCode 16458 } 16459 tracing.EndSpan(ctx, sc, err) 16460 }() 16461 } 16462 if err := validation.Validate([]validation.Validation{ 16463 {TargetValue: healthInformation, 16464 Constraints: []validation.Constraint{{Target: "healthInformation.SourceID", Name: validation.Null, Rule: true, Chain: nil}, 16465 {Target: "healthInformation.Property", Name: validation.Null, Rule: true, Chain: nil}}}, 16466 {TargetValue: timeout, 16467 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 16468 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 16469 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 16470 }}}}}); err != nil { 16471 return result, validation.NewError("servicefabric.BaseClient", "ReportReplicaHealth", err.Error()) 16472 } 16473 16474 req, err := client.ReportReplicaHealthPreparer(ctx, partitionID, replicaID, replicaHealthReportServiceKind, healthInformation, immediate, timeout) 16475 if err != nil { 16476 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ReportReplicaHealth", nil, "Failure preparing request") 16477 return 16478 } 16479 16480 resp, err := client.ReportReplicaHealthSender(req) 16481 if err != nil { 16482 result.Response = resp 16483 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ReportReplicaHealth", resp, "Failure sending request") 16484 return 16485 } 16486 16487 result, err = client.ReportReplicaHealthResponder(resp) 16488 if err != nil { 16489 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ReportReplicaHealth", resp, "Failure responding to request") 16490 } 16491 16492 return 16493} 16494 16495// ReportReplicaHealthPreparer prepares the ReportReplicaHealth request. 16496func (client BaseClient) ReportReplicaHealthPreparer(ctx context.Context, partitionID uuid.UUID, replicaID string, replicaHealthReportServiceKind ReplicaHealthReportServiceKind, healthInformation HealthInformation, immediate *bool, timeout *int64) (*http.Request, error) { 16497 pathParameters := map[string]interface{}{ 16498 "partitionId": partitionID, 16499 "replicaId": replicaID, 16500 } 16501 16502 const APIVersion = "6.0" 16503 queryParameters := map[string]interface{}{ 16504 "api-version": APIVersion, 16505 "ReplicaHealthReportServiceKind": autorest.Encode("query", replicaHealthReportServiceKind), 16506 } 16507 if immediate != nil { 16508 queryParameters["Immediate"] = autorest.Encode("query", *immediate) 16509 } else { 16510 queryParameters["Immediate"] = autorest.Encode("query", false) 16511 } 16512 if timeout != nil { 16513 queryParameters["timeout"] = autorest.Encode("query", *timeout) 16514 } else { 16515 queryParameters["timeout"] = autorest.Encode("query", 60) 16516 } 16517 16518 preparer := autorest.CreatePreparer( 16519 autorest.AsContentType("application/json; charset=utf-8"), 16520 autorest.AsPost(), 16521 autorest.WithBaseURL(client.BaseURI), 16522 autorest.WithPathParameters("/Partitions/{partitionId}/$/GetReplicas/{replicaId}/$/ReportHealth", pathParameters), 16523 autorest.WithJSON(healthInformation), 16524 autorest.WithQueryParameters(queryParameters)) 16525 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 16526} 16527 16528// ReportReplicaHealthSender sends the ReportReplicaHealth request. The method will close the 16529// http.Response Body if it receives an error. 16530func (client BaseClient) ReportReplicaHealthSender(req *http.Request) (*http.Response, error) { 16531 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 16532 return autorest.SendWithSender(client, req, sd...) 16533} 16534 16535// ReportReplicaHealthResponder handles the response to the ReportReplicaHealth request. The method always 16536// closes the http.Response Body. 16537func (client BaseClient) ReportReplicaHealthResponder(resp *http.Response) (result autorest.Response, err error) { 16538 err = autorest.Respond( 16539 resp, 16540 client.ByInspecting(), 16541 azure.WithErrorUnlessStatusCode(http.StatusOK), 16542 autorest.ByClosing()) 16543 result.Response = resp 16544 return 16545} 16546 16547// ReportServiceHealth reports health state of the specified Service Fabric service. The report must contain the 16548// information about the source of the health report and property on which it is reported. 16549// The report is sent to a Service Fabric gateway Service, which forwards to the health store. 16550// The report may be accepted by the gateway, but rejected by the health store after extra validation. 16551// For example, the health store may reject the report because of an invalid parameter, like a stale sequence number. 16552// To see whether the report was applied in the health store, run GetServiceHealth and check that the report appears in 16553// the HealthEvents section. 16554// Parameters: 16555// serviceID - the identity of the service. This is typically the full name of the service without the 16556// 'fabric:' URI scheme. 16557// Starting from version 6.0, hierarchical names are delimited with the "~" character. 16558// For example, if the service name is "fabric:/myapp/app1/svc1", the service identity would be 16559// "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in previous versions. 16560// healthInformation - describes the health information for the health report. This information needs to be 16561// present in all of the health reports sent to the health manager. 16562// immediate - a flag which indicates whether the report should be sent immediately. 16563// A health report is sent to a Service Fabric gateway Application, which forwards to the health store. 16564// If Immediate is set to true, the report is sent immediately from HTTP Gateway to the health store, 16565// regardless of the fabric client settings that the HTTP Gateway Application is using. 16566// This is useful for critical reports that should be sent as soon as possible. 16567// Depending on timing and other conditions, sending the report may still fail, for example if the HTTP Gateway 16568// is closed or the message doesn't reach the Gateway. 16569// If Immediate is set to false, the report is sent based on the health client settings from the HTTP Gateway. 16570// Therefore, it will be batched according to the HealthReportSendInterval configuration. 16571// This is the recommended setting because it allows the health client to optimize health reporting messages to 16572// health store as well as health report processing. 16573// By default, reports are not sent immediately. 16574// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 16575// duration that the client is willing to wait for the requested operation to complete. The default value for 16576// this parameter is 60 seconds. 16577func (client BaseClient) ReportServiceHealth(ctx context.Context, serviceID string, healthInformation HealthInformation, immediate *bool, timeout *int64) (result autorest.Response, err error) { 16578 if tracing.IsEnabled() { 16579 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ReportServiceHealth") 16580 defer func() { 16581 sc := -1 16582 if result.Response != nil { 16583 sc = result.Response.StatusCode 16584 } 16585 tracing.EndSpan(ctx, sc, err) 16586 }() 16587 } 16588 if err := validation.Validate([]validation.Validation{ 16589 {TargetValue: healthInformation, 16590 Constraints: []validation.Constraint{{Target: "healthInformation.SourceID", Name: validation.Null, Rule: true, Chain: nil}, 16591 {Target: "healthInformation.Property", Name: validation.Null, Rule: true, Chain: nil}}}, 16592 {TargetValue: timeout, 16593 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 16594 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 16595 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 16596 }}}}}); err != nil { 16597 return result, validation.NewError("servicefabric.BaseClient", "ReportServiceHealth", err.Error()) 16598 } 16599 16600 req, err := client.ReportServiceHealthPreparer(ctx, serviceID, healthInformation, immediate, timeout) 16601 if err != nil { 16602 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ReportServiceHealth", nil, "Failure preparing request") 16603 return 16604 } 16605 16606 resp, err := client.ReportServiceHealthSender(req) 16607 if err != nil { 16608 result.Response = resp 16609 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ReportServiceHealth", resp, "Failure sending request") 16610 return 16611 } 16612 16613 result, err = client.ReportServiceHealthResponder(resp) 16614 if err != nil { 16615 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ReportServiceHealth", resp, "Failure responding to request") 16616 } 16617 16618 return 16619} 16620 16621// ReportServiceHealthPreparer prepares the ReportServiceHealth request. 16622func (client BaseClient) ReportServiceHealthPreparer(ctx context.Context, serviceID string, healthInformation HealthInformation, immediate *bool, timeout *int64) (*http.Request, error) { 16623 pathParameters := map[string]interface{}{ 16624 "serviceId": serviceID, 16625 } 16626 16627 const APIVersion = "6.0" 16628 queryParameters := map[string]interface{}{ 16629 "api-version": APIVersion, 16630 } 16631 if immediate != nil { 16632 queryParameters["Immediate"] = autorest.Encode("query", *immediate) 16633 } else { 16634 queryParameters["Immediate"] = autorest.Encode("query", false) 16635 } 16636 if timeout != nil { 16637 queryParameters["timeout"] = autorest.Encode("query", *timeout) 16638 } else { 16639 queryParameters["timeout"] = autorest.Encode("query", 60) 16640 } 16641 16642 preparer := autorest.CreatePreparer( 16643 autorest.AsContentType("application/json; charset=utf-8"), 16644 autorest.AsPost(), 16645 autorest.WithBaseURL(client.BaseURI), 16646 autorest.WithPathParameters("/Services/{serviceId}/$/ReportHealth", pathParameters), 16647 autorest.WithJSON(healthInformation), 16648 autorest.WithQueryParameters(queryParameters)) 16649 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 16650} 16651 16652// ReportServiceHealthSender sends the ReportServiceHealth request. The method will close the 16653// http.Response Body if it receives an error. 16654func (client BaseClient) ReportServiceHealthSender(req *http.Request) (*http.Response, error) { 16655 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 16656 return autorest.SendWithSender(client, req, sd...) 16657} 16658 16659// ReportServiceHealthResponder handles the response to the ReportServiceHealth request. The method always 16660// closes the http.Response Body. 16661func (client BaseClient) ReportServiceHealthResponder(resp *http.Response) (result autorest.Response, err error) { 16662 err = autorest.Respond( 16663 resp, 16664 client.ByInspecting(), 16665 azure.WithErrorUnlessStatusCode(http.StatusOK), 16666 autorest.ByClosing()) 16667 result.Response = resp 16668 return 16669} 16670 16671// ResetPartitionLoad resets the current load of a Service Fabric partition to the default load for the service. 16672// Parameters: 16673// partitionID - the identity of the partition. 16674// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 16675// duration that the client is willing to wait for the requested operation to complete. The default value for 16676// this parameter is 60 seconds. 16677func (client BaseClient) ResetPartitionLoad(ctx context.Context, partitionID uuid.UUID, timeout *int64) (result autorest.Response, err error) { 16678 if tracing.IsEnabled() { 16679 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ResetPartitionLoad") 16680 defer func() { 16681 sc := -1 16682 if result.Response != nil { 16683 sc = result.Response.StatusCode 16684 } 16685 tracing.EndSpan(ctx, sc, err) 16686 }() 16687 } 16688 if err := validation.Validate([]validation.Validation{ 16689 {TargetValue: timeout, 16690 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 16691 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 16692 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 16693 }}}}}); err != nil { 16694 return result, validation.NewError("servicefabric.BaseClient", "ResetPartitionLoad", err.Error()) 16695 } 16696 16697 req, err := client.ResetPartitionLoadPreparer(ctx, partitionID, timeout) 16698 if err != nil { 16699 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ResetPartitionLoad", nil, "Failure preparing request") 16700 return 16701 } 16702 16703 resp, err := client.ResetPartitionLoadSender(req) 16704 if err != nil { 16705 result.Response = resp 16706 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ResetPartitionLoad", resp, "Failure sending request") 16707 return 16708 } 16709 16710 result, err = client.ResetPartitionLoadResponder(resp) 16711 if err != nil { 16712 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ResetPartitionLoad", resp, "Failure responding to request") 16713 } 16714 16715 return 16716} 16717 16718// ResetPartitionLoadPreparer prepares the ResetPartitionLoad request. 16719func (client BaseClient) ResetPartitionLoadPreparer(ctx context.Context, partitionID uuid.UUID, timeout *int64) (*http.Request, error) { 16720 pathParameters := map[string]interface{}{ 16721 "partitionId": partitionID, 16722 } 16723 16724 const APIVersion = "6.0" 16725 queryParameters := map[string]interface{}{ 16726 "api-version": APIVersion, 16727 } 16728 if timeout != nil { 16729 queryParameters["timeout"] = autorest.Encode("query", *timeout) 16730 } else { 16731 queryParameters["timeout"] = autorest.Encode("query", 60) 16732 } 16733 16734 preparer := autorest.CreatePreparer( 16735 autorest.AsPost(), 16736 autorest.WithBaseURL(client.BaseURI), 16737 autorest.WithPathParameters("/Partitions/{partitionId}/$/ResetLoad", pathParameters), 16738 autorest.WithQueryParameters(queryParameters)) 16739 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 16740} 16741 16742// ResetPartitionLoadSender sends the ResetPartitionLoad request. The method will close the 16743// http.Response Body if it receives an error. 16744func (client BaseClient) ResetPartitionLoadSender(req *http.Request) (*http.Response, error) { 16745 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 16746 return autorest.SendWithSender(client, req, sd...) 16747} 16748 16749// ResetPartitionLoadResponder handles the response to the ResetPartitionLoad request. The method always 16750// closes the http.Response Body. 16751func (client BaseClient) ResetPartitionLoadResponder(resp *http.Response) (result autorest.Response, err error) { 16752 err = autorest.Respond( 16753 resp, 16754 client.ByInspecting(), 16755 azure.WithErrorUnlessStatusCode(http.StatusOK), 16756 autorest.ByClosing()) 16757 result.Response = resp 16758 return 16759} 16760 16761// ResolveService resolve a Service Fabric service partition to get the endpoints of the service replicas. 16762// Parameters: 16763// serviceID - the identity of the service. This is typically the full name of the service without the 16764// 'fabric:' URI scheme. 16765// Starting from version 6.0, hierarchical names are delimited with the "~" character. 16766// For example, if the service name is "fabric:/myapp/app1/svc1", the service identity would be 16767// "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in previous versions. 16768// partitionKeyType - key type for the partition. This parameter is required if the partition scheme for the 16769// service is Int64Range or Named. The possible values are following. 16770// - None (1) - Indicates that the PartitionKeyValue parameter is not specified. This is valid for the 16771// partitions with partitioning scheme as Singleton. This is the default value. The value is 1. 16772// - Int64Range (2) - Indicates that the PartitionKeyValue parameter is an int64 partition key. This is valid 16773// for the partitions with partitioning scheme as Int64Range. The value is 2. 16774// - Named (3) - Indicates that the PartitionKeyValue parameter is a name of the partition. This is valid for 16775// the partitions with partitioning scheme as Named. The value is 3. 16776// partitionKeyValue - partition key. This is required if the partition scheme for the service is Int64Range or 16777// Named. 16778// previousRspVersion - the value in the Version field of the response that was received previously. This is 16779// required if the user knows that the result that was got previously is stale. 16780// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 16781// duration that the client is willing to wait for the requested operation to complete. The default value for 16782// this parameter is 60 seconds. 16783func (client BaseClient) ResolveService(ctx context.Context, serviceID string, partitionKeyType *int32, partitionKeyValue string, previousRspVersion string, timeout *int64) (result ResolvedServicePartition, err error) { 16784 if tracing.IsEnabled() { 16785 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ResolveService") 16786 defer func() { 16787 sc := -1 16788 if result.Response.Response != nil { 16789 sc = result.Response.Response.StatusCode 16790 } 16791 tracing.EndSpan(ctx, sc, err) 16792 }() 16793 } 16794 if err := validation.Validate([]validation.Validation{ 16795 {TargetValue: timeout, 16796 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 16797 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 16798 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 16799 }}}}}); err != nil { 16800 return result, validation.NewError("servicefabric.BaseClient", "ResolveService", err.Error()) 16801 } 16802 16803 req, err := client.ResolveServicePreparer(ctx, serviceID, partitionKeyType, partitionKeyValue, previousRspVersion, timeout) 16804 if err != nil { 16805 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ResolveService", nil, "Failure preparing request") 16806 return 16807 } 16808 16809 resp, err := client.ResolveServiceSender(req) 16810 if err != nil { 16811 result.Response = autorest.Response{Response: resp} 16812 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ResolveService", resp, "Failure sending request") 16813 return 16814 } 16815 16816 result, err = client.ResolveServiceResponder(resp) 16817 if err != nil { 16818 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ResolveService", resp, "Failure responding to request") 16819 } 16820 16821 return 16822} 16823 16824// ResolveServicePreparer prepares the ResolveService request. 16825func (client BaseClient) ResolveServicePreparer(ctx context.Context, serviceID string, partitionKeyType *int32, partitionKeyValue string, previousRspVersion string, timeout *int64) (*http.Request, error) { 16826 pathParameters := map[string]interface{}{ 16827 "serviceId": serviceID, 16828 } 16829 16830 const APIVersion = "6.0" 16831 queryParameters := map[string]interface{}{ 16832 "api-version": APIVersion, 16833 } 16834 if partitionKeyType != nil { 16835 queryParameters["PartitionKeyType"] = autorest.Encode("query", *partitionKeyType) 16836 } 16837 if len(partitionKeyValue) > 0 { 16838 queryParameters["PartitionKeyValue"] = partitionKeyValue 16839 } 16840 if len(previousRspVersion) > 0 { 16841 queryParameters["PreviousRspVersion"] = previousRspVersion 16842 } 16843 if timeout != nil { 16844 queryParameters["timeout"] = autorest.Encode("query", *timeout) 16845 } else { 16846 queryParameters["timeout"] = autorest.Encode("query", 60) 16847 } 16848 16849 preparer := autorest.CreatePreparer( 16850 autorest.AsGet(), 16851 autorest.WithBaseURL(client.BaseURI), 16852 autorest.WithPathParameters("/Services/{serviceId}/$/ResolvePartition", pathParameters), 16853 autorest.WithQueryParameters(queryParameters)) 16854 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 16855} 16856 16857// ResolveServiceSender sends the ResolveService request. The method will close the 16858// http.Response Body if it receives an error. 16859func (client BaseClient) ResolveServiceSender(req *http.Request) (*http.Response, error) { 16860 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 16861 return autorest.SendWithSender(client, req, sd...) 16862} 16863 16864// ResolveServiceResponder handles the response to the ResolveService request. The method always 16865// closes the http.Response Body. 16866func (client BaseClient) ResolveServiceResponder(resp *http.Response) (result ResolvedServicePartition, err error) { 16867 err = autorest.Respond( 16868 resp, 16869 client.ByInspecting(), 16870 azure.WithErrorUnlessStatusCode(http.StatusOK), 16871 autorest.ByUnmarshallingJSON(&result), 16872 autorest.ByClosing()) 16873 result.Response = autorest.Response{Response: resp} 16874 return 16875} 16876 16877// RestartDeployedCodePackage restarts a code package deployed on a Service Fabric node in a cluster. This aborts the 16878// code package process, which will restart all the user service replicas hosted in that process. 16879// Parameters: 16880// nodeName - the name of the node. 16881// applicationID - the identity of the application. This is typically the full name of the application without 16882// the 'fabric:' URI scheme. 16883// Starting from version 6.0, hierarchical names are delimited with the "~" character. 16884// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" 16885// in 6.0+ and "myapp/app1" in previous versions. 16886// restartDeployedCodePackageDescription - describes the deployed code package on Service Fabric node to 16887// restart. 16888// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 16889// duration that the client is willing to wait for the requested operation to complete. The default value for 16890// this parameter is 60 seconds. 16891func (client BaseClient) RestartDeployedCodePackage(ctx context.Context, nodeName string, applicationID string, restartDeployedCodePackageDescription RestartDeployedCodePackageDescription, timeout *int64) (result autorest.Response, err error) { 16892 if tracing.IsEnabled() { 16893 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.RestartDeployedCodePackage") 16894 defer func() { 16895 sc := -1 16896 if result.Response != nil { 16897 sc = result.Response.StatusCode 16898 } 16899 tracing.EndSpan(ctx, sc, err) 16900 }() 16901 } 16902 if err := validation.Validate([]validation.Validation{ 16903 {TargetValue: restartDeployedCodePackageDescription, 16904 Constraints: []validation.Constraint{{Target: "restartDeployedCodePackageDescription.ServiceManifestName", Name: validation.Null, Rule: true, Chain: nil}, 16905 {Target: "restartDeployedCodePackageDescription.CodePackageName", Name: validation.Null, Rule: true, Chain: nil}, 16906 {Target: "restartDeployedCodePackageDescription.CodePackageInstanceID", Name: validation.Null, Rule: true, Chain: nil}}}, 16907 {TargetValue: timeout, 16908 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 16909 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 16910 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 16911 }}}}}); err != nil { 16912 return result, validation.NewError("servicefabric.BaseClient", "RestartDeployedCodePackage", err.Error()) 16913 } 16914 16915 req, err := client.RestartDeployedCodePackagePreparer(ctx, nodeName, applicationID, restartDeployedCodePackageDescription, timeout) 16916 if err != nil { 16917 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RestartDeployedCodePackage", nil, "Failure preparing request") 16918 return 16919 } 16920 16921 resp, err := client.RestartDeployedCodePackageSender(req) 16922 if err != nil { 16923 result.Response = resp 16924 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RestartDeployedCodePackage", resp, "Failure sending request") 16925 return 16926 } 16927 16928 result, err = client.RestartDeployedCodePackageResponder(resp) 16929 if err != nil { 16930 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RestartDeployedCodePackage", resp, "Failure responding to request") 16931 } 16932 16933 return 16934} 16935 16936// RestartDeployedCodePackagePreparer prepares the RestartDeployedCodePackage request. 16937func (client BaseClient) RestartDeployedCodePackagePreparer(ctx context.Context, nodeName string, applicationID string, restartDeployedCodePackageDescription RestartDeployedCodePackageDescription, timeout *int64) (*http.Request, error) { 16938 pathParameters := map[string]interface{}{ 16939 "applicationId": applicationID, 16940 "nodeName": autorest.Encode("path", nodeName), 16941 } 16942 16943 const APIVersion = "6.0" 16944 queryParameters := map[string]interface{}{ 16945 "api-version": APIVersion, 16946 } 16947 if timeout != nil { 16948 queryParameters["timeout"] = autorest.Encode("query", *timeout) 16949 } else { 16950 queryParameters["timeout"] = autorest.Encode("query", 60) 16951 } 16952 16953 preparer := autorest.CreatePreparer( 16954 autorest.AsContentType("application/json; charset=utf-8"), 16955 autorest.AsPost(), 16956 autorest.WithBaseURL(client.BaseURI), 16957 autorest.WithPathParameters("/Nodes/{nodeName}/$/GetApplications/{applicationId}/$/GetCodePackages/$/Restart", pathParameters), 16958 autorest.WithJSON(restartDeployedCodePackageDescription), 16959 autorest.WithQueryParameters(queryParameters)) 16960 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 16961} 16962 16963// RestartDeployedCodePackageSender sends the RestartDeployedCodePackage request. The method will close the 16964// http.Response Body if it receives an error. 16965func (client BaseClient) RestartDeployedCodePackageSender(req *http.Request) (*http.Response, error) { 16966 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 16967 return autorest.SendWithSender(client, req, sd...) 16968} 16969 16970// RestartDeployedCodePackageResponder handles the response to the RestartDeployedCodePackage request. The method always 16971// closes the http.Response Body. 16972func (client BaseClient) RestartDeployedCodePackageResponder(resp *http.Response) (result autorest.Response, err error) { 16973 err = autorest.Respond( 16974 resp, 16975 client.ByInspecting(), 16976 azure.WithErrorUnlessStatusCode(http.StatusOK), 16977 autorest.ByClosing()) 16978 result.Response = resp 16979 return 16980} 16981 16982// RestartNode restarts a Service Fabric cluster node that is already started. 16983// Parameters: 16984// nodeName - the name of the node. 16985// restartNodeDescription - the instance of the node to be restarted and a flag indicating the need to take 16986// dump of the fabric process. 16987// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 16988// duration that the client is willing to wait for the requested operation to complete. The default value for 16989// this parameter is 60 seconds. 16990func (client BaseClient) RestartNode(ctx context.Context, nodeName string, restartNodeDescription RestartNodeDescription, timeout *int64) (result autorest.Response, err error) { 16991 if tracing.IsEnabled() { 16992 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.RestartNode") 16993 defer func() { 16994 sc := -1 16995 if result.Response != nil { 16996 sc = result.Response.StatusCode 16997 } 16998 tracing.EndSpan(ctx, sc, err) 16999 }() 17000 } 17001 if err := validation.Validate([]validation.Validation{ 17002 {TargetValue: restartNodeDescription, 17003 Constraints: []validation.Constraint{{Target: "restartNodeDescription.NodeInstanceID", Name: validation.Null, Rule: true, Chain: nil}}}, 17004 {TargetValue: timeout, 17005 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 17006 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 17007 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 17008 }}}}}); err != nil { 17009 return result, validation.NewError("servicefabric.BaseClient", "RestartNode", err.Error()) 17010 } 17011 17012 req, err := client.RestartNodePreparer(ctx, nodeName, restartNodeDescription, timeout) 17013 if err != nil { 17014 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RestartNode", nil, "Failure preparing request") 17015 return 17016 } 17017 17018 resp, err := client.RestartNodeSender(req) 17019 if err != nil { 17020 result.Response = resp 17021 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RestartNode", resp, "Failure sending request") 17022 return 17023 } 17024 17025 result, err = client.RestartNodeResponder(resp) 17026 if err != nil { 17027 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RestartNode", resp, "Failure responding to request") 17028 } 17029 17030 return 17031} 17032 17033// RestartNodePreparer prepares the RestartNode request. 17034func (client BaseClient) RestartNodePreparer(ctx context.Context, nodeName string, restartNodeDescription RestartNodeDescription, timeout *int64) (*http.Request, error) { 17035 pathParameters := map[string]interface{}{ 17036 "nodeName": autorest.Encode("path", nodeName), 17037 } 17038 17039 const APIVersion = "6.0" 17040 queryParameters := map[string]interface{}{ 17041 "api-version": APIVersion, 17042 } 17043 if timeout != nil { 17044 queryParameters["timeout"] = autorest.Encode("query", *timeout) 17045 } else { 17046 queryParameters["timeout"] = autorest.Encode("query", 60) 17047 } 17048 17049 preparer := autorest.CreatePreparer( 17050 autorest.AsContentType("application/json; charset=utf-8"), 17051 autorest.AsPost(), 17052 autorest.WithBaseURL(client.BaseURI), 17053 autorest.WithPathParameters("/Nodes/{nodeName}/$/Restart", pathParameters), 17054 autorest.WithJSON(restartNodeDescription), 17055 autorest.WithQueryParameters(queryParameters)) 17056 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 17057} 17058 17059// RestartNodeSender sends the RestartNode request. The method will close the 17060// http.Response Body if it receives an error. 17061func (client BaseClient) RestartNodeSender(req *http.Request) (*http.Response, error) { 17062 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 17063 return autorest.SendWithSender(client, req, sd...) 17064} 17065 17066// RestartNodeResponder handles the response to the RestartNode request. The method always 17067// closes the http.Response Body. 17068func (client BaseClient) RestartNodeResponder(resp *http.Response) (result autorest.Response, err error) { 17069 err = autorest.Respond( 17070 resp, 17071 client.ByInspecting(), 17072 azure.WithErrorUnlessStatusCode(http.StatusOK), 17073 autorest.ByClosing()) 17074 result.Response = resp 17075 return 17076} 17077 17078// RestartReplica restarts a service replica of a persisted service running on a node. Warning - There are no safety 17079// checks performed when this API is used. Incorrect use of this API can lead to availability loss for stateful 17080// services. 17081// Parameters: 17082// nodeName - the name of the node. 17083// partitionID - the identity of the partition. 17084// replicaID - the identifier of the replica. 17085// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 17086// duration that the client is willing to wait for the requested operation to complete. The default value for 17087// this parameter is 60 seconds. 17088func (client BaseClient) RestartReplica(ctx context.Context, nodeName string, partitionID uuid.UUID, replicaID string, timeout *int64) (result autorest.Response, err error) { 17089 if tracing.IsEnabled() { 17090 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.RestartReplica") 17091 defer func() { 17092 sc := -1 17093 if result.Response != nil { 17094 sc = result.Response.StatusCode 17095 } 17096 tracing.EndSpan(ctx, sc, err) 17097 }() 17098 } 17099 if err := validation.Validate([]validation.Validation{ 17100 {TargetValue: timeout, 17101 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 17102 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 17103 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 17104 }}}}}); err != nil { 17105 return result, validation.NewError("servicefabric.BaseClient", "RestartReplica", err.Error()) 17106 } 17107 17108 req, err := client.RestartReplicaPreparer(ctx, nodeName, partitionID, replicaID, timeout) 17109 if err != nil { 17110 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RestartReplica", nil, "Failure preparing request") 17111 return 17112 } 17113 17114 resp, err := client.RestartReplicaSender(req) 17115 if err != nil { 17116 result.Response = resp 17117 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RestartReplica", resp, "Failure sending request") 17118 return 17119 } 17120 17121 result, err = client.RestartReplicaResponder(resp) 17122 if err != nil { 17123 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RestartReplica", resp, "Failure responding to request") 17124 } 17125 17126 return 17127} 17128 17129// RestartReplicaPreparer prepares the RestartReplica request. 17130func (client BaseClient) RestartReplicaPreparer(ctx context.Context, nodeName string, partitionID uuid.UUID, replicaID string, timeout *int64) (*http.Request, error) { 17131 pathParameters := map[string]interface{}{ 17132 "nodeName": autorest.Encode("path", nodeName), 17133 "partitionId": partitionID, 17134 "replicaId": replicaID, 17135 } 17136 17137 const APIVersion = "6.0" 17138 queryParameters := map[string]interface{}{ 17139 "api-version": APIVersion, 17140 } 17141 if timeout != nil { 17142 queryParameters["timeout"] = autorest.Encode("query", *timeout) 17143 } else { 17144 queryParameters["timeout"] = autorest.Encode("query", 60) 17145 } 17146 17147 preparer := autorest.CreatePreparer( 17148 autorest.AsPost(), 17149 autorest.WithBaseURL(client.BaseURI), 17150 autorest.WithPathParameters("/Nodes/{nodeName}/$/GetPartitions/{partitionId}/$/GetReplicas/{replicaId}/$/Restart", pathParameters), 17151 autorest.WithQueryParameters(queryParameters)) 17152 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 17153} 17154 17155// RestartReplicaSender sends the RestartReplica request. The method will close the 17156// http.Response Body if it receives an error. 17157func (client BaseClient) RestartReplicaSender(req *http.Request) (*http.Response, error) { 17158 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 17159 return autorest.SendWithSender(client, req, sd...) 17160} 17161 17162// RestartReplicaResponder handles the response to the RestartReplica request. The method always 17163// closes the http.Response Body. 17164func (client BaseClient) RestartReplicaResponder(resp *http.Response) (result autorest.Response, err error) { 17165 err = autorest.Respond( 17166 resp, 17167 client.ByInspecting(), 17168 azure.WithErrorUnlessStatusCode(http.StatusOK), 17169 autorest.ByClosing()) 17170 result.Response = resp 17171 return 17172} 17173 17174// RestorePartition restores the state of a of the stateful persisted partition using the specified backup point. In 17175// case the partition is already being periodically backed up, then by default the backup point is looked for in the 17176// storage specified in backup policy. One can also override the same by specifying the backup storage details as part 17177// of the restore partition description in body. Once the restore is initiated, its progress can be tracked using the 17178// GetRestoreProgress operation. 17179// In case, the operation times out, specify a greater restore timeout value in the query parameter. 17180// Parameters: 17181// partitionID - the identity of the partition. 17182// restorePartitionDescription - describes the parameters to restore the partition. 17183// restoreTimeout - specifies the maximum amount of time to wait, in minutes, for the restore operation to 17184// complete. Post that, the operation returns back with timeout error. However, in certain corner cases it 17185// could be that the restore operation goes through even though it completes with timeout. In case of timeout 17186// error, its recommended to invoke this operation again with a greater timeout value. the default value for 17187// the same is 10 minutes. 17188// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 17189// duration that the client is willing to wait for the requested operation to complete. The default value for 17190// this parameter is 60 seconds. 17191func (client BaseClient) RestorePartition(ctx context.Context, partitionID uuid.UUID, restorePartitionDescription RestorePartitionDescription, restoreTimeout *int32, timeout *int64) (result autorest.Response, err error) { 17192 if tracing.IsEnabled() { 17193 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.RestorePartition") 17194 defer func() { 17195 sc := -1 17196 if result.Response != nil { 17197 sc = result.Response.StatusCode 17198 } 17199 tracing.EndSpan(ctx, sc, err) 17200 }() 17201 } 17202 if err := validation.Validate([]validation.Validation{ 17203 {TargetValue: restorePartitionDescription, 17204 Constraints: []validation.Constraint{{Target: "restorePartitionDescription.BackupID", Name: validation.Null, Rule: true, Chain: nil}, 17205 {Target: "restorePartitionDescription.BackupLocation", Name: validation.Null, Rule: true, Chain: nil}}}, 17206 {TargetValue: timeout, 17207 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 17208 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 17209 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 17210 }}}}}); err != nil { 17211 return result, validation.NewError("servicefabric.BaseClient", "RestorePartition", err.Error()) 17212 } 17213 17214 req, err := client.RestorePartitionPreparer(ctx, partitionID, restorePartitionDescription, restoreTimeout, timeout) 17215 if err != nil { 17216 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RestorePartition", nil, "Failure preparing request") 17217 return 17218 } 17219 17220 resp, err := client.RestorePartitionSender(req) 17221 if err != nil { 17222 result.Response = resp 17223 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RestorePartition", resp, "Failure sending request") 17224 return 17225 } 17226 17227 result, err = client.RestorePartitionResponder(resp) 17228 if err != nil { 17229 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RestorePartition", resp, "Failure responding to request") 17230 } 17231 17232 return 17233} 17234 17235// RestorePartitionPreparer prepares the RestorePartition request. 17236func (client BaseClient) RestorePartitionPreparer(ctx context.Context, partitionID uuid.UUID, restorePartitionDescription RestorePartitionDescription, restoreTimeout *int32, timeout *int64) (*http.Request, error) { 17237 pathParameters := map[string]interface{}{ 17238 "partitionId": partitionID, 17239 } 17240 17241 const APIVersion = "6.2-preview" 17242 queryParameters := map[string]interface{}{ 17243 "api-version": APIVersion, 17244 } 17245 if restoreTimeout != nil { 17246 queryParameters["RestoreTimeout"] = autorest.Encode("query", *restoreTimeout) 17247 } else { 17248 queryParameters["RestoreTimeout"] = autorest.Encode("query", 10) 17249 } 17250 if timeout != nil { 17251 queryParameters["timeout"] = autorest.Encode("query", *timeout) 17252 } else { 17253 queryParameters["timeout"] = autorest.Encode("query", 60) 17254 } 17255 17256 preparer := autorest.CreatePreparer( 17257 autorest.AsContentType("application/json; charset=utf-8"), 17258 autorest.AsPost(), 17259 autorest.WithBaseURL(client.BaseURI), 17260 autorest.WithPathParameters("/Partitions/{partitionId}/$/Restore", pathParameters), 17261 autorest.WithJSON(restorePartitionDescription), 17262 autorest.WithQueryParameters(queryParameters)) 17263 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 17264} 17265 17266// RestorePartitionSender sends the RestorePartition request. The method will close the 17267// http.Response Body if it receives an error. 17268func (client BaseClient) RestorePartitionSender(req *http.Request) (*http.Response, error) { 17269 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 17270 return autorest.SendWithSender(client, req, sd...) 17271} 17272 17273// RestorePartitionResponder handles the response to the RestorePartition request. The method always 17274// closes the http.Response Body. 17275func (client BaseClient) RestorePartitionResponder(resp *http.Response) (result autorest.Response, err error) { 17276 err = autorest.Respond( 17277 resp, 17278 client.ByInspecting(), 17279 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), 17280 autorest.ByClosing()) 17281 result.Response = resp 17282 return 17283} 17284 17285// ResumeApplicationBackup the previously suspended Service Fabric application resumes taking periodic backup as per 17286// the backup policy currently configured for the same. 17287// Parameters: 17288// applicationID - the identity of the application. This is typically the full name of the application without 17289// the 'fabric:' URI scheme. 17290// Starting from version 6.0, hierarchical names are delimited with the "~" character. 17291// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" 17292// in 6.0+ and "myapp/app1" in previous versions. 17293// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 17294// duration that the client is willing to wait for the requested operation to complete. The default value for 17295// this parameter is 60 seconds. 17296func (client BaseClient) ResumeApplicationBackup(ctx context.Context, applicationID string, timeout *int64) (result autorest.Response, err error) { 17297 if tracing.IsEnabled() { 17298 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ResumeApplicationBackup") 17299 defer func() { 17300 sc := -1 17301 if result.Response != nil { 17302 sc = result.Response.StatusCode 17303 } 17304 tracing.EndSpan(ctx, sc, err) 17305 }() 17306 } 17307 if err := validation.Validate([]validation.Validation{ 17308 {TargetValue: timeout, 17309 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 17310 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 17311 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 17312 }}}}}); err != nil { 17313 return result, validation.NewError("servicefabric.BaseClient", "ResumeApplicationBackup", err.Error()) 17314 } 17315 17316 req, err := client.ResumeApplicationBackupPreparer(ctx, applicationID, timeout) 17317 if err != nil { 17318 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ResumeApplicationBackup", nil, "Failure preparing request") 17319 return 17320 } 17321 17322 resp, err := client.ResumeApplicationBackupSender(req) 17323 if err != nil { 17324 result.Response = resp 17325 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ResumeApplicationBackup", resp, "Failure sending request") 17326 return 17327 } 17328 17329 result, err = client.ResumeApplicationBackupResponder(resp) 17330 if err != nil { 17331 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ResumeApplicationBackup", resp, "Failure responding to request") 17332 } 17333 17334 return 17335} 17336 17337// ResumeApplicationBackupPreparer prepares the ResumeApplicationBackup request. 17338func (client BaseClient) ResumeApplicationBackupPreparer(ctx context.Context, applicationID string, timeout *int64) (*http.Request, error) { 17339 pathParameters := map[string]interface{}{ 17340 "applicationId": applicationID, 17341 } 17342 17343 const APIVersion = "6.2-preview" 17344 queryParameters := map[string]interface{}{ 17345 "api-version": APIVersion, 17346 } 17347 if timeout != nil { 17348 queryParameters["timeout"] = autorest.Encode("query", *timeout) 17349 } else { 17350 queryParameters["timeout"] = autorest.Encode("query", 60) 17351 } 17352 17353 preparer := autorest.CreatePreparer( 17354 autorest.AsPost(), 17355 autorest.WithBaseURL(client.BaseURI), 17356 autorest.WithPathParameters("/Applications/{applicationId}/$/ResumeBackup", pathParameters), 17357 autorest.WithQueryParameters(queryParameters)) 17358 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 17359} 17360 17361// ResumeApplicationBackupSender sends the ResumeApplicationBackup request. The method will close the 17362// http.Response Body if it receives an error. 17363func (client BaseClient) ResumeApplicationBackupSender(req *http.Request) (*http.Response, error) { 17364 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 17365 return autorest.SendWithSender(client, req, sd...) 17366} 17367 17368// ResumeApplicationBackupResponder handles the response to the ResumeApplicationBackup request. The method always 17369// closes the http.Response Body. 17370func (client BaseClient) ResumeApplicationBackupResponder(resp *http.Response) (result autorest.Response, err error) { 17371 err = autorest.Respond( 17372 resp, 17373 client.ByInspecting(), 17374 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), 17375 autorest.ByClosing()) 17376 result.Response = resp 17377 return 17378} 17379 17380// ResumeApplicationUpgrade resumes an unmonitored manual Service Fabric application upgrade. Service Fabric upgrades 17381// one upgrade domain at a time. For unmonitored manual upgrades, after Service Fabric finishes an upgrade domain, it 17382// waits for you to call this API before proceeding to the next upgrade domain. 17383// Parameters: 17384// applicationID - the identity of the application. This is typically the full name of the application without 17385// the 'fabric:' URI scheme. 17386// Starting from version 6.0, hierarchical names are delimited with the "~" character. 17387// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" 17388// in 6.0+ and "myapp/app1" in previous versions. 17389// resumeApplicationUpgradeDescription - describes the parameters for resuming an application upgrade. 17390// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 17391// duration that the client is willing to wait for the requested operation to complete. The default value for 17392// this parameter is 60 seconds. 17393func (client BaseClient) ResumeApplicationUpgrade(ctx context.Context, applicationID string, resumeApplicationUpgradeDescription ResumeApplicationUpgradeDescription, timeout *int64) (result autorest.Response, err error) { 17394 if tracing.IsEnabled() { 17395 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ResumeApplicationUpgrade") 17396 defer func() { 17397 sc := -1 17398 if result.Response != nil { 17399 sc = result.Response.StatusCode 17400 } 17401 tracing.EndSpan(ctx, sc, err) 17402 }() 17403 } 17404 if err := validation.Validate([]validation.Validation{ 17405 {TargetValue: resumeApplicationUpgradeDescription, 17406 Constraints: []validation.Constraint{{Target: "resumeApplicationUpgradeDescription.UpgradeDomainName", Name: validation.Null, Rule: true, Chain: nil}}}, 17407 {TargetValue: timeout, 17408 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 17409 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 17410 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 17411 }}}}}); err != nil { 17412 return result, validation.NewError("servicefabric.BaseClient", "ResumeApplicationUpgrade", err.Error()) 17413 } 17414 17415 req, err := client.ResumeApplicationUpgradePreparer(ctx, applicationID, resumeApplicationUpgradeDescription, timeout) 17416 if err != nil { 17417 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ResumeApplicationUpgrade", nil, "Failure preparing request") 17418 return 17419 } 17420 17421 resp, err := client.ResumeApplicationUpgradeSender(req) 17422 if err != nil { 17423 result.Response = resp 17424 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ResumeApplicationUpgrade", resp, "Failure sending request") 17425 return 17426 } 17427 17428 result, err = client.ResumeApplicationUpgradeResponder(resp) 17429 if err != nil { 17430 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ResumeApplicationUpgrade", resp, "Failure responding to request") 17431 } 17432 17433 return 17434} 17435 17436// ResumeApplicationUpgradePreparer prepares the ResumeApplicationUpgrade request. 17437func (client BaseClient) ResumeApplicationUpgradePreparer(ctx context.Context, applicationID string, resumeApplicationUpgradeDescription ResumeApplicationUpgradeDescription, timeout *int64) (*http.Request, error) { 17438 pathParameters := map[string]interface{}{ 17439 "applicationId": applicationID, 17440 } 17441 17442 const APIVersion = "6.0" 17443 queryParameters := map[string]interface{}{ 17444 "api-version": APIVersion, 17445 } 17446 if timeout != nil { 17447 queryParameters["timeout"] = autorest.Encode("query", *timeout) 17448 } else { 17449 queryParameters["timeout"] = autorest.Encode("query", 60) 17450 } 17451 17452 preparer := autorest.CreatePreparer( 17453 autorest.AsContentType("application/json; charset=utf-8"), 17454 autorest.AsPost(), 17455 autorest.WithBaseURL(client.BaseURI), 17456 autorest.WithPathParameters("/Applications/{applicationId}/$/MoveToNextUpgradeDomain", pathParameters), 17457 autorest.WithJSON(resumeApplicationUpgradeDescription), 17458 autorest.WithQueryParameters(queryParameters)) 17459 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 17460} 17461 17462// ResumeApplicationUpgradeSender sends the ResumeApplicationUpgrade request. The method will close the 17463// http.Response Body if it receives an error. 17464func (client BaseClient) ResumeApplicationUpgradeSender(req *http.Request) (*http.Response, error) { 17465 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 17466 return autorest.SendWithSender(client, req, sd...) 17467} 17468 17469// ResumeApplicationUpgradeResponder handles the response to the ResumeApplicationUpgrade request. The method always 17470// closes the http.Response Body. 17471func (client BaseClient) ResumeApplicationUpgradeResponder(resp *http.Response) (result autorest.Response, err error) { 17472 err = autorest.Respond( 17473 resp, 17474 client.ByInspecting(), 17475 azure.WithErrorUnlessStatusCode(http.StatusOK), 17476 autorest.ByClosing()) 17477 result.Response = resp 17478 return 17479} 17480 17481// ResumeClusterUpgrade make the cluster code or configuration upgrade move on to the next upgrade domain if 17482// appropriate. 17483// Parameters: 17484// resumeClusterUpgradeDescription - describes the parameters for resuming a cluster upgrade. 17485// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 17486// duration that the client is willing to wait for the requested operation to complete. The default value for 17487// this parameter is 60 seconds. 17488func (client BaseClient) ResumeClusterUpgrade(ctx context.Context, resumeClusterUpgradeDescription ResumeClusterUpgradeDescription, timeout *int64) (result autorest.Response, err error) { 17489 if tracing.IsEnabled() { 17490 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ResumeClusterUpgrade") 17491 defer func() { 17492 sc := -1 17493 if result.Response != nil { 17494 sc = result.Response.StatusCode 17495 } 17496 tracing.EndSpan(ctx, sc, err) 17497 }() 17498 } 17499 if err := validation.Validate([]validation.Validation{ 17500 {TargetValue: resumeClusterUpgradeDescription, 17501 Constraints: []validation.Constraint{{Target: "resumeClusterUpgradeDescription.UpgradeDomain", Name: validation.Null, Rule: true, Chain: nil}}}, 17502 {TargetValue: timeout, 17503 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 17504 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 17505 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 17506 }}}}}); err != nil { 17507 return result, validation.NewError("servicefabric.BaseClient", "ResumeClusterUpgrade", err.Error()) 17508 } 17509 17510 req, err := client.ResumeClusterUpgradePreparer(ctx, resumeClusterUpgradeDescription, timeout) 17511 if err != nil { 17512 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ResumeClusterUpgrade", nil, "Failure preparing request") 17513 return 17514 } 17515 17516 resp, err := client.ResumeClusterUpgradeSender(req) 17517 if err != nil { 17518 result.Response = resp 17519 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ResumeClusterUpgrade", resp, "Failure sending request") 17520 return 17521 } 17522 17523 result, err = client.ResumeClusterUpgradeResponder(resp) 17524 if err != nil { 17525 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ResumeClusterUpgrade", resp, "Failure responding to request") 17526 } 17527 17528 return 17529} 17530 17531// ResumeClusterUpgradePreparer prepares the ResumeClusterUpgrade request. 17532func (client BaseClient) ResumeClusterUpgradePreparer(ctx context.Context, resumeClusterUpgradeDescription ResumeClusterUpgradeDescription, timeout *int64) (*http.Request, error) { 17533 const APIVersion = "6.0" 17534 queryParameters := map[string]interface{}{ 17535 "api-version": APIVersion, 17536 } 17537 if timeout != nil { 17538 queryParameters["timeout"] = autorest.Encode("query", *timeout) 17539 } else { 17540 queryParameters["timeout"] = autorest.Encode("query", 60) 17541 } 17542 17543 preparer := autorest.CreatePreparer( 17544 autorest.AsContentType("application/json; charset=utf-8"), 17545 autorest.AsPost(), 17546 autorest.WithBaseURL(client.BaseURI), 17547 autorest.WithPath("/$/MoveToNextUpgradeDomain"), 17548 autorest.WithJSON(resumeClusterUpgradeDescription), 17549 autorest.WithQueryParameters(queryParameters)) 17550 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 17551} 17552 17553// ResumeClusterUpgradeSender sends the ResumeClusterUpgrade request. The method will close the 17554// http.Response Body if it receives an error. 17555func (client BaseClient) ResumeClusterUpgradeSender(req *http.Request) (*http.Response, error) { 17556 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 17557 return autorest.SendWithSender(client, req, sd...) 17558} 17559 17560// ResumeClusterUpgradeResponder handles the response to the ResumeClusterUpgrade request. The method always 17561// closes the http.Response Body. 17562func (client BaseClient) ResumeClusterUpgradeResponder(resp *http.Response) (result autorest.Response, err error) { 17563 err = autorest.Respond( 17564 resp, 17565 client.ByInspecting(), 17566 azure.WithErrorUnlessStatusCode(http.StatusOK), 17567 autorest.ByClosing()) 17568 result.Response = resp 17569 return 17570} 17571 17572// ResumePartitionBackup the previously suspended partition resumes taking periodic backup as per the backup policy 17573// currently configured for the same. 17574// Parameters: 17575// partitionID - the identity of the partition. 17576// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 17577// duration that the client is willing to wait for the requested operation to complete. The default value for 17578// this parameter is 60 seconds. 17579func (client BaseClient) ResumePartitionBackup(ctx context.Context, partitionID uuid.UUID, timeout *int64) (result autorest.Response, err error) { 17580 if tracing.IsEnabled() { 17581 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ResumePartitionBackup") 17582 defer func() { 17583 sc := -1 17584 if result.Response != nil { 17585 sc = result.Response.StatusCode 17586 } 17587 tracing.EndSpan(ctx, sc, err) 17588 }() 17589 } 17590 if err := validation.Validate([]validation.Validation{ 17591 {TargetValue: timeout, 17592 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 17593 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 17594 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 17595 }}}}}); err != nil { 17596 return result, validation.NewError("servicefabric.BaseClient", "ResumePartitionBackup", err.Error()) 17597 } 17598 17599 req, err := client.ResumePartitionBackupPreparer(ctx, partitionID, timeout) 17600 if err != nil { 17601 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ResumePartitionBackup", nil, "Failure preparing request") 17602 return 17603 } 17604 17605 resp, err := client.ResumePartitionBackupSender(req) 17606 if err != nil { 17607 result.Response = resp 17608 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ResumePartitionBackup", resp, "Failure sending request") 17609 return 17610 } 17611 17612 result, err = client.ResumePartitionBackupResponder(resp) 17613 if err != nil { 17614 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ResumePartitionBackup", resp, "Failure responding to request") 17615 } 17616 17617 return 17618} 17619 17620// ResumePartitionBackupPreparer prepares the ResumePartitionBackup request. 17621func (client BaseClient) ResumePartitionBackupPreparer(ctx context.Context, partitionID uuid.UUID, timeout *int64) (*http.Request, error) { 17622 pathParameters := map[string]interface{}{ 17623 "partitionId": partitionID, 17624 } 17625 17626 const APIVersion = "6.2-preview" 17627 queryParameters := map[string]interface{}{ 17628 "api-version": APIVersion, 17629 } 17630 if timeout != nil { 17631 queryParameters["timeout"] = autorest.Encode("query", *timeout) 17632 } else { 17633 queryParameters["timeout"] = autorest.Encode("query", 60) 17634 } 17635 17636 preparer := autorest.CreatePreparer( 17637 autorest.AsPost(), 17638 autorest.WithBaseURL(client.BaseURI), 17639 autorest.WithPathParameters("/Partitions/{partitionId}/$/ResumeBackup", pathParameters), 17640 autorest.WithQueryParameters(queryParameters)) 17641 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 17642} 17643 17644// ResumePartitionBackupSender sends the ResumePartitionBackup request. The method will close the 17645// http.Response Body if it receives an error. 17646func (client BaseClient) ResumePartitionBackupSender(req *http.Request) (*http.Response, error) { 17647 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 17648 return autorest.SendWithSender(client, req, sd...) 17649} 17650 17651// ResumePartitionBackupResponder handles the response to the ResumePartitionBackup request. The method always 17652// closes the http.Response Body. 17653func (client BaseClient) ResumePartitionBackupResponder(resp *http.Response) (result autorest.Response, err error) { 17654 err = autorest.Respond( 17655 resp, 17656 client.ByInspecting(), 17657 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), 17658 autorest.ByClosing()) 17659 result.Response = resp 17660 return 17661} 17662 17663// ResumeServiceBackup the previously suspended Service Fabric service resumes taking periodic backup as per the backup 17664// policy currently configured for the same. 17665// Parameters: 17666// serviceID - the identity of the service. This is typically the full name of the service without the 17667// 'fabric:' URI scheme. 17668// Starting from version 6.0, hierarchical names are delimited with the "~" character. 17669// For example, if the service name is "fabric:/myapp/app1/svc1", the service identity would be 17670// "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in previous versions. 17671// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 17672// duration that the client is willing to wait for the requested operation to complete. The default value for 17673// this parameter is 60 seconds. 17674func (client BaseClient) ResumeServiceBackup(ctx context.Context, serviceID string, timeout *int64) (result autorest.Response, err error) { 17675 if tracing.IsEnabled() { 17676 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ResumeServiceBackup") 17677 defer func() { 17678 sc := -1 17679 if result.Response != nil { 17680 sc = result.Response.StatusCode 17681 } 17682 tracing.EndSpan(ctx, sc, err) 17683 }() 17684 } 17685 if err := validation.Validate([]validation.Validation{ 17686 {TargetValue: timeout, 17687 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 17688 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 17689 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 17690 }}}}}); err != nil { 17691 return result, validation.NewError("servicefabric.BaseClient", "ResumeServiceBackup", err.Error()) 17692 } 17693 17694 req, err := client.ResumeServiceBackupPreparer(ctx, serviceID, timeout) 17695 if err != nil { 17696 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ResumeServiceBackup", nil, "Failure preparing request") 17697 return 17698 } 17699 17700 resp, err := client.ResumeServiceBackupSender(req) 17701 if err != nil { 17702 result.Response = resp 17703 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ResumeServiceBackup", resp, "Failure sending request") 17704 return 17705 } 17706 17707 result, err = client.ResumeServiceBackupResponder(resp) 17708 if err != nil { 17709 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ResumeServiceBackup", resp, "Failure responding to request") 17710 } 17711 17712 return 17713} 17714 17715// ResumeServiceBackupPreparer prepares the ResumeServiceBackup request. 17716func (client BaseClient) ResumeServiceBackupPreparer(ctx context.Context, serviceID string, timeout *int64) (*http.Request, error) { 17717 pathParameters := map[string]interface{}{ 17718 "serviceId": serviceID, 17719 } 17720 17721 const APIVersion = "6.2-preview" 17722 queryParameters := map[string]interface{}{ 17723 "api-version": APIVersion, 17724 } 17725 if timeout != nil { 17726 queryParameters["timeout"] = autorest.Encode("query", *timeout) 17727 } else { 17728 queryParameters["timeout"] = autorest.Encode("query", 60) 17729 } 17730 17731 preparer := autorest.CreatePreparer( 17732 autorest.AsPost(), 17733 autorest.WithBaseURL(client.BaseURI), 17734 autorest.WithPathParameters("/Services/{serviceId}/$/ResumeBackup", pathParameters), 17735 autorest.WithQueryParameters(queryParameters)) 17736 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 17737} 17738 17739// ResumeServiceBackupSender sends the ResumeServiceBackup request. The method will close the 17740// http.Response Body if it receives an error. 17741func (client BaseClient) ResumeServiceBackupSender(req *http.Request) (*http.Response, error) { 17742 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 17743 return autorest.SendWithSender(client, req, sd...) 17744} 17745 17746// ResumeServiceBackupResponder handles the response to the ResumeServiceBackup request. The method always 17747// closes the http.Response Body. 17748func (client BaseClient) ResumeServiceBackupResponder(resp *http.Response) (result autorest.Response, err error) { 17749 err = autorest.Respond( 17750 resp, 17751 client.ByInspecting(), 17752 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), 17753 autorest.ByClosing()) 17754 result.Response = resp 17755 return 17756} 17757 17758// RollbackApplicationUpgrade starts rolling back the current application upgrade to the previous version. This API can 17759// only be used to rollback the current in-progress upgrade that is rolling forward to new version. If the application 17760// is not currently being upgraded use StartApplicationUpgrade API to upgrade it to desired version, including rolling 17761// back to a previous version. 17762// Parameters: 17763// applicationID - the identity of the application. This is typically the full name of the application without 17764// the 'fabric:' URI scheme. 17765// Starting from version 6.0, hierarchical names are delimited with the "~" character. 17766// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" 17767// in 6.0+ and "myapp/app1" in previous versions. 17768// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 17769// duration that the client is willing to wait for the requested operation to complete. The default value for 17770// this parameter is 60 seconds. 17771func (client BaseClient) RollbackApplicationUpgrade(ctx context.Context, applicationID string, timeout *int64) (result autorest.Response, err error) { 17772 if tracing.IsEnabled() { 17773 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.RollbackApplicationUpgrade") 17774 defer func() { 17775 sc := -1 17776 if result.Response != nil { 17777 sc = result.Response.StatusCode 17778 } 17779 tracing.EndSpan(ctx, sc, err) 17780 }() 17781 } 17782 if err := validation.Validate([]validation.Validation{ 17783 {TargetValue: timeout, 17784 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 17785 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 17786 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 17787 }}}}}); err != nil { 17788 return result, validation.NewError("servicefabric.BaseClient", "RollbackApplicationUpgrade", err.Error()) 17789 } 17790 17791 req, err := client.RollbackApplicationUpgradePreparer(ctx, applicationID, timeout) 17792 if err != nil { 17793 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RollbackApplicationUpgrade", nil, "Failure preparing request") 17794 return 17795 } 17796 17797 resp, err := client.RollbackApplicationUpgradeSender(req) 17798 if err != nil { 17799 result.Response = resp 17800 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RollbackApplicationUpgrade", resp, "Failure sending request") 17801 return 17802 } 17803 17804 result, err = client.RollbackApplicationUpgradeResponder(resp) 17805 if err != nil { 17806 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RollbackApplicationUpgrade", resp, "Failure responding to request") 17807 } 17808 17809 return 17810} 17811 17812// RollbackApplicationUpgradePreparer prepares the RollbackApplicationUpgrade request. 17813func (client BaseClient) RollbackApplicationUpgradePreparer(ctx context.Context, applicationID string, timeout *int64) (*http.Request, error) { 17814 pathParameters := map[string]interface{}{ 17815 "applicationId": applicationID, 17816 } 17817 17818 const APIVersion = "6.0" 17819 queryParameters := map[string]interface{}{ 17820 "api-version": APIVersion, 17821 } 17822 if timeout != nil { 17823 queryParameters["timeout"] = autorest.Encode("query", *timeout) 17824 } else { 17825 queryParameters["timeout"] = autorest.Encode("query", 60) 17826 } 17827 17828 preparer := autorest.CreatePreparer( 17829 autorest.AsPost(), 17830 autorest.WithBaseURL(client.BaseURI), 17831 autorest.WithPathParameters("/Applications/{applicationId}/$/RollbackUpgrade", pathParameters), 17832 autorest.WithQueryParameters(queryParameters)) 17833 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 17834} 17835 17836// RollbackApplicationUpgradeSender sends the RollbackApplicationUpgrade request. The method will close the 17837// http.Response Body if it receives an error. 17838func (client BaseClient) RollbackApplicationUpgradeSender(req *http.Request) (*http.Response, error) { 17839 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 17840 return autorest.SendWithSender(client, req, sd...) 17841} 17842 17843// RollbackApplicationUpgradeResponder handles the response to the RollbackApplicationUpgrade request. The method always 17844// closes the http.Response Body. 17845func (client BaseClient) RollbackApplicationUpgradeResponder(resp *http.Response) (result autorest.Response, err error) { 17846 err = autorest.Respond( 17847 resp, 17848 client.ByInspecting(), 17849 azure.WithErrorUnlessStatusCode(http.StatusOK), 17850 autorest.ByClosing()) 17851 result.Response = resp 17852 return 17853} 17854 17855// RollbackClusterUpgrade rollback the code or configuration upgrade of a Service Fabric cluster. 17856// Parameters: 17857// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 17858// duration that the client is willing to wait for the requested operation to complete. The default value for 17859// this parameter is 60 seconds. 17860func (client BaseClient) RollbackClusterUpgrade(ctx context.Context, timeout *int64) (result autorest.Response, err error) { 17861 if tracing.IsEnabled() { 17862 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.RollbackClusterUpgrade") 17863 defer func() { 17864 sc := -1 17865 if result.Response != nil { 17866 sc = result.Response.StatusCode 17867 } 17868 tracing.EndSpan(ctx, sc, err) 17869 }() 17870 } 17871 if err := validation.Validate([]validation.Validation{ 17872 {TargetValue: timeout, 17873 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 17874 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 17875 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 17876 }}}}}); err != nil { 17877 return result, validation.NewError("servicefabric.BaseClient", "RollbackClusterUpgrade", err.Error()) 17878 } 17879 17880 req, err := client.RollbackClusterUpgradePreparer(ctx, timeout) 17881 if err != nil { 17882 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RollbackClusterUpgrade", nil, "Failure preparing request") 17883 return 17884 } 17885 17886 resp, err := client.RollbackClusterUpgradeSender(req) 17887 if err != nil { 17888 result.Response = resp 17889 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RollbackClusterUpgrade", resp, "Failure sending request") 17890 return 17891 } 17892 17893 result, err = client.RollbackClusterUpgradeResponder(resp) 17894 if err != nil { 17895 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RollbackClusterUpgrade", resp, "Failure responding to request") 17896 } 17897 17898 return 17899} 17900 17901// RollbackClusterUpgradePreparer prepares the RollbackClusterUpgrade request. 17902func (client BaseClient) RollbackClusterUpgradePreparer(ctx context.Context, timeout *int64) (*http.Request, error) { 17903 const APIVersion = "6.0" 17904 queryParameters := map[string]interface{}{ 17905 "api-version": APIVersion, 17906 } 17907 if timeout != nil { 17908 queryParameters["timeout"] = autorest.Encode("query", *timeout) 17909 } else { 17910 queryParameters["timeout"] = autorest.Encode("query", 60) 17911 } 17912 17913 preparer := autorest.CreatePreparer( 17914 autorest.AsPost(), 17915 autorest.WithBaseURL(client.BaseURI), 17916 autorest.WithPath("/$/RollbackUpgrade"), 17917 autorest.WithQueryParameters(queryParameters)) 17918 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 17919} 17920 17921// RollbackClusterUpgradeSender sends the RollbackClusterUpgrade request. The method will close the 17922// http.Response Body if it receives an error. 17923func (client BaseClient) RollbackClusterUpgradeSender(req *http.Request) (*http.Response, error) { 17924 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 17925 return autorest.SendWithSender(client, req, sd...) 17926} 17927 17928// RollbackClusterUpgradeResponder handles the response to the RollbackClusterUpgrade request. The method always 17929// closes the http.Response Body. 17930func (client BaseClient) RollbackClusterUpgradeResponder(resp *http.Response) (result autorest.Response, err error) { 17931 err = autorest.Respond( 17932 resp, 17933 client.ByInspecting(), 17934 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), 17935 autorest.ByClosing()) 17936 result.Response = resp 17937 return 17938} 17939 17940// SetUpgradeOrchestrationServiceState update the service state of Service Fabric Upgrade Orchestration Service. This 17941// API is internally used for support purposes. 17942// Parameters: 17943// upgradeOrchestrationServiceState - service state of Service Fabric Upgrade Orchestration Service. 17944// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 17945// duration that the client is willing to wait for the requested operation to complete. The default value for 17946// this parameter is 60 seconds. 17947func (client BaseClient) SetUpgradeOrchestrationServiceState(ctx context.Context, upgradeOrchestrationServiceState UpgradeOrchestrationServiceState, timeout *int64) (result UpgradeOrchestrationServiceStateSummary, err error) { 17948 if tracing.IsEnabled() { 17949 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.SetUpgradeOrchestrationServiceState") 17950 defer func() { 17951 sc := -1 17952 if result.Response.Response != nil { 17953 sc = result.Response.Response.StatusCode 17954 } 17955 tracing.EndSpan(ctx, sc, err) 17956 }() 17957 } 17958 if err := validation.Validate([]validation.Validation{ 17959 {TargetValue: timeout, 17960 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 17961 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 17962 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 17963 }}}}}); err != nil { 17964 return result, validation.NewError("servicefabric.BaseClient", "SetUpgradeOrchestrationServiceState", err.Error()) 17965 } 17966 17967 req, err := client.SetUpgradeOrchestrationServiceStatePreparer(ctx, upgradeOrchestrationServiceState, timeout) 17968 if err != nil { 17969 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "SetUpgradeOrchestrationServiceState", nil, "Failure preparing request") 17970 return 17971 } 17972 17973 resp, err := client.SetUpgradeOrchestrationServiceStateSender(req) 17974 if err != nil { 17975 result.Response = autorest.Response{Response: resp} 17976 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "SetUpgradeOrchestrationServiceState", resp, "Failure sending request") 17977 return 17978 } 17979 17980 result, err = client.SetUpgradeOrchestrationServiceStateResponder(resp) 17981 if err != nil { 17982 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "SetUpgradeOrchestrationServiceState", resp, "Failure responding to request") 17983 } 17984 17985 return 17986} 17987 17988// SetUpgradeOrchestrationServiceStatePreparer prepares the SetUpgradeOrchestrationServiceState request. 17989func (client BaseClient) SetUpgradeOrchestrationServiceStatePreparer(ctx context.Context, upgradeOrchestrationServiceState UpgradeOrchestrationServiceState, timeout *int64) (*http.Request, error) { 17990 const APIVersion = "6.0" 17991 queryParameters := map[string]interface{}{ 17992 "api-version": APIVersion, 17993 } 17994 if timeout != nil { 17995 queryParameters["timeout"] = autorest.Encode("query", *timeout) 17996 } else { 17997 queryParameters["timeout"] = autorest.Encode("query", 60) 17998 } 17999 18000 preparer := autorest.CreatePreparer( 18001 autorest.AsContentType("application/json; charset=utf-8"), 18002 autorest.AsPost(), 18003 autorest.WithBaseURL(client.BaseURI), 18004 autorest.WithPath("/$/SetUpgradeOrchestrationServiceState"), 18005 autorest.WithJSON(upgradeOrchestrationServiceState), 18006 autorest.WithQueryParameters(queryParameters)) 18007 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 18008} 18009 18010// SetUpgradeOrchestrationServiceStateSender sends the SetUpgradeOrchestrationServiceState request. The method will close the 18011// http.Response Body if it receives an error. 18012func (client BaseClient) SetUpgradeOrchestrationServiceStateSender(req *http.Request) (*http.Response, error) { 18013 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 18014 return autorest.SendWithSender(client, req, sd...) 18015} 18016 18017// SetUpgradeOrchestrationServiceStateResponder handles the response to the SetUpgradeOrchestrationServiceState request. The method always 18018// closes the http.Response Body. 18019func (client BaseClient) SetUpgradeOrchestrationServiceStateResponder(resp *http.Response) (result UpgradeOrchestrationServiceStateSummary, err error) { 18020 err = autorest.Respond( 18021 resp, 18022 client.ByInspecting(), 18023 azure.WithErrorUnlessStatusCode(http.StatusOK), 18024 autorest.ByUnmarshallingJSON(&result), 18025 autorest.ByClosing()) 18026 result.Response = autorest.Response{Response: resp} 18027 return 18028} 18029 18030// StartApplicationUpgrade validates the supplied application upgrade parameters and starts upgrading the application 18031// if the parameters are valid. 18032// Parameters: 18033// applicationID - the identity of the application. This is typically the full name of the application without 18034// the 'fabric:' URI scheme. 18035// Starting from version 6.0, hierarchical names are delimited with the "~" character. 18036// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" 18037// in 6.0+ and "myapp/app1" in previous versions. 18038// applicationUpgradeDescription - parameters for an application upgrade. 18039// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 18040// duration that the client is willing to wait for the requested operation to complete. The default value for 18041// this parameter is 60 seconds. 18042func (client BaseClient) StartApplicationUpgrade(ctx context.Context, applicationID string, applicationUpgradeDescription ApplicationUpgradeDescription, timeout *int64) (result autorest.Response, err error) { 18043 if tracing.IsEnabled() { 18044 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.StartApplicationUpgrade") 18045 defer func() { 18046 sc := -1 18047 if result.Response != nil { 18048 sc = result.Response.StatusCode 18049 } 18050 tracing.EndSpan(ctx, sc, err) 18051 }() 18052 } 18053 if err := validation.Validate([]validation.Validation{ 18054 {TargetValue: applicationUpgradeDescription, 18055 Constraints: []validation.Constraint{{Target: "applicationUpgradeDescription.Name", Name: validation.Null, Rule: true, Chain: nil}, 18056 {Target: "applicationUpgradeDescription.TargetApplicationTypeVersion", Name: validation.Null, Rule: true, Chain: nil}, 18057 {Target: "applicationUpgradeDescription.Parameters", Name: validation.Null, Rule: true, Chain: nil}}}, 18058 {TargetValue: timeout, 18059 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 18060 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 18061 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 18062 }}}}}); err != nil { 18063 return result, validation.NewError("servicefabric.BaseClient", "StartApplicationUpgrade", err.Error()) 18064 } 18065 18066 req, err := client.StartApplicationUpgradePreparer(ctx, applicationID, applicationUpgradeDescription, timeout) 18067 if err != nil { 18068 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartApplicationUpgrade", nil, "Failure preparing request") 18069 return 18070 } 18071 18072 resp, err := client.StartApplicationUpgradeSender(req) 18073 if err != nil { 18074 result.Response = resp 18075 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartApplicationUpgrade", resp, "Failure sending request") 18076 return 18077 } 18078 18079 result, err = client.StartApplicationUpgradeResponder(resp) 18080 if err != nil { 18081 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartApplicationUpgrade", resp, "Failure responding to request") 18082 } 18083 18084 return 18085} 18086 18087// StartApplicationUpgradePreparer prepares the StartApplicationUpgrade request. 18088func (client BaseClient) StartApplicationUpgradePreparer(ctx context.Context, applicationID string, applicationUpgradeDescription ApplicationUpgradeDescription, timeout *int64) (*http.Request, error) { 18089 pathParameters := map[string]interface{}{ 18090 "applicationId": applicationID, 18091 } 18092 18093 const APIVersion = "6.0" 18094 queryParameters := map[string]interface{}{ 18095 "api-version": APIVersion, 18096 } 18097 if timeout != nil { 18098 queryParameters["timeout"] = autorest.Encode("query", *timeout) 18099 } else { 18100 queryParameters["timeout"] = autorest.Encode("query", 60) 18101 } 18102 18103 preparer := autorest.CreatePreparer( 18104 autorest.AsContentType("application/json; charset=utf-8"), 18105 autorest.AsPost(), 18106 autorest.WithBaseURL(client.BaseURI), 18107 autorest.WithPathParameters("/Applications/{applicationId}/$/Upgrade", pathParameters), 18108 autorest.WithJSON(applicationUpgradeDescription), 18109 autorest.WithQueryParameters(queryParameters)) 18110 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 18111} 18112 18113// StartApplicationUpgradeSender sends the StartApplicationUpgrade request. The method will close the 18114// http.Response Body if it receives an error. 18115func (client BaseClient) StartApplicationUpgradeSender(req *http.Request) (*http.Response, error) { 18116 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 18117 return autorest.SendWithSender(client, req, sd...) 18118} 18119 18120// StartApplicationUpgradeResponder handles the response to the StartApplicationUpgrade request. The method always 18121// closes the http.Response Body. 18122func (client BaseClient) StartApplicationUpgradeResponder(resp *http.Response) (result autorest.Response, err error) { 18123 err = autorest.Respond( 18124 resp, 18125 client.ByInspecting(), 18126 azure.WithErrorUnlessStatusCode(http.StatusOK), 18127 autorest.ByClosing()) 18128 result.Response = resp 18129 return 18130} 18131 18132// StartChaos if Chaos is not already running in the cluster, it starts Chaos with the passed in Chaos parameters. 18133// If Chaos is already running when this call is made, the call fails with the error code 18134// FABRIC_E_CHAOS_ALREADY_RUNNING. 18135// Please refer to the article [Induce controlled Chaos in Service Fabric 18136// clusters](https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-controlled-chaos) for more details. 18137// Parameters: 18138// chaosParameters - describes all the parameters to configure a Chaos run. 18139// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 18140// duration that the client is willing to wait for the requested operation to complete. The default value for 18141// this parameter is 60 seconds. 18142func (client BaseClient) StartChaos(ctx context.Context, chaosParameters ChaosParameters, timeout *int64) (result autorest.Response, err error) { 18143 if tracing.IsEnabled() { 18144 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.StartChaos") 18145 defer func() { 18146 sc := -1 18147 if result.Response != nil { 18148 sc = result.Response.StatusCode 18149 } 18150 tracing.EndSpan(ctx, sc, err) 18151 }() 18152 } 18153 if err := validation.Validate([]validation.Validation{ 18154 {TargetValue: chaosParameters, 18155 Constraints: []validation.Constraint{{Target: "chaosParameters.MaxClusterStabilizationTimeoutInSeconds", Name: validation.Null, Rule: false, 18156 Chain: []validation.Constraint{{Target: "chaosParameters.MaxClusterStabilizationTimeoutInSeconds", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 18157 {Target: "chaosParameters.MaxClusterStabilizationTimeoutInSeconds", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}, 18158 }}, 18159 {Target: "chaosParameters.MaxConcurrentFaults", Name: validation.Null, Rule: false, 18160 Chain: []validation.Constraint{{Target: "chaosParameters.MaxConcurrentFaults", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 18161 {Target: "chaosParameters.MaxConcurrentFaults", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}, 18162 }}, 18163 {Target: "chaosParameters.WaitTimeBetweenFaultsInSeconds", Name: validation.Null, Rule: false, 18164 Chain: []validation.Constraint{{Target: "chaosParameters.WaitTimeBetweenFaultsInSeconds", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 18165 {Target: "chaosParameters.WaitTimeBetweenFaultsInSeconds", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}, 18166 }}, 18167 {Target: "chaosParameters.WaitTimeBetweenIterationsInSeconds", Name: validation.Null, Rule: false, 18168 Chain: []validation.Constraint{{Target: "chaosParameters.WaitTimeBetweenIterationsInSeconds", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 18169 {Target: "chaosParameters.WaitTimeBetweenIterationsInSeconds", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}, 18170 }}}}, 18171 {TargetValue: timeout, 18172 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 18173 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 18174 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 18175 }}}}}); err != nil { 18176 return result, validation.NewError("servicefabric.BaseClient", "StartChaos", err.Error()) 18177 } 18178 18179 req, err := client.StartChaosPreparer(ctx, chaosParameters, timeout) 18180 if err != nil { 18181 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartChaos", nil, "Failure preparing request") 18182 return 18183 } 18184 18185 resp, err := client.StartChaosSender(req) 18186 if err != nil { 18187 result.Response = resp 18188 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartChaos", resp, "Failure sending request") 18189 return 18190 } 18191 18192 result, err = client.StartChaosResponder(resp) 18193 if err != nil { 18194 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartChaos", resp, "Failure responding to request") 18195 } 18196 18197 return 18198} 18199 18200// StartChaosPreparer prepares the StartChaos request. 18201func (client BaseClient) StartChaosPreparer(ctx context.Context, chaosParameters ChaosParameters, timeout *int64) (*http.Request, error) { 18202 const APIVersion = "6.0" 18203 queryParameters := map[string]interface{}{ 18204 "api-version": APIVersion, 18205 } 18206 if timeout != nil { 18207 queryParameters["timeout"] = autorest.Encode("query", *timeout) 18208 } else { 18209 queryParameters["timeout"] = autorest.Encode("query", 60) 18210 } 18211 18212 preparer := autorest.CreatePreparer( 18213 autorest.AsContentType("application/json; charset=utf-8"), 18214 autorest.AsPost(), 18215 autorest.WithBaseURL(client.BaseURI), 18216 autorest.WithPath("/Tools/Chaos/$/Start"), 18217 autorest.WithJSON(chaosParameters), 18218 autorest.WithQueryParameters(queryParameters)) 18219 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 18220} 18221 18222// StartChaosSender sends the StartChaos request. The method will close the 18223// http.Response Body if it receives an error. 18224func (client BaseClient) StartChaosSender(req *http.Request) (*http.Response, error) { 18225 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 18226 return autorest.SendWithSender(client, req, sd...) 18227} 18228 18229// StartChaosResponder handles the response to the StartChaos request. The method always 18230// closes the http.Response Body. 18231func (client BaseClient) StartChaosResponder(resp *http.Response) (result autorest.Response, err error) { 18232 err = autorest.Respond( 18233 resp, 18234 client.ByInspecting(), 18235 azure.WithErrorUnlessStatusCode(http.StatusOK), 18236 autorest.ByClosing()) 18237 result.Response = resp 18238 return 18239} 18240 18241// StartClusterConfigurationUpgrade validate the supplied configuration upgrade parameters and start upgrading the 18242// cluster configuration if the parameters are valid. 18243// Parameters: 18244// clusterConfigurationUpgradeDescription - parameters for a standalone cluster configuration upgrade. 18245// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 18246// duration that the client is willing to wait for the requested operation to complete. The default value for 18247// this parameter is 60 seconds. 18248func (client BaseClient) StartClusterConfigurationUpgrade(ctx context.Context, clusterConfigurationUpgradeDescription ClusterConfigurationUpgradeDescription, timeout *int64) (result autorest.Response, err error) { 18249 if tracing.IsEnabled() { 18250 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.StartClusterConfigurationUpgrade") 18251 defer func() { 18252 sc := -1 18253 if result.Response != nil { 18254 sc = result.Response.StatusCode 18255 } 18256 tracing.EndSpan(ctx, sc, err) 18257 }() 18258 } 18259 if err := validation.Validate([]validation.Validation{ 18260 {TargetValue: clusterConfigurationUpgradeDescription, 18261 Constraints: []validation.Constraint{{Target: "clusterConfigurationUpgradeDescription.ClusterConfig", Name: validation.Null, Rule: true, Chain: nil}}}, 18262 {TargetValue: timeout, 18263 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 18264 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 18265 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 18266 }}}}}); err != nil { 18267 return result, validation.NewError("servicefabric.BaseClient", "StartClusterConfigurationUpgrade", err.Error()) 18268 } 18269 18270 req, err := client.StartClusterConfigurationUpgradePreparer(ctx, clusterConfigurationUpgradeDescription, timeout) 18271 if err != nil { 18272 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartClusterConfigurationUpgrade", nil, "Failure preparing request") 18273 return 18274 } 18275 18276 resp, err := client.StartClusterConfigurationUpgradeSender(req) 18277 if err != nil { 18278 result.Response = resp 18279 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartClusterConfigurationUpgrade", resp, "Failure sending request") 18280 return 18281 } 18282 18283 result, err = client.StartClusterConfigurationUpgradeResponder(resp) 18284 if err != nil { 18285 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartClusterConfigurationUpgrade", resp, "Failure responding to request") 18286 } 18287 18288 return 18289} 18290 18291// StartClusterConfigurationUpgradePreparer prepares the StartClusterConfigurationUpgrade request. 18292func (client BaseClient) StartClusterConfigurationUpgradePreparer(ctx context.Context, clusterConfigurationUpgradeDescription ClusterConfigurationUpgradeDescription, timeout *int64) (*http.Request, error) { 18293 const APIVersion = "6.0" 18294 queryParameters := map[string]interface{}{ 18295 "api-version": APIVersion, 18296 } 18297 if timeout != nil { 18298 queryParameters["timeout"] = autorest.Encode("query", *timeout) 18299 } else { 18300 queryParameters["timeout"] = autorest.Encode("query", 60) 18301 } 18302 18303 preparer := autorest.CreatePreparer( 18304 autorest.AsContentType("application/json; charset=utf-8"), 18305 autorest.AsPost(), 18306 autorest.WithBaseURL(client.BaseURI), 18307 autorest.WithPath("/$/StartClusterConfigurationUpgrade"), 18308 autorest.WithJSON(clusterConfigurationUpgradeDescription), 18309 autorest.WithQueryParameters(queryParameters)) 18310 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 18311} 18312 18313// StartClusterConfigurationUpgradeSender sends the StartClusterConfigurationUpgrade request. The method will close the 18314// http.Response Body if it receives an error. 18315func (client BaseClient) StartClusterConfigurationUpgradeSender(req *http.Request) (*http.Response, error) { 18316 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 18317 return autorest.SendWithSender(client, req, sd...) 18318} 18319 18320// StartClusterConfigurationUpgradeResponder handles the response to the StartClusterConfigurationUpgrade request. The method always 18321// closes the http.Response Body. 18322func (client BaseClient) StartClusterConfigurationUpgradeResponder(resp *http.Response) (result autorest.Response, err error) { 18323 err = autorest.Respond( 18324 resp, 18325 client.ByInspecting(), 18326 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), 18327 autorest.ByClosing()) 18328 result.Response = resp 18329 return 18330} 18331 18332// StartClusterUpgrade validate the supplied upgrade parameters and start upgrading the code or configuration version 18333// of a Service Fabric cluster if the parameters are valid. 18334// Parameters: 18335// startClusterUpgradeDescription - describes the parameters for starting a cluster upgrade. 18336// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 18337// duration that the client is willing to wait for the requested operation to complete. The default value for 18338// this parameter is 60 seconds. 18339func (client BaseClient) StartClusterUpgrade(ctx context.Context, startClusterUpgradeDescription StartClusterUpgradeDescription, timeout *int64) (result autorest.Response, err error) { 18340 if tracing.IsEnabled() { 18341 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.StartClusterUpgrade") 18342 defer func() { 18343 sc := -1 18344 if result.Response != nil { 18345 sc = result.Response.StatusCode 18346 } 18347 tracing.EndSpan(ctx, sc, err) 18348 }() 18349 } 18350 if err := validation.Validate([]validation.Validation{ 18351 {TargetValue: startClusterUpgradeDescription, 18352 Constraints: []validation.Constraint{{Target: "startClusterUpgradeDescription.ClusterUpgradeHealthPolicy", Name: validation.Null, Rule: false, 18353 Chain: []validation.Constraint{{Target: "startClusterUpgradeDescription.ClusterUpgradeHealthPolicy.MaxPercentDeltaUnhealthyNodes", Name: validation.Null, Rule: false, 18354 Chain: []validation.Constraint{{Target: "startClusterUpgradeDescription.ClusterUpgradeHealthPolicy.MaxPercentDeltaUnhealthyNodes", Name: validation.InclusiveMaximum, Rule: int64(100), Chain: nil}, 18355 {Target: "startClusterUpgradeDescription.ClusterUpgradeHealthPolicy.MaxPercentDeltaUnhealthyNodes", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}, 18356 }}, 18357 {Target: "startClusterUpgradeDescription.ClusterUpgradeHealthPolicy.MaxPercentUpgradeDomainDeltaUnhealthyNodes", Name: validation.Null, Rule: false, 18358 Chain: []validation.Constraint{{Target: "startClusterUpgradeDescription.ClusterUpgradeHealthPolicy.MaxPercentUpgradeDomainDeltaUnhealthyNodes", Name: validation.InclusiveMaximum, Rule: int64(100), Chain: nil}, 18359 {Target: "startClusterUpgradeDescription.ClusterUpgradeHealthPolicy.MaxPercentUpgradeDomainDeltaUnhealthyNodes", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}, 18360 }}, 18361 }}}}, 18362 {TargetValue: timeout, 18363 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 18364 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 18365 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 18366 }}}}}); err != nil { 18367 return result, validation.NewError("servicefabric.BaseClient", "StartClusterUpgrade", err.Error()) 18368 } 18369 18370 req, err := client.StartClusterUpgradePreparer(ctx, startClusterUpgradeDescription, timeout) 18371 if err != nil { 18372 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartClusterUpgrade", nil, "Failure preparing request") 18373 return 18374 } 18375 18376 resp, err := client.StartClusterUpgradeSender(req) 18377 if err != nil { 18378 result.Response = resp 18379 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartClusterUpgrade", resp, "Failure sending request") 18380 return 18381 } 18382 18383 result, err = client.StartClusterUpgradeResponder(resp) 18384 if err != nil { 18385 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartClusterUpgrade", resp, "Failure responding to request") 18386 } 18387 18388 return 18389} 18390 18391// StartClusterUpgradePreparer prepares the StartClusterUpgrade request. 18392func (client BaseClient) StartClusterUpgradePreparer(ctx context.Context, startClusterUpgradeDescription StartClusterUpgradeDescription, timeout *int64) (*http.Request, error) { 18393 const APIVersion = "6.0" 18394 queryParameters := map[string]interface{}{ 18395 "api-version": APIVersion, 18396 } 18397 if timeout != nil { 18398 queryParameters["timeout"] = autorest.Encode("query", *timeout) 18399 } else { 18400 queryParameters["timeout"] = autorest.Encode("query", 60) 18401 } 18402 18403 preparer := autorest.CreatePreparer( 18404 autorest.AsContentType("application/json; charset=utf-8"), 18405 autorest.AsPost(), 18406 autorest.WithBaseURL(client.BaseURI), 18407 autorest.WithPath("/$/Upgrade"), 18408 autorest.WithJSON(startClusterUpgradeDescription), 18409 autorest.WithQueryParameters(queryParameters)) 18410 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 18411} 18412 18413// StartClusterUpgradeSender sends the StartClusterUpgrade request. The method will close the 18414// http.Response Body if it receives an error. 18415func (client BaseClient) StartClusterUpgradeSender(req *http.Request) (*http.Response, error) { 18416 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 18417 return autorest.SendWithSender(client, req, sd...) 18418} 18419 18420// StartClusterUpgradeResponder handles the response to the StartClusterUpgrade request. The method always 18421// closes the http.Response Body. 18422func (client BaseClient) StartClusterUpgradeResponder(resp *http.Response) (result autorest.Response, err error) { 18423 err = autorest.Respond( 18424 resp, 18425 client.ByInspecting(), 18426 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), 18427 autorest.ByClosing()) 18428 result.Response = resp 18429 return 18430} 18431 18432// StartComposeDeploymentUpgrade validates the supplied upgrade parameters and starts upgrading the deployment if the 18433// parameters are valid. 18434// Parameters: 18435// deploymentName - the identity of the deployment. 18436// composeDeploymentUpgradeDescription - parameters for upgrading compose deployment. 18437// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 18438// duration that the client is willing to wait for the requested operation to complete. The default value for 18439// this parameter is 60 seconds. 18440func (client BaseClient) StartComposeDeploymentUpgrade(ctx context.Context, deploymentName string, composeDeploymentUpgradeDescription ComposeDeploymentUpgradeDescription, timeout *int64) (result autorest.Response, err error) { 18441 if tracing.IsEnabled() { 18442 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.StartComposeDeploymentUpgrade") 18443 defer func() { 18444 sc := -1 18445 if result.Response != nil { 18446 sc = result.Response.StatusCode 18447 } 18448 tracing.EndSpan(ctx, sc, err) 18449 }() 18450 } 18451 if err := validation.Validate([]validation.Validation{ 18452 {TargetValue: composeDeploymentUpgradeDescription, 18453 Constraints: []validation.Constraint{{Target: "composeDeploymentUpgradeDescription.DeploymentName", Name: validation.Null, Rule: true, Chain: nil}, 18454 {Target: "composeDeploymentUpgradeDescription.ComposeFileContent", Name: validation.Null, Rule: true, Chain: nil}}}, 18455 {TargetValue: timeout, 18456 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 18457 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 18458 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 18459 }}}}}); err != nil { 18460 return result, validation.NewError("servicefabric.BaseClient", "StartComposeDeploymentUpgrade", err.Error()) 18461 } 18462 18463 req, err := client.StartComposeDeploymentUpgradePreparer(ctx, deploymentName, composeDeploymentUpgradeDescription, timeout) 18464 if err != nil { 18465 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartComposeDeploymentUpgrade", nil, "Failure preparing request") 18466 return 18467 } 18468 18469 resp, err := client.StartComposeDeploymentUpgradeSender(req) 18470 if err != nil { 18471 result.Response = resp 18472 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartComposeDeploymentUpgrade", resp, "Failure sending request") 18473 return 18474 } 18475 18476 result, err = client.StartComposeDeploymentUpgradeResponder(resp) 18477 if err != nil { 18478 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartComposeDeploymentUpgrade", resp, "Failure responding to request") 18479 } 18480 18481 return 18482} 18483 18484// StartComposeDeploymentUpgradePreparer prepares the StartComposeDeploymentUpgrade request. 18485func (client BaseClient) StartComposeDeploymentUpgradePreparer(ctx context.Context, deploymentName string, composeDeploymentUpgradeDescription ComposeDeploymentUpgradeDescription, timeout *int64) (*http.Request, error) { 18486 pathParameters := map[string]interface{}{ 18487 "deploymentName": deploymentName, 18488 } 18489 18490 const APIVersion = "6.0-preview" 18491 queryParameters := map[string]interface{}{ 18492 "api-version": APIVersion, 18493 } 18494 if timeout != nil { 18495 queryParameters["timeout"] = autorest.Encode("query", *timeout) 18496 } else { 18497 queryParameters["timeout"] = autorest.Encode("query", 60) 18498 } 18499 18500 preparer := autorest.CreatePreparer( 18501 autorest.AsContentType("application/json; charset=utf-8"), 18502 autorest.AsPost(), 18503 autorest.WithBaseURL(client.BaseURI), 18504 autorest.WithPathParameters("/ComposeDeployments/{deploymentName}/$/Upgrade", pathParameters), 18505 autorest.WithJSON(composeDeploymentUpgradeDescription), 18506 autorest.WithQueryParameters(queryParameters)) 18507 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 18508} 18509 18510// StartComposeDeploymentUpgradeSender sends the StartComposeDeploymentUpgrade request. The method will close the 18511// http.Response Body if it receives an error. 18512func (client BaseClient) StartComposeDeploymentUpgradeSender(req *http.Request) (*http.Response, error) { 18513 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 18514 return autorest.SendWithSender(client, req, sd...) 18515} 18516 18517// StartComposeDeploymentUpgradeResponder handles the response to the StartComposeDeploymentUpgrade request. The method always 18518// closes the http.Response Body. 18519func (client BaseClient) StartComposeDeploymentUpgradeResponder(resp *http.Response) (result autorest.Response, err error) { 18520 err = autorest.Respond( 18521 resp, 18522 client.ByInspecting(), 18523 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), 18524 autorest.ByClosing()) 18525 result.Response = resp 18526 return 18527} 18528 18529// StartDataLoss this API will induce data loss for the specified partition. It will trigger a call to the OnDataLoss 18530// API of the partition. 18531// Actual data loss will depend on the specified DataLossMode 18532// PartialDataLoss - Only a quorum of replicas are removed and OnDataLoss is triggered for the partition but actual 18533// data loss depends on the presence of in-flight replication. 18534// FullDataLoss - All replicas are removed hence all data is lost and OnDataLoss is triggered. 18535// 18536// This API should only be called with a stateful service as the target. 18537// 18538// Calling this API with a system service as the target is not advised. 18539// 18540// Note: Once this API has been called, it cannot be reversed. Calling CancelOperation will only stop execution and 18541// clean up internal system state. 18542// It will not restore data if the command has progressed far enough to cause data loss. 18543// 18544// Call the GetDataLossProgress API with the same OperationId to return information on the operation started with this 18545// API. 18546// Parameters: 18547// serviceID - the identity of the service. This is typically the full name of the service without the 18548// 'fabric:' URI scheme. 18549// Starting from version 6.0, hierarchical names are delimited with the "~" character. 18550// For example, if the service name is "fabric:/myapp/app1/svc1", the service identity would be 18551// "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in previous versions. 18552// partitionID - the identity of the partition. 18553// operationID - a GUID that identifies a call of this API. This is passed into the corresponding GetProgress 18554// API 18555// dataLossMode - this enum is passed to the StartDataLoss API to indicate what type of data loss to induce. 18556// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 18557// duration that the client is willing to wait for the requested operation to complete. The default value for 18558// this parameter is 60 seconds. 18559func (client BaseClient) StartDataLoss(ctx context.Context, serviceID string, partitionID uuid.UUID, operationID uuid.UUID, dataLossMode DataLossMode, timeout *int64) (result autorest.Response, err error) { 18560 if tracing.IsEnabled() { 18561 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.StartDataLoss") 18562 defer func() { 18563 sc := -1 18564 if result.Response != nil { 18565 sc = result.Response.StatusCode 18566 } 18567 tracing.EndSpan(ctx, sc, err) 18568 }() 18569 } 18570 if err := validation.Validate([]validation.Validation{ 18571 {TargetValue: timeout, 18572 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 18573 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 18574 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 18575 }}}}}); err != nil { 18576 return result, validation.NewError("servicefabric.BaseClient", "StartDataLoss", err.Error()) 18577 } 18578 18579 req, err := client.StartDataLossPreparer(ctx, serviceID, partitionID, operationID, dataLossMode, timeout) 18580 if err != nil { 18581 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartDataLoss", nil, "Failure preparing request") 18582 return 18583 } 18584 18585 resp, err := client.StartDataLossSender(req) 18586 if err != nil { 18587 result.Response = resp 18588 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartDataLoss", resp, "Failure sending request") 18589 return 18590 } 18591 18592 result, err = client.StartDataLossResponder(resp) 18593 if err != nil { 18594 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartDataLoss", resp, "Failure responding to request") 18595 } 18596 18597 return 18598} 18599 18600// StartDataLossPreparer prepares the StartDataLoss request. 18601func (client BaseClient) StartDataLossPreparer(ctx context.Context, serviceID string, partitionID uuid.UUID, operationID uuid.UUID, dataLossMode DataLossMode, timeout *int64) (*http.Request, error) { 18602 pathParameters := map[string]interface{}{ 18603 "partitionId": partitionID, 18604 "serviceId": serviceID, 18605 } 18606 18607 const APIVersion = "6.0" 18608 queryParameters := map[string]interface{}{ 18609 "api-version": APIVersion, 18610 "DataLossMode": autorest.Encode("query", dataLossMode), 18611 "OperationId": autorest.Encode("query", operationID), 18612 } 18613 if timeout != nil { 18614 queryParameters["timeout"] = autorest.Encode("query", *timeout) 18615 } else { 18616 queryParameters["timeout"] = autorest.Encode("query", 60) 18617 } 18618 18619 preparer := autorest.CreatePreparer( 18620 autorest.AsPost(), 18621 autorest.WithBaseURL(client.BaseURI), 18622 autorest.WithPathParameters("/Faults/Services/{serviceId}/$/GetPartitions/{partitionId}/$/StartDataLoss", pathParameters), 18623 autorest.WithQueryParameters(queryParameters)) 18624 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 18625} 18626 18627// StartDataLossSender sends the StartDataLoss request. The method will close the 18628// http.Response Body if it receives an error. 18629func (client BaseClient) StartDataLossSender(req *http.Request) (*http.Response, error) { 18630 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 18631 return autorest.SendWithSender(client, req, sd...) 18632} 18633 18634// StartDataLossResponder handles the response to the StartDataLoss request. The method always 18635// closes the http.Response Body. 18636func (client BaseClient) StartDataLossResponder(resp *http.Response) (result autorest.Response, err error) { 18637 err = autorest.Respond( 18638 resp, 18639 client.ByInspecting(), 18640 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), 18641 autorest.ByClosing()) 18642 result.Response = resp 18643 return 18644} 18645 18646// StartNodeTransition starts or stops a cluster node. A cluster node is a process, not the OS instance itself. To 18647// start a node, pass in "Start" for the NodeTransitionType parameter. 18648// To stop a node, pass in "Stop" for the NodeTransitionType parameter. This API starts the operation - when the API 18649// returns the node may not have finished transitioning yet. 18650// Call GetNodeTransitionProgress with the same OperationId to get the progress of the operation. 18651// Parameters: 18652// nodeName - the name of the node. 18653// operationID - a GUID that identifies a call of this API. This is passed into the corresponding GetProgress 18654// API 18655// nodeTransitionType - indicates the type of transition to perform. NodeTransitionType.Start will start a 18656// stopped node. NodeTransitionType.Stop will stop a node that is up. 18657// nodeInstanceID - the node instance ID of the target node. This can be determined through GetNodeInfo API. 18658// stopDurationInSeconds - the duration, in seconds, to keep the node stopped. The minimum value is 600, the 18659// maximum is 14400. After this time expires, the node will automatically come back up. 18660// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 18661// duration that the client is willing to wait for the requested operation to complete. The default value for 18662// this parameter is 60 seconds. 18663func (client BaseClient) StartNodeTransition(ctx context.Context, nodeName string, operationID uuid.UUID, nodeTransitionType NodeTransitionType, nodeInstanceID string, stopDurationInSeconds int32, timeout *int64) (result autorest.Response, err error) { 18664 if tracing.IsEnabled() { 18665 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.StartNodeTransition") 18666 defer func() { 18667 sc := -1 18668 if result.Response != nil { 18669 sc = result.Response.StatusCode 18670 } 18671 tracing.EndSpan(ctx, sc, err) 18672 }() 18673 } 18674 if err := validation.Validate([]validation.Validation{ 18675 {TargetValue: stopDurationInSeconds, 18676 Constraints: []validation.Constraint{{Target: "stopDurationInSeconds", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}}}, 18677 {TargetValue: timeout, 18678 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 18679 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 18680 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 18681 }}}}}); err != nil { 18682 return result, validation.NewError("servicefabric.BaseClient", "StartNodeTransition", err.Error()) 18683 } 18684 18685 req, err := client.StartNodeTransitionPreparer(ctx, nodeName, operationID, nodeTransitionType, nodeInstanceID, stopDurationInSeconds, timeout) 18686 if err != nil { 18687 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartNodeTransition", nil, "Failure preparing request") 18688 return 18689 } 18690 18691 resp, err := client.StartNodeTransitionSender(req) 18692 if err != nil { 18693 result.Response = resp 18694 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartNodeTransition", resp, "Failure sending request") 18695 return 18696 } 18697 18698 result, err = client.StartNodeTransitionResponder(resp) 18699 if err != nil { 18700 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartNodeTransition", resp, "Failure responding to request") 18701 } 18702 18703 return 18704} 18705 18706// StartNodeTransitionPreparer prepares the StartNodeTransition request. 18707func (client BaseClient) StartNodeTransitionPreparer(ctx context.Context, nodeName string, operationID uuid.UUID, nodeTransitionType NodeTransitionType, nodeInstanceID string, stopDurationInSeconds int32, timeout *int64) (*http.Request, error) { 18708 pathParameters := map[string]interface{}{ 18709 "nodeName": autorest.Encode("path", nodeName), 18710 } 18711 18712 const APIVersion = "6.0" 18713 queryParameters := map[string]interface{}{ 18714 "api-version": APIVersion, 18715 "NodeInstanceId": autorest.Encode("query", nodeInstanceID), 18716 "NodeTransitionType": autorest.Encode("query", nodeTransitionType), 18717 "OperationId": autorest.Encode("query", operationID), 18718 "StopDurationInSeconds": autorest.Encode("query", stopDurationInSeconds), 18719 } 18720 if timeout != nil { 18721 queryParameters["timeout"] = autorest.Encode("query", *timeout) 18722 } else { 18723 queryParameters["timeout"] = autorest.Encode("query", 60) 18724 } 18725 18726 preparer := autorest.CreatePreparer( 18727 autorest.AsPost(), 18728 autorest.WithBaseURL(client.BaseURI), 18729 autorest.WithPathParameters("/Faults/Nodes/{nodeName}/$/StartTransition/", pathParameters), 18730 autorest.WithQueryParameters(queryParameters)) 18731 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 18732} 18733 18734// StartNodeTransitionSender sends the StartNodeTransition request. The method will close the 18735// http.Response Body if it receives an error. 18736func (client BaseClient) StartNodeTransitionSender(req *http.Request) (*http.Response, error) { 18737 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 18738 return autorest.SendWithSender(client, req, sd...) 18739} 18740 18741// StartNodeTransitionResponder handles the response to the StartNodeTransition request. The method always 18742// closes the http.Response Body. 18743func (client BaseClient) StartNodeTransitionResponder(resp *http.Response) (result autorest.Response, err error) { 18744 err = autorest.Respond( 18745 resp, 18746 client.ByInspecting(), 18747 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), 18748 autorest.ByClosing()) 18749 result.Response = resp 18750 return 18751} 18752 18753// StartPartitionRestart this API is useful for testing failover. 18754// 18755// If used to target a stateless service partition, RestartPartitionMode must be AllReplicasOrInstances. 18756// 18757// Call the GetPartitionRestartProgress API using the same OperationId to get the progress. 18758// Parameters: 18759// serviceID - the identity of the service. This is typically the full name of the service without the 18760// 'fabric:' URI scheme. 18761// Starting from version 6.0, hierarchical names are delimited with the "~" character. 18762// For example, if the service name is "fabric:/myapp/app1/svc1", the service identity would be 18763// "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in previous versions. 18764// partitionID - the identity of the partition. 18765// operationID - a GUID that identifies a call of this API. This is passed into the corresponding GetProgress 18766// API 18767// restartPartitionMode - describe which partitions to restart. 18768// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 18769// duration that the client is willing to wait for the requested operation to complete. The default value for 18770// this parameter is 60 seconds. 18771func (client BaseClient) StartPartitionRestart(ctx context.Context, serviceID string, partitionID uuid.UUID, operationID uuid.UUID, restartPartitionMode RestartPartitionMode, timeout *int64) (result autorest.Response, err error) { 18772 if tracing.IsEnabled() { 18773 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.StartPartitionRestart") 18774 defer func() { 18775 sc := -1 18776 if result.Response != nil { 18777 sc = result.Response.StatusCode 18778 } 18779 tracing.EndSpan(ctx, sc, err) 18780 }() 18781 } 18782 if err := validation.Validate([]validation.Validation{ 18783 {TargetValue: timeout, 18784 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 18785 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 18786 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 18787 }}}}}); err != nil { 18788 return result, validation.NewError("servicefabric.BaseClient", "StartPartitionRestart", err.Error()) 18789 } 18790 18791 req, err := client.StartPartitionRestartPreparer(ctx, serviceID, partitionID, operationID, restartPartitionMode, timeout) 18792 if err != nil { 18793 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartPartitionRestart", nil, "Failure preparing request") 18794 return 18795 } 18796 18797 resp, err := client.StartPartitionRestartSender(req) 18798 if err != nil { 18799 result.Response = resp 18800 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartPartitionRestart", resp, "Failure sending request") 18801 return 18802 } 18803 18804 result, err = client.StartPartitionRestartResponder(resp) 18805 if err != nil { 18806 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartPartitionRestart", resp, "Failure responding to request") 18807 } 18808 18809 return 18810} 18811 18812// StartPartitionRestartPreparer prepares the StartPartitionRestart request. 18813func (client BaseClient) StartPartitionRestartPreparer(ctx context.Context, serviceID string, partitionID uuid.UUID, operationID uuid.UUID, restartPartitionMode RestartPartitionMode, timeout *int64) (*http.Request, error) { 18814 pathParameters := map[string]interface{}{ 18815 "partitionId": partitionID, 18816 "serviceId": serviceID, 18817 } 18818 18819 const APIVersion = "6.0" 18820 queryParameters := map[string]interface{}{ 18821 "api-version": APIVersion, 18822 "OperationId": autorest.Encode("query", operationID), 18823 "RestartPartitionMode": autorest.Encode("query", restartPartitionMode), 18824 } 18825 if timeout != nil { 18826 queryParameters["timeout"] = autorest.Encode("query", *timeout) 18827 } else { 18828 queryParameters["timeout"] = autorest.Encode("query", 60) 18829 } 18830 18831 preparer := autorest.CreatePreparer( 18832 autorest.AsPost(), 18833 autorest.WithBaseURL(client.BaseURI), 18834 autorest.WithPathParameters("/Faults/Services/{serviceId}/$/GetPartitions/{partitionId}/$/StartRestart", pathParameters), 18835 autorest.WithQueryParameters(queryParameters)) 18836 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 18837} 18838 18839// StartPartitionRestartSender sends the StartPartitionRestart request. The method will close the 18840// http.Response Body if it receives an error. 18841func (client BaseClient) StartPartitionRestartSender(req *http.Request) (*http.Response, error) { 18842 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 18843 return autorest.SendWithSender(client, req, sd...) 18844} 18845 18846// StartPartitionRestartResponder handles the response to the StartPartitionRestart request. The method always 18847// closes the http.Response Body. 18848func (client BaseClient) StartPartitionRestartResponder(resp *http.Response) (result autorest.Response, err error) { 18849 err = autorest.Respond( 18850 resp, 18851 client.ByInspecting(), 18852 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), 18853 autorest.ByClosing()) 18854 result.Response = resp 18855 return 18856} 18857 18858// StartQuorumLoss induces quorum loss for a given stateful service partition. This API is useful for a temporary 18859// quorum loss situation on your service. 18860// 18861// Call the GetQuorumLossProgress API with the same OperationId to return information on the operation started with 18862// this API. 18863// 18864// This can only be called on stateful persisted (HasPersistedState==true) services. Do not use this API on stateless 18865// services or stateful in-memory only services. 18866// Parameters: 18867// serviceID - the identity of the service. This is typically the full name of the service without the 18868// 'fabric:' URI scheme. 18869// Starting from version 6.0, hierarchical names are delimited with the "~" character. 18870// For example, if the service name is "fabric:/myapp/app1/svc1", the service identity would be 18871// "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in previous versions. 18872// partitionID - the identity of the partition. 18873// operationID - a GUID that identifies a call of this API. This is passed into the corresponding GetProgress 18874// API 18875// quorumLossMode - this enum is passed to the StartQuorumLoss API to indicate what type of quorum loss to 18876// induce. 18877// quorumLossDuration - the amount of time for which the partition will be kept in quorum loss. This must be 18878// specified in seconds. 18879// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 18880// duration that the client is willing to wait for the requested operation to complete. The default value for 18881// this parameter is 60 seconds. 18882func (client BaseClient) StartQuorumLoss(ctx context.Context, serviceID string, partitionID uuid.UUID, operationID uuid.UUID, quorumLossMode QuorumLossMode, quorumLossDuration int32, timeout *int64) (result autorest.Response, err error) { 18883 if tracing.IsEnabled() { 18884 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.StartQuorumLoss") 18885 defer func() { 18886 sc := -1 18887 if result.Response != nil { 18888 sc = result.Response.StatusCode 18889 } 18890 tracing.EndSpan(ctx, sc, err) 18891 }() 18892 } 18893 if err := validation.Validate([]validation.Validation{ 18894 {TargetValue: timeout, 18895 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 18896 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 18897 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 18898 }}}}}); err != nil { 18899 return result, validation.NewError("servicefabric.BaseClient", "StartQuorumLoss", err.Error()) 18900 } 18901 18902 req, err := client.StartQuorumLossPreparer(ctx, serviceID, partitionID, operationID, quorumLossMode, quorumLossDuration, timeout) 18903 if err != nil { 18904 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartQuorumLoss", nil, "Failure preparing request") 18905 return 18906 } 18907 18908 resp, err := client.StartQuorumLossSender(req) 18909 if err != nil { 18910 result.Response = resp 18911 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartQuorumLoss", resp, "Failure sending request") 18912 return 18913 } 18914 18915 result, err = client.StartQuorumLossResponder(resp) 18916 if err != nil { 18917 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartQuorumLoss", resp, "Failure responding to request") 18918 } 18919 18920 return 18921} 18922 18923// StartQuorumLossPreparer prepares the StartQuorumLoss request. 18924func (client BaseClient) StartQuorumLossPreparer(ctx context.Context, serviceID string, partitionID uuid.UUID, operationID uuid.UUID, quorumLossMode QuorumLossMode, quorumLossDuration int32, timeout *int64) (*http.Request, error) { 18925 pathParameters := map[string]interface{}{ 18926 "partitionId": partitionID, 18927 "serviceId": serviceID, 18928 } 18929 18930 const APIVersion = "6.0" 18931 queryParameters := map[string]interface{}{ 18932 "api-version": APIVersion, 18933 "OperationId": autorest.Encode("query", operationID), 18934 "QuorumLossDuration": autorest.Encode("query", quorumLossDuration), 18935 "QuorumLossMode": autorest.Encode("query", quorumLossMode), 18936 } 18937 if timeout != nil { 18938 queryParameters["timeout"] = autorest.Encode("query", *timeout) 18939 } else { 18940 queryParameters["timeout"] = autorest.Encode("query", 60) 18941 } 18942 18943 preparer := autorest.CreatePreparer( 18944 autorest.AsPost(), 18945 autorest.WithBaseURL(client.BaseURI), 18946 autorest.WithPathParameters("/Faults/Services/{serviceId}/$/GetPartitions/{partitionId}/$/StartQuorumLoss", pathParameters), 18947 autorest.WithQueryParameters(queryParameters)) 18948 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 18949} 18950 18951// StartQuorumLossSender sends the StartQuorumLoss request. The method will close the 18952// http.Response Body if it receives an error. 18953func (client BaseClient) StartQuorumLossSender(req *http.Request) (*http.Response, error) { 18954 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 18955 return autorest.SendWithSender(client, req, sd...) 18956} 18957 18958// StartQuorumLossResponder handles the response to the StartQuorumLoss request. The method always 18959// closes the http.Response Body. 18960func (client BaseClient) StartQuorumLossResponder(resp *http.Response) (result autorest.Response, err error) { 18961 err = autorest.Respond( 18962 resp, 18963 client.ByInspecting(), 18964 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), 18965 autorest.ByClosing()) 18966 result.Response = resp 18967 return 18968} 18969 18970// StopChaos stops Chaos from executing new faults. In-flight faults will continue to execute until they are complete. 18971// The current Chaos Schedule is put into a stopped state. 18972// Once a schedule is stopped it will stay in the stopped state and not be used to Chaos Schedule new runs of Chaos. A 18973// new Chaos Schedule must be set in order to resume scheduling. 18974// Parameters: 18975// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 18976// duration that the client is willing to wait for the requested operation to complete. The default value for 18977// this parameter is 60 seconds. 18978func (client BaseClient) StopChaos(ctx context.Context, timeout *int64) (result autorest.Response, err error) { 18979 if tracing.IsEnabled() { 18980 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.StopChaos") 18981 defer func() { 18982 sc := -1 18983 if result.Response != nil { 18984 sc = result.Response.StatusCode 18985 } 18986 tracing.EndSpan(ctx, sc, err) 18987 }() 18988 } 18989 if err := validation.Validate([]validation.Validation{ 18990 {TargetValue: timeout, 18991 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 18992 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 18993 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 18994 }}}}}); err != nil { 18995 return result, validation.NewError("servicefabric.BaseClient", "StopChaos", err.Error()) 18996 } 18997 18998 req, err := client.StopChaosPreparer(ctx, timeout) 18999 if err != nil { 19000 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StopChaos", nil, "Failure preparing request") 19001 return 19002 } 19003 19004 resp, err := client.StopChaosSender(req) 19005 if err != nil { 19006 result.Response = resp 19007 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StopChaos", resp, "Failure sending request") 19008 return 19009 } 19010 19011 result, err = client.StopChaosResponder(resp) 19012 if err != nil { 19013 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StopChaos", resp, "Failure responding to request") 19014 } 19015 19016 return 19017} 19018 19019// StopChaosPreparer prepares the StopChaos request. 19020func (client BaseClient) StopChaosPreparer(ctx context.Context, timeout *int64) (*http.Request, error) { 19021 const APIVersion = "6.0" 19022 queryParameters := map[string]interface{}{ 19023 "api-version": APIVersion, 19024 } 19025 if timeout != nil { 19026 queryParameters["timeout"] = autorest.Encode("query", *timeout) 19027 } else { 19028 queryParameters["timeout"] = autorest.Encode("query", 60) 19029 } 19030 19031 preparer := autorest.CreatePreparer( 19032 autorest.AsPost(), 19033 autorest.WithBaseURL(client.BaseURI), 19034 autorest.WithPath("/Tools/Chaos/$/Stop"), 19035 autorest.WithQueryParameters(queryParameters)) 19036 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 19037} 19038 19039// StopChaosSender sends the StopChaos request. The method will close the 19040// http.Response Body if it receives an error. 19041func (client BaseClient) StopChaosSender(req *http.Request) (*http.Response, error) { 19042 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 19043 return autorest.SendWithSender(client, req, sd...) 19044} 19045 19046// StopChaosResponder handles the response to the StopChaos request. The method always 19047// closes the http.Response Body. 19048func (client BaseClient) StopChaosResponder(resp *http.Response) (result autorest.Response, err error) { 19049 err = autorest.Respond( 19050 resp, 19051 client.ByInspecting(), 19052 azure.WithErrorUnlessStatusCode(http.StatusOK), 19053 autorest.ByClosing()) 19054 result.Response = resp 19055 return 19056} 19057 19058// SubmitPropertyBatch submits a batch of property operations. Either all or none of the operations will be committed. 19059// Parameters: 19060// nameID - the Service Fabric name, without the 'fabric:' URI scheme. 19061// propertyBatchDescriptionList - describes the property batch operations to be submitted. 19062// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 19063// duration that the client is willing to wait for the requested operation to complete. The default value for 19064// this parameter is 60 seconds. 19065func (client BaseClient) SubmitPropertyBatch(ctx context.Context, nameID string, propertyBatchDescriptionList PropertyBatchDescriptionList, timeout *int64) (result PropertyBatchInfoModel, err error) { 19066 if tracing.IsEnabled() { 19067 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.SubmitPropertyBatch") 19068 defer func() { 19069 sc := -1 19070 if result.Response.Response != nil { 19071 sc = result.Response.Response.StatusCode 19072 } 19073 tracing.EndSpan(ctx, sc, err) 19074 }() 19075 } 19076 if err := validation.Validate([]validation.Validation{ 19077 {TargetValue: timeout, 19078 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 19079 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 19080 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 19081 }}}}}); err != nil { 19082 return result, validation.NewError("servicefabric.BaseClient", "SubmitPropertyBatch", err.Error()) 19083 } 19084 19085 req, err := client.SubmitPropertyBatchPreparer(ctx, nameID, propertyBatchDescriptionList, timeout) 19086 if err != nil { 19087 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "SubmitPropertyBatch", nil, "Failure preparing request") 19088 return 19089 } 19090 19091 resp, err := client.SubmitPropertyBatchSender(req) 19092 if err != nil { 19093 result.Response = autorest.Response{Response: resp} 19094 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "SubmitPropertyBatch", resp, "Failure sending request") 19095 return 19096 } 19097 19098 result, err = client.SubmitPropertyBatchResponder(resp) 19099 if err != nil { 19100 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "SubmitPropertyBatch", resp, "Failure responding to request") 19101 } 19102 19103 return 19104} 19105 19106// SubmitPropertyBatchPreparer prepares the SubmitPropertyBatch request. 19107func (client BaseClient) SubmitPropertyBatchPreparer(ctx context.Context, nameID string, propertyBatchDescriptionList PropertyBatchDescriptionList, timeout *int64) (*http.Request, error) { 19108 pathParameters := map[string]interface{}{ 19109 "nameId": nameID, 19110 } 19111 19112 const APIVersion = "6.0" 19113 queryParameters := map[string]interface{}{ 19114 "api-version": APIVersion, 19115 } 19116 if timeout != nil { 19117 queryParameters["timeout"] = autorest.Encode("query", *timeout) 19118 } else { 19119 queryParameters["timeout"] = autorest.Encode("query", 60) 19120 } 19121 19122 preparer := autorest.CreatePreparer( 19123 autorest.AsContentType("application/json; charset=utf-8"), 19124 autorest.AsPost(), 19125 autorest.WithBaseURL(client.BaseURI), 19126 autorest.WithPathParameters("/Names/{nameId}/$/GetProperties/$/SubmitBatch", pathParameters), 19127 autorest.WithJSON(propertyBatchDescriptionList), 19128 autorest.WithQueryParameters(queryParameters)) 19129 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 19130} 19131 19132// SubmitPropertyBatchSender sends the SubmitPropertyBatch request. The method will close the 19133// http.Response Body if it receives an error. 19134func (client BaseClient) SubmitPropertyBatchSender(req *http.Request) (*http.Response, error) { 19135 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 19136 return autorest.SendWithSender(client, req, sd...) 19137} 19138 19139// SubmitPropertyBatchResponder handles the response to the SubmitPropertyBatch request. The method always 19140// closes the http.Response Body. 19141func (client BaseClient) SubmitPropertyBatchResponder(resp *http.Response) (result PropertyBatchInfoModel, err error) { 19142 err = autorest.Respond( 19143 resp, 19144 client.ByInspecting(), 19145 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusConflict), 19146 autorest.ByUnmarshallingJSON(&result), 19147 autorest.ByClosing()) 19148 result.Response = autorest.Response{Response: resp} 19149 return 19150} 19151 19152// SuspendApplicationBackup the application which is configured to take periodic backups, is suspended for taking 19153// further backups till it is resumed again. This operation applies to the entire application's hierarchy. It means all 19154// the services and partitions under this application are now suspended for backup. 19155// Parameters: 19156// applicationID - the identity of the application. This is typically the full name of the application without 19157// the 'fabric:' URI scheme. 19158// Starting from version 6.0, hierarchical names are delimited with the "~" character. 19159// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" 19160// in 6.0+ and "myapp/app1" in previous versions. 19161// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 19162// duration that the client is willing to wait for the requested operation to complete. The default value for 19163// this parameter is 60 seconds. 19164func (client BaseClient) SuspendApplicationBackup(ctx context.Context, applicationID string, timeout *int64) (result autorest.Response, err error) { 19165 if tracing.IsEnabled() { 19166 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.SuspendApplicationBackup") 19167 defer func() { 19168 sc := -1 19169 if result.Response != nil { 19170 sc = result.Response.StatusCode 19171 } 19172 tracing.EndSpan(ctx, sc, err) 19173 }() 19174 } 19175 if err := validation.Validate([]validation.Validation{ 19176 {TargetValue: timeout, 19177 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 19178 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 19179 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 19180 }}}}}); err != nil { 19181 return result, validation.NewError("servicefabric.BaseClient", "SuspendApplicationBackup", err.Error()) 19182 } 19183 19184 req, err := client.SuspendApplicationBackupPreparer(ctx, applicationID, timeout) 19185 if err != nil { 19186 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "SuspendApplicationBackup", nil, "Failure preparing request") 19187 return 19188 } 19189 19190 resp, err := client.SuspendApplicationBackupSender(req) 19191 if err != nil { 19192 result.Response = resp 19193 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "SuspendApplicationBackup", resp, "Failure sending request") 19194 return 19195 } 19196 19197 result, err = client.SuspendApplicationBackupResponder(resp) 19198 if err != nil { 19199 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "SuspendApplicationBackup", resp, "Failure responding to request") 19200 } 19201 19202 return 19203} 19204 19205// SuspendApplicationBackupPreparer prepares the SuspendApplicationBackup request. 19206func (client BaseClient) SuspendApplicationBackupPreparer(ctx context.Context, applicationID string, timeout *int64) (*http.Request, error) { 19207 pathParameters := map[string]interface{}{ 19208 "applicationId": applicationID, 19209 } 19210 19211 const APIVersion = "6.2-preview" 19212 queryParameters := map[string]interface{}{ 19213 "api-version": APIVersion, 19214 } 19215 if timeout != nil { 19216 queryParameters["timeout"] = autorest.Encode("query", *timeout) 19217 } else { 19218 queryParameters["timeout"] = autorest.Encode("query", 60) 19219 } 19220 19221 preparer := autorest.CreatePreparer( 19222 autorest.AsPost(), 19223 autorest.WithBaseURL(client.BaseURI), 19224 autorest.WithPathParameters("/Applications/{applicationId}/$/SuspendBackup", pathParameters), 19225 autorest.WithQueryParameters(queryParameters)) 19226 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 19227} 19228 19229// SuspendApplicationBackupSender sends the SuspendApplicationBackup request. The method will close the 19230// http.Response Body if it receives an error. 19231func (client BaseClient) SuspendApplicationBackupSender(req *http.Request) (*http.Response, error) { 19232 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 19233 return autorest.SendWithSender(client, req, sd...) 19234} 19235 19236// SuspendApplicationBackupResponder handles the response to the SuspendApplicationBackup request. The method always 19237// closes the http.Response Body. 19238func (client BaseClient) SuspendApplicationBackupResponder(resp *http.Response) (result autorest.Response, err error) { 19239 err = autorest.Respond( 19240 resp, 19241 client.ByInspecting(), 19242 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), 19243 autorest.ByClosing()) 19244 result.Response = resp 19245 return 19246} 19247 19248// SuspendPartitionBackup the partition which is configured to take periodic backups, is suspended for taking further 19249// backups till it is resumed again. 19250// Parameters: 19251// partitionID - the identity of the partition. 19252// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 19253// duration that the client is willing to wait for the requested operation to complete. The default value for 19254// this parameter is 60 seconds. 19255func (client BaseClient) SuspendPartitionBackup(ctx context.Context, partitionID uuid.UUID, timeout *int64) (result autorest.Response, err error) { 19256 if tracing.IsEnabled() { 19257 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.SuspendPartitionBackup") 19258 defer func() { 19259 sc := -1 19260 if result.Response != nil { 19261 sc = result.Response.StatusCode 19262 } 19263 tracing.EndSpan(ctx, sc, err) 19264 }() 19265 } 19266 if err := validation.Validate([]validation.Validation{ 19267 {TargetValue: timeout, 19268 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 19269 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 19270 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 19271 }}}}}); err != nil { 19272 return result, validation.NewError("servicefabric.BaseClient", "SuspendPartitionBackup", err.Error()) 19273 } 19274 19275 req, err := client.SuspendPartitionBackupPreparer(ctx, partitionID, timeout) 19276 if err != nil { 19277 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "SuspendPartitionBackup", nil, "Failure preparing request") 19278 return 19279 } 19280 19281 resp, err := client.SuspendPartitionBackupSender(req) 19282 if err != nil { 19283 result.Response = resp 19284 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "SuspendPartitionBackup", resp, "Failure sending request") 19285 return 19286 } 19287 19288 result, err = client.SuspendPartitionBackupResponder(resp) 19289 if err != nil { 19290 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "SuspendPartitionBackup", resp, "Failure responding to request") 19291 } 19292 19293 return 19294} 19295 19296// SuspendPartitionBackupPreparer prepares the SuspendPartitionBackup request. 19297func (client BaseClient) SuspendPartitionBackupPreparer(ctx context.Context, partitionID uuid.UUID, timeout *int64) (*http.Request, error) { 19298 pathParameters := map[string]interface{}{ 19299 "partitionId": partitionID, 19300 } 19301 19302 const APIVersion = "6.2-preview" 19303 queryParameters := map[string]interface{}{ 19304 "api-version": APIVersion, 19305 } 19306 if timeout != nil { 19307 queryParameters["timeout"] = autorest.Encode("query", *timeout) 19308 } else { 19309 queryParameters["timeout"] = autorest.Encode("query", 60) 19310 } 19311 19312 preparer := autorest.CreatePreparer( 19313 autorest.AsPost(), 19314 autorest.WithBaseURL(client.BaseURI), 19315 autorest.WithPathParameters("/Partitions/{partitionId}/$/SuspendBackup", pathParameters), 19316 autorest.WithQueryParameters(queryParameters)) 19317 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 19318} 19319 19320// SuspendPartitionBackupSender sends the SuspendPartitionBackup request. The method will close the 19321// http.Response Body if it receives an error. 19322func (client BaseClient) SuspendPartitionBackupSender(req *http.Request) (*http.Response, error) { 19323 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 19324 return autorest.SendWithSender(client, req, sd...) 19325} 19326 19327// SuspendPartitionBackupResponder handles the response to the SuspendPartitionBackup request. The method always 19328// closes the http.Response Body. 19329func (client BaseClient) SuspendPartitionBackupResponder(resp *http.Response) (result autorest.Response, err error) { 19330 err = autorest.Respond( 19331 resp, 19332 client.ByInspecting(), 19333 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), 19334 autorest.ByClosing()) 19335 result.Response = resp 19336 return 19337} 19338 19339// SuspendServiceBackup the service which is configured to take periodic backups, is suspended for taking further 19340// backups till it is resumed again. This operation applies to the entire service's hierarchy. It means all the 19341// partitions under this service are now suspended for backup. 19342// Parameters: 19343// serviceID - the identity of the service. This is typically the full name of the service without the 19344// 'fabric:' URI scheme. 19345// Starting from version 6.0, hierarchical names are delimited with the "~" character. 19346// For example, if the service name is "fabric:/myapp/app1/svc1", the service identity would be 19347// "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in previous versions. 19348// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 19349// duration that the client is willing to wait for the requested operation to complete. The default value for 19350// this parameter is 60 seconds. 19351func (client BaseClient) SuspendServiceBackup(ctx context.Context, serviceID string, timeout *int64) (result autorest.Response, err error) { 19352 if tracing.IsEnabled() { 19353 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.SuspendServiceBackup") 19354 defer func() { 19355 sc := -1 19356 if result.Response != nil { 19357 sc = result.Response.StatusCode 19358 } 19359 tracing.EndSpan(ctx, sc, err) 19360 }() 19361 } 19362 if err := validation.Validate([]validation.Validation{ 19363 {TargetValue: timeout, 19364 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 19365 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 19366 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 19367 }}}}}); err != nil { 19368 return result, validation.NewError("servicefabric.BaseClient", "SuspendServiceBackup", err.Error()) 19369 } 19370 19371 req, err := client.SuspendServiceBackupPreparer(ctx, serviceID, timeout) 19372 if err != nil { 19373 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "SuspendServiceBackup", nil, "Failure preparing request") 19374 return 19375 } 19376 19377 resp, err := client.SuspendServiceBackupSender(req) 19378 if err != nil { 19379 result.Response = resp 19380 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "SuspendServiceBackup", resp, "Failure sending request") 19381 return 19382 } 19383 19384 result, err = client.SuspendServiceBackupResponder(resp) 19385 if err != nil { 19386 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "SuspendServiceBackup", resp, "Failure responding to request") 19387 } 19388 19389 return 19390} 19391 19392// SuspendServiceBackupPreparer prepares the SuspendServiceBackup request. 19393func (client BaseClient) SuspendServiceBackupPreparer(ctx context.Context, serviceID string, timeout *int64) (*http.Request, error) { 19394 pathParameters := map[string]interface{}{ 19395 "serviceId": serviceID, 19396 } 19397 19398 const APIVersion = "6.2-preview" 19399 queryParameters := map[string]interface{}{ 19400 "api-version": APIVersion, 19401 } 19402 if timeout != nil { 19403 queryParameters["timeout"] = autorest.Encode("query", *timeout) 19404 } else { 19405 queryParameters["timeout"] = autorest.Encode("query", 60) 19406 } 19407 19408 preparer := autorest.CreatePreparer( 19409 autorest.AsPost(), 19410 autorest.WithBaseURL(client.BaseURI), 19411 autorest.WithPathParameters("/Services/{serviceId}/$/SuspendBackup", pathParameters), 19412 autorest.WithQueryParameters(queryParameters)) 19413 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 19414} 19415 19416// SuspendServiceBackupSender sends the SuspendServiceBackup request. The method will close the 19417// http.Response Body if it receives an error. 19418func (client BaseClient) SuspendServiceBackupSender(req *http.Request) (*http.Response, error) { 19419 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 19420 return autorest.SendWithSender(client, req, sd...) 19421} 19422 19423// SuspendServiceBackupResponder handles the response to the SuspendServiceBackup request. The method always 19424// closes the http.Response Body. 19425func (client BaseClient) SuspendServiceBackupResponder(resp *http.Response) (result autorest.Response, err error) { 19426 err = autorest.Respond( 19427 resp, 19428 client.ByInspecting(), 19429 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), 19430 autorest.ByClosing()) 19431 result.Response = resp 19432 return 19433} 19434 19435// UnprovisionApplicationType removes or unregisters a Service Fabric application type from the cluster. This operation 19436// can only be performed if all application instances of the application type has been deleted. Once the application 19437// type is unregistered, no new application instances can be created for this particular application type. 19438// Parameters: 19439// applicationTypeName - the name of the application type. 19440// unprovisionApplicationTypeDescriptionInfo - the relative path for the application package in the image store 19441// specified during the prior copy operation. 19442// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 19443// duration that the client is willing to wait for the requested operation to complete. The default value for 19444// this parameter is 60 seconds. 19445func (client BaseClient) UnprovisionApplicationType(ctx context.Context, applicationTypeName string, unprovisionApplicationTypeDescriptionInfo UnprovisionApplicationTypeDescriptionInfo, timeout *int64) (result autorest.Response, err error) { 19446 if tracing.IsEnabled() { 19447 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.UnprovisionApplicationType") 19448 defer func() { 19449 sc := -1 19450 if result.Response != nil { 19451 sc = result.Response.StatusCode 19452 } 19453 tracing.EndSpan(ctx, sc, err) 19454 }() 19455 } 19456 if err := validation.Validate([]validation.Validation{ 19457 {TargetValue: unprovisionApplicationTypeDescriptionInfo, 19458 Constraints: []validation.Constraint{{Target: "unprovisionApplicationTypeDescriptionInfo.ApplicationTypeVersion", Name: validation.Null, Rule: true, Chain: nil}}}, 19459 {TargetValue: timeout, 19460 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 19461 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 19462 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 19463 }}}}}); err != nil { 19464 return result, validation.NewError("servicefabric.BaseClient", "UnprovisionApplicationType", err.Error()) 19465 } 19466 19467 req, err := client.UnprovisionApplicationTypePreparer(ctx, applicationTypeName, unprovisionApplicationTypeDescriptionInfo, timeout) 19468 if err != nil { 19469 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UnprovisionApplicationType", nil, "Failure preparing request") 19470 return 19471 } 19472 19473 resp, err := client.UnprovisionApplicationTypeSender(req) 19474 if err != nil { 19475 result.Response = resp 19476 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UnprovisionApplicationType", resp, "Failure sending request") 19477 return 19478 } 19479 19480 result, err = client.UnprovisionApplicationTypeResponder(resp) 19481 if err != nil { 19482 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UnprovisionApplicationType", resp, "Failure responding to request") 19483 } 19484 19485 return 19486} 19487 19488// UnprovisionApplicationTypePreparer prepares the UnprovisionApplicationType request. 19489func (client BaseClient) UnprovisionApplicationTypePreparer(ctx context.Context, applicationTypeName string, unprovisionApplicationTypeDescriptionInfo UnprovisionApplicationTypeDescriptionInfo, timeout *int64) (*http.Request, error) { 19490 pathParameters := map[string]interface{}{ 19491 "applicationTypeName": autorest.Encode("path", applicationTypeName), 19492 } 19493 19494 const APIVersion = "6.0" 19495 queryParameters := map[string]interface{}{ 19496 "api-version": APIVersion, 19497 } 19498 if timeout != nil { 19499 queryParameters["timeout"] = autorest.Encode("query", *timeout) 19500 } else { 19501 queryParameters["timeout"] = autorest.Encode("query", 60) 19502 } 19503 19504 preparer := autorest.CreatePreparer( 19505 autorest.AsContentType("application/json; charset=utf-8"), 19506 autorest.AsPost(), 19507 autorest.WithBaseURL(client.BaseURI), 19508 autorest.WithPathParameters("/ApplicationTypes/{applicationTypeName}/$/Unprovision", pathParameters), 19509 autorest.WithJSON(unprovisionApplicationTypeDescriptionInfo), 19510 autorest.WithQueryParameters(queryParameters)) 19511 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 19512} 19513 19514// UnprovisionApplicationTypeSender sends the UnprovisionApplicationType request. The method will close the 19515// http.Response Body if it receives an error. 19516func (client BaseClient) UnprovisionApplicationTypeSender(req *http.Request) (*http.Response, error) { 19517 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 19518 return autorest.SendWithSender(client, req, sd...) 19519} 19520 19521// UnprovisionApplicationTypeResponder handles the response to the UnprovisionApplicationType request. The method always 19522// closes the http.Response Body. 19523func (client BaseClient) UnprovisionApplicationTypeResponder(resp *http.Response) (result autorest.Response, err error) { 19524 err = autorest.Respond( 19525 resp, 19526 client.ByInspecting(), 19527 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), 19528 autorest.ByClosing()) 19529 result.Response = resp 19530 return 19531} 19532 19533// UnprovisionCluster unprovision the code or configuration packages of a Service Fabric cluster. It is supported to 19534// unprovision code and configuration separately. 19535// Parameters: 19536// unprovisionFabricDescription - describes the parameters for unprovisioning a cluster. 19537// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 19538// duration that the client is willing to wait for the requested operation to complete. The default value for 19539// this parameter is 60 seconds. 19540func (client BaseClient) UnprovisionCluster(ctx context.Context, unprovisionFabricDescription UnprovisionFabricDescription, timeout *int64) (result autorest.Response, err error) { 19541 if tracing.IsEnabled() { 19542 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.UnprovisionCluster") 19543 defer func() { 19544 sc := -1 19545 if result.Response != nil { 19546 sc = result.Response.StatusCode 19547 } 19548 tracing.EndSpan(ctx, sc, err) 19549 }() 19550 } 19551 if err := validation.Validate([]validation.Validation{ 19552 {TargetValue: timeout, 19553 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 19554 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 19555 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 19556 }}}}}); err != nil { 19557 return result, validation.NewError("servicefabric.BaseClient", "UnprovisionCluster", err.Error()) 19558 } 19559 19560 req, err := client.UnprovisionClusterPreparer(ctx, unprovisionFabricDescription, timeout) 19561 if err != nil { 19562 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UnprovisionCluster", nil, "Failure preparing request") 19563 return 19564 } 19565 19566 resp, err := client.UnprovisionClusterSender(req) 19567 if err != nil { 19568 result.Response = resp 19569 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UnprovisionCluster", resp, "Failure sending request") 19570 return 19571 } 19572 19573 result, err = client.UnprovisionClusterResponder(resp) 19574 if err != nil { 19575 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UnprovisionCluster", resp, "Failure responding to request") 19576 } 19577 19578 return 19579} 19580 19581// UnprovisionClusterPreparer prepares the UnprovisionCluster request. 19582func (client BaseClient) UnprovisionClusterPreparer(ctx context.Context, unprovisionFabricDescription UnprovisionFabricDescription, timeout *int64) (*http.Request, error) { 19583 const APIVersion = "6.0" 19584 queryParameters := map[string]interface{}{ 19585 "api-version": APIVersion, 19586 } 19587 if timeout != nil { 19588 queryParameters["timeout"] = autorest.Encode("query", *timeout) 19589 } else { 19590 queryParameters["timeout"] = autorest.Encode("query", 60) 19591 } 19592 19593 preparer := autorest.CreatePreparer( 19594 autorest.AsContentType("application/json; charset=utf-8"), 19595 autorest.AsPost(), 19596 autorest.WithBaseURL(client.BaseURI), 19597 autorest.WithPath("/$/Unprovision"), 19598 autorest.WithJSON(unprovisionFabricDescription), 19599 autorest.WithQueryParameters(queryParameters)) 19600 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 19601} 19602 19603// UnprovisionClusterSender sends the UnprovisionCluster request. The method will close the 19604// http.Response Body if it receives an error. 19605func (client BaseClient) UnprovisionClusterSender(req *http.Request) (*http.Response, error) { 19606 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 19607 return autorest.SendWithSender(client, req, sd...) 19608} 19609 19610// UnprovisionClusterResponder handles the response to the UnprovisionCluster request. The method always 19611// closes the http.Response Body. 19612func (client BaseClient) UnprovisionClusterResponder(resp *http.Response) (result autorest.Response, err error) { 19613 err = autorest.Respond( 19614 resp, 19615 client.ByInspecting(), 19616 azure.WithErrorUnlessStatusCode(http.StatusOK), 19617 autorest.ByClosing()) 19618 result.Response = resp 19619 return 19620} 19621 19622// UpdateApplicationUpgrade updates the parameters of an ongoing application upgrade from the ones specified at the 19623// time of starting the application upgrade. This may be required to mitigate stuck application upgrades due to 19624// incorrect parameters or issues in the application to make progress. 19625// Parameters: 19626// applicationID - the identity of the application. This is typically the full name of the application without 19627// the 'fabric:' URI scheme. 19628// Starting from version 6.0, hierarchical names are delimited with the "~" character. 19629// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" 19630// in 6.0+ and "myapp/app1" in previous versions. 19631// applicationUpgradeUpdateDescription - parameters for updating an existing application upgrade. 19632// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 19633// duration that the client is willing to wait for the requested operation to complete. The default value for 19634// this parameter is 60 seconds. 19635func (client BaseClient) UpdateApplicationUpgrade(ctx context.Context, applicationID string, applicationUpgradeUpdateDescription ApplicationUpgradeUpdateDescription, timeout *int64) (result autorest.Response, err error) { 19636 if tracing.IsEnabled() { 19637 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.UpdateApplicationUpgrade") 19638 defer func() { 19639 sc := -1 19640 if result.Response != nil { 19641 sc = result.Response.StatusCode 19642 } 19643 tracing.EndSpan(ctx, sc, err) 19644 }() 19645 } 19646 if err := validation.Validate([]validation.Validation{ 19647 {TargetValue: applicationUpgradeUpdateDescription, 19648 Constraints: []validation.Constraint{{Target: "applicationUpgradeUpdateDescription.Name", Name: validation.Null, Rule: true, Chain: nil}}}, 19649 {TargetValue: timeout, 19650 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 19651 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 19652 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 19653 }}}}}); err != nil { 19654 return result, validation.NewError("servicefabric.BaseClient", "UpdateApplicationUpgrade", err.Error()) 19655 } 19656 19657 req, err := client.UpdateApplicationUpgradePreparer(ctx, applicationID, applicationUpgradeUpdateDescription, timeout) 19658 if err != nil { 19659 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UpdateApplicationUpgrade", nil, "Failure preparing request") 19660 return 19661 } 19662 19663 resp, err := client.UpdateApplicationUpgradeSender(req) 19664 if err != nil { 19665 result.Response = resp 19666 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UpdateApplicationUpgrade", resp, "Failure sending request") 19667 return 19668 } 19669 19670 result, err = client.UpdateApplicationUpgradeResponder(resp) 19671 if err != nil { 19672 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UpdateApplicationUpgrade", resp, "Failure responding to request") 19673 } 19674 19675 return 19676} 19677 19678// UpdateApplicationUpgradePreparer prepares the UpdateApplicationUpgrade request. 19679func (client BaseClient) UpdateApplicationUpgradePreparer(ctx context.Context, applicationID string, applicationUpgradeUpdateDescription ApplicationUpgradeUpdateDescription, timeout *int64) (*http.Request, error) { 19680 pathParameters := map[string]interface{}{ 19681 "applicationId": applicationID, 19682 } 19683 19684 const APIVersion = "6.0" 19685 queryParameters := map[string]interface{}{ 19686 "api-version": APIVersion, 19687 } 19688 if timeout != nil { 19689 queryParameters["timeout"] = autorest.Encode("query", *timeout) 19690 } else { 19691 queryParameters["timeout"] = autorest.Encode("query", 60) 19692 } 19693 19694 preparer := autorest.CreatePreparer( 19695 autorest.AsContentType("application/json; charset=utf-8"), 19696 autorest.AsPost(), 19697 autorest.WithBaseURL(client.BaseURI), 19698 autorest.WithPathParameters("/Applications/{applicationId}/$/UpdateUpgrade", pathParameters), 19699 autorest.WithJSON(applicationUpgradeUpdateDescription), 19700 autorest.WithQueryParameters(queryParameters)) 19701 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 19702} 19703 19704// UpdateApplicationUpgradeSender sends the UpdateApplicationUpgrade request. The method will close the 19705// http.Response Body if it receives an error. 19706func (client BaseClient) UpdateApplicationUpgradeSender(req *http.Request) (*http.Response, error) { 19707 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 19708 return autorest.SendWithSender(client, req, sd...) 19709} 19710 19711// UpdateApplicationUpgradeResponder handles the response to the UpdateApplicationUpgrade request. The method always 19712// closes the http.Response Body. 19713func (client BaseClient) UpdateApplicationUpgradeResponder(resp *http.Response) (result autorest.Response, err error) { 19714 err = autorest.Respond( 19715 resp, 19716 client.ByInspecting(), 19717 azure.WithErrorUnlessStatusCode(http.StatusOK), 19718 autorest.ByClosing()) 19719 result.Response = resp 19720 return 19721} 19722 19723// UpdateBackupPolicy updates the backup policy identified by {backupPolicyName} 19724// Parameters: 19725// backupPolicyDescription - describes the backup policy. 19726// backupPolicyName - the name of the backup policy. 19727// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 19728// duration that the client is willing to wait for the requested operation to complete. The default value for 19729// this parameter is 60 seconds. 19730func (client BaseClient) UpdateBackupPolicy(ctx context.Context, backupPolicyDescription BackupPolicyDescription, backupPolicyName string, timeout *int64) (result autorest.Response, err error) { 19731 if tracing.IsEnabled() { 19732 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.UpdateBackupPolicy") 19733 defer func() { 19734 sc := -1 19735 if result.Response != nil { 19736 sc = result.Response.StatusCode 19737 } 19738 tracing.EndSpan(ctx, sc, err) 19739 }() 19740 } 19741 if err := validation.Validate([]validation.Validation{ 19742 {TargetValue: backupPolicyDescription, 19743 Constraints: []validation.Constraint{{Target: "backupPolicyDescription.Name", Name: validation.Null, Rule: true, Chain: nil}, 19744 {Target: "backupPolicyDescription.AutoRestoreOnDataLoss", Name: validation.Null, Rule: true, Chain: nil}, 19745 {Target: "backupPolicyDescription.MaxIncrementalBackups", Name: validation.Null, Rule: true, 19746 Chain: []validation.Constraint{{Target: "backupPolicyDescription.MaxIncrementalBackups", Name: validation.InclusiveMaximum, Rule: int64(255), Chain: nil}, 19747 {Target: "backupPolicyDescription.MaxIncrementalBackups", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}, 19748 }}, 19749 {Target: "backupPolicyDescription.Schedule", Name: validation.Null, Rule: true, Chain: nil}, 19750 {Target: "backupPolicyDescription.Storage", Name: validation.Null, Rule: true, Chain: nil}}}, 19751 {TargetValue: timeout, 19752 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 19753 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 19754 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 19755 }}}}}); err != nil { 19756 return result, validation.NewError("servicefabric.BaseClient", "UpdateBackupPolicy", err.Error()) 19757 } 19758 19759 req, err := client.UpdateBackupPolicyPreparer(ctx, backupPolicyDescription, backupPolicyName, timeout) 19760 if err != nil { 19761 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UpdateBackupPolicy", nil, "Failure preparing request") 19762 return 19763 } 19764 19765 resp, err := client.UpdateBackupPolicySender(req) 19766 if err != nil { 19767 result.Response = resp 19768 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UpdateBackupPolicy", resp, "Failure sending request") 19769 return 19770 } 19771 19772 result, err = client.UpdateBackupPolicyResponder(resp) 19773 if err != nil { 19774 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UpdateBackupPolicy", resp, "Failure responding to request") 19775 } 19776 19777 return 19778} 19779 19780// UpdateBackupPolicyPreparer prepares the UpdateBackupPolicy request. 19781func (client BaseClient) UpdateBackupPolicyPreparer(ctx context.Context, backupPolicyDescription BackupPolicyDescription, backupPolicyName string, timeout *int64) (*http.Request, error) { 19782 pathParameters := map[string]interface{}{ 19783 "backupPolicyName": autorest.Encode("path", backupPolicyName), 19784 } 19785 19786 const APIVersion = "6.2-preview" 19787 queryParameters := map[string]interface{}{ 19788 "api-version": APIVersion, 19789 } 19790 if timeout != nil { 19791 queryParameters["timeout"] = autorest.Encode("query", *timeout) 19792 } else { 19793 queryParameters["timeout"] = autorest.Encode("query", 60) 19794 } 19795 19796 preparer := autorest.CreatePreparer( 19797 autorest.AsContentType("application/json; charset=utf-8"), 19798 autorest.AsPost(), 19799 autorest.WithBaseURL(client.BaseURI), 19800 autorest.WithPathParameters("/BackupRestore/BackupPolicies/{backupPolicyName}/$/Update", pathParameters), 19801 autorest.WithJSON(backupPolicyDescription), 19802 autorest.WithQueryParameters(queryParameters)) 19803 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 19804} 19805 19806// UpdateBackupPolicySender sends the UpdateBackupPolicy request. The method will close the 19807// http.Response Body if it receives an error. 19808func (client BaseClient) UpdateBackupPolicySender(req *http.Request) (*http.Response, error) { 19809 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 19810 return autorest.SendWithSender(client, req, sd...) 19811} 19812 19813// UpdateBackupPolicyResponder handles the response to the UpdateBackupPolicy request. The method always 19814// closes the http.Response Body. 19815func (client BaseClient) UpdateBackupPolicyResponder(resp *http.Response) (result autorest.Response, err error) { 19816 err = autorest.Respond( 19817 resp, 19818 client.ByInspecting(), 19819 azure.WithErrorUnlessStatusCode(http.StatusOK), 19820 autorest.ByClosing()) 19821 result.Response = resp 19822 return 19823} 19824 19825// UpdateClusterUpgrade update the upgrade parameters used during a Service Fabric cluster upgrade. 19826// Parameters: 19827// updateClusterUpgradeDescription - parameters for updating a cluster upgrade. 19828// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 19829// duration that the client is willing to wait for the requested operation to complete. The default value for 19830// this parameter is 60 seconds. 19831func (client BaseClient) UpdateClusterUpgrade(ctx context.Context, updateClusterUpgradeDescription UpdateClusterUpgradeDescription, timeout *int64) (result autorest.Response, err error) { 19832 if tracing.IsEnabled() { 19833 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.UpdateClusterUpgrade") 19834 defer func() { 19835 sc := -1 19836 if result.Response != nil { 19837 sc = result.Response.StatusCode 19838 } 19839 tracing.EndSpan(ctx, sc, err) 19840 }() 19841 } 19842 if err := validation.Validate([]validation.Validation{ 19843 {TargetValue: updateClusterUpgradeDescription, 19844 Constraints: []validation.Constraint{{Target: "updateClusterUpgradeDescription.ClusterUpgradeHealthPolicy", Name: validation.Null, Rule: false, 19845 Chain: []validation.Constraint{{Target: "updateClusterUpgradeDescription.ClusterUpgradeHealthPolicy.MaxPercentDeltaUnhealthyNodes", Name: validation.Null, Rule: false, 19846 Chain: []validation.Constraint{{Target: "updateClusterUpgradeDescription.ClusterUpgradeHealthPolicy.MaxPercentDeltaUnhealthyNodes", Name: validation.InclusiveMaximum, Rule: int64(100), Chain: nil}, 19847 {Target: "updateClusterUpgradeDescription.ClusterUpgradeHealthPolicy.MaxPercentDeltaUnhealthyNodes", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}, 19848 }}, 19849 {Target: "updateClusterUpgradeDescription.ClusterUpgradeHealthPolicy.MaxPercentUpgradeDomainDeltaUnhealthyNodes", Name: validation.Null, Rule: false, 19850 Chain: []validation.Constraint{{Target: "updateClusterUpgradeDescription.ClusterUpgradeHealthPolicy.MaxPercentUpgradeDomainDeltaUnhealthyNodes", Name: validation.InclusiveMaximum, Rule: int64(100), Chain: nil}, 19851 {Target: "updateClusterUpgradeDescription.ClusterUpgradeHealthPolicy.MaxPercentUpgradeDomainDeltaUnhealthyNodes", Name: validation.InclusiveMinimum, Rule: 0, Chain: nil}, 19852 }}, 19853 }}}}, 19854 {TargetValue: timeout, 19855 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 19856 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 19857 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 19858 }}}}}); err != nil { 19859 return result, validation.NewError("servicefabric.BaseClient", "UpdateClusterUpgrade", err.Error()) 19860 } 19861 19862 req, err := client.UpdateClusterUpgradePreparer(ctx, updateClusterUpgradeDescription, timeout) 19863 if err != nil { 19864 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UpdateClusterUpgrade", nil, "Failure preparing request") 19865 return 19866 } 19867 19868 resp, err := client.UpdateClusterUpgradeSender(req) 19869 if err != nil { 19870 result.Response = resp 19871 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UpdateClusterUpgrade", resp, "Failure sending request") 19872 return 19873 } 19874 19875 result, err = client.UpdateClusterUpgradeResponder(resp) 19876 if err != nil { 19877 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UpdateClusterUpgrade", resp, "Failure responding to request") 19878 } 19879 19880 return 19881} 19882 19883// UpdateClusterUpgradePreparer prepares the UpdateClusterUpgrade request. 19884func (client BaseClient) UpdateClusterUpgradePreparer(ctx context.Context, updateClusterUpgradeDescription UpdateClusterUpgradeDescription, timeout *int64) (*http.Request, error) { 19885 const APIVersion = "6.0" 19886 queryParameters := map[string]interface{}{ 19887 "api-version": APIVersion, 19888 } 19889 if timeout != nil { 19890 queryParameters["timeout"] = autorest.Encode("query", *timeout) 19891 } else { 19892 queryParameters["timeout"] = autorest.Encode("query", 60) 19893 } 19894 19895 preparer := autorest.CreatePreparer( 19896 autorest.AsContentType("application/json; charset=utf-8"), 19897 autorest.AsPost(), 19898 autorest.WithBaseURL(client.BaseURI), 19899 autorest.WithPath("/$/UpdateUpgrade"), 19900 autorest.WithJSON(updateClusterUpgradeDescription), 19901 autorest.WithQueryParameters(queryParameters)) 19902 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 19903} 19904 19905// UpdateClusterUpgradeSender sends the UpdateClusterUpgrade request. The method will close the 19906// http.Response Body if it receives an error. 19907func (client BaseClient) UpdateClusterUpgradeSender(req *http.Request) (*http.Response, error) { 19908 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 19909 return autorest.SendWithSender(client, req, sd...) 19910} 19911 19912// UpdateClusterUpgradeResponder handles the response to the UpdateClusterUpgrade request. The method always 19913// closes the http.Response Body. 19914func (client BaseClient) UpdateClusterUpgradeResponder(resp *http.Response) (result autorest.Response, err error) { 19915 err = autorest.Respond( 19916 resp, 19917 client.ByInspecting(), 19918 azure.WithErrorUnlessStatusCode(http.StatusOK), 19919 autorest.ByClosing()) 19920 result.Response = resp 19921 return 19922} 19923 19924// UpdateRepairExecutionState this API supports the Service Fabric platform; it is not meant to be used directly from 19925// your code. 19926// Parameters: 19927// repairTask - describes the repair task to be created or updated. 19928func (client BaseClient) UpdateRepairExecutionState(ctx context.Context, repairTask RepairTask) (result RepairTaskUpdateInfo, err error) { 19929 if tracing.IsEnabled() { 19930 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.UpdateRepairExecutionState") 19931 defer func() { 19932 sc := -1 19933 if result.Response.Response != nil { 19934 sc = result.Response.Response.StatusCode 19935 } 19936 tracing.EndSpan(ctx, sc, err) 19937 }() 19938 } 19939 if err := validation.Validate([]validation.Validation{ 19940 {TargetValue: repairTask, 19941 Constraints: []validation.Constraint{{Target: "repairTask.TaskID", Name: validation.Null, Rule: true, Chain: nil}, 19942 {Target: "repairTask.Action", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { 19943 return result, validation.NewError("servicefabric.BaseClient", "UpdateRepairExecutionState", err.Error()) 19944 } 19945 19946 req, err := client.UpdateRepairExecutionStatePreparer(ctx, repairTask) 19947 if err != nil { 19948 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UpdateRepairExecutionState", nil, "Failure preparing request") 19949 return 19950 } 19951 19952 resp, err := client.UpdateRepairExecutionStateSender(req) 19953 if err != nil { 19954 result.Response = autorest.Response{Response: resp} 19955 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UpdateRepairExecutionState", resp, "Failure sending request") 19956 return 19957 } 19958 19959 result, err = client.UpdateRepairExecutionStateResponder(resp) 19960 if err != nil { 19961 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UpdateRepairExecutionState", resp, "Failure responding to request") 19962 } 19963 19964 return 19965} 19966 19967// UpdateRepairExecutionStatePreparer prepares the UpdateRepairExecutionState request. 19968func (client BaseClient) UpdateRepairExecutionStatePreparer(ctx context.Context, repairTask RepairTask) (*http.Request, error) { 19969 const APIVersion = "6.0" 19970 queryParameters := map[string]interface{}{ 19971 "api-version": APIVersion, 19972 } 19973 19974 preparer := autorest.CreatePreparer( 19975 autorest.AsContentType("application/json; charset=utf-8"), 19976 autorest.AsPost(), 19977 autorest.WithBaseURL(client.BaseURI), 19978 autorest.WithPath("/$/UpdateRepairExecutionState"), 19979 autorest.WithJSON(repairTask), 19980 autorest.WithQueryParameters(queryParameters)) 19981 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 19982} 19983 19984// UpdateRepairExecutionStateSender sends the UpdateRepairExecutionState request. The method will close the 19985// http.Response Body if it receives an error. 19986func (client BaseClient) UpdateRepairExecutionStateSender(req *http.Request) (*http.Response, error) { 19987 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 19988 return autorest.SendWithSender(client, req, sd...) 19989} 19990 19991// UpdateRepairExecutionStateResponder handles the response to the UpdateRepairExecutionState request. The method always 19992// closes the http.Response Body. 19993func (client BaseClient) UpdateRepairExecutionStateResponder(resp *http.Response) (result RepairTaskUpdateInfo, err error) { 19994 err = autorest.Respond( 19995 resp, 19996 client.ByInspecting(), 19997 azure.WithErrorUnlessStatusCode(http.StatusOK), 19998 autorest.ByUnmarshallingJSON(&result), 19999 autorest.ByClosing()) 20000 result.Response = autorest.Response{Response: resp} 20001 return 20002} 20003 20004// UpdateRepairTaskHealthPolicy this API supports the Service Fabric platform; it is not meant to be used directly from 20005// your code. 20006// Parameters: 20007// repairTaskUpdateHealthPolicyDescription - describes the repair task healthy policy to be updated. 20008func (client BaseClient) UpdateRepairTaskHealthPolicy(ctx context.Context, repairTaskUpdateHealthPolicyDescription RepairTaskUpdateHealthPolicyDescription) (result RepairTaskUpdateInfo, err error) { 20009 if tracing.IsEnabled() { 20010 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.UpdateRepairTaskHealthPolicy") 20011 defer func() { 20012 sc := -1 20013 if result.Response.Response != nil { 20014 sc = result.Response.Response.StatusCode 20015 } 20016 tracing.EndSpan(ctx, sc, err) 20017 }() 20018 } 20019 if err := validation.Validate([]validation.Validation{ 20020 {TargetValue: repairTaskUpdateHealthPolicyDescription, 20021 Constraints: []validation.Constraint{{Target: "repairTaskUpdateHealthPolicyDescription.TaskID", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { 20022 return result, validation.NewError("servicefabric.BaseClient", "UpdateRepairTaskHealthPolicy", err.Error()) 20023 } 20024 20025 req, err := client.UpdateRepairTaskHealthPolicyPreparer(ctx, repairTaskUpdateHealthPolicyDescription) 20026 if err != nil { 20027 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UpdateRepairTaskHealthPolicy", nil, "Failure preparing request") 20028 return 20029 } 20030 20031 resp, err := client.UpdateRepairTaskHealthPolicySender(req) 20032 if err != nil { 20033 result.Response = autorest.Response{Response: resp} 20034 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UpdateRepairTaskHealthPolicy", resp, "Failure sending request") 20035 return 20036 } 20037 20038 result, err = client.UpdateRepairTaskHealthPolicyResponder(resp) 20039 if err != nil { 20040 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UpdateRepairTaskHealthPolicy", resp, "Failure responding to request") 20041 } 20042 20043 return 20044} 20045 20046// UpdateRepairTaskHealthPolicyPreparer prepares the UpdateRepairTaskHealthPolicy request. 20047func (client BaseClient) UpdateRepairTaskHealthPolicyPreparer(ctx context.Context, repairTaskUpdateHealthPolicyDescription RepairTaskUpdateHealthPolicyDescription) (*http.Request, error) { 20048 const APIVersion = "6.0" 20049 queryParameters := map[string]interface{}{ 20050 "api-version": APIVersion, 20051 } 20052 20053 preparer := autorest.CreatePreparer( 20054 autorest.AsContentType("application/json; charset=utf-8"), 20055 autorest.AsPost(), 20056 autorest.WithBaseURL(client.BaseURI), 20057 autorest.WithPath("/$/UpdateRepairTaskHealthPolicy"), 20058 autorest.WithJSON(repairTaskUpdateHealthPolicyDescription), 20059 autorest.WithQueryParameters(queryParameters)) 20060 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 20061} 20062 20063// UpdateRepairTaskHealthPolicySender sends the UpdateRepairTaskHealthPolicy request. The method will close the 20064// http.Response Body if it receives an error. 20065func (client BaseClient) UpdateRepairTaskHealthPolicySender(req *http.Request) (*http.Response, error) { 20066 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 20067 return autorest.SendWithSender(client, req, sd...) 20068} 20069 20070// UpdateRepairTaskHealthPolicyResponder handles the response to the UpdateRepairTaskHealthPolicy request. The method always 20071// closes the http.Response Body. 20072func (client BaseClient) UpdateRepairTaskHealthPolicyResponder(resp *http.Response) (result RepairTaskUpdateInfo, err error) { 20073 err = autorest.Respond( 20074 resp, 20075 client.ByInspecting(), 20076 azure.WithErrorUnlessStatusCode(http.StatusOK), 20077 autorest.ByUnmarshallingJSON(&result), 20078 autorest.ByClosing()) 20079 result.Response = autorest.Response{Response: resp} 20080 return 20081} 20082 20083// UpdateService this API allows updating properties of a running Service Fabric service. The set of properties that 20084// can be updated are a subset of the properties that were specified at the time of creating the service. The current 20085// set of properties can be obtained using `GetServiceDescription` API. Please note that updating the properties of a 20086// running service is different than upgrading your application using `StartApplicationUpgrade` API. The upgrade is a 20087// long running background operation that involves moving the application from one version to another, one upgrade 20088// domain at a time, whereas update applies the new properties immediately to the service. 20089// Parameters: 20090// serviceID - the identity of the service. This is typically the full name of the service without the 20091// 'fabric:' URI scheme. 20092// Starting from version 6.0, hierarchical names are delimited with the "~" character. 20093// For example, if the service name is "fabric:/myapp/app1/svc1", the service identity would be 20094// "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in previous versions. 20095// serviceUpdateDescription - the information necessary to update a service. 20096// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 20097// duration that the client is willing to wait for the requested operation to complete. The default value for 20098// this parameter is 60 seconds. 20099func (client BaseClient) UpdateService(ctx context.Context, serviceID string, serviceUpdateDescription BasicServiceUpdateDescription, timeout *int64) (result autorest.Response, err error) { 20100 if tracing.IsEnabled() { 20101 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.UpdateService") 20102 defer func() { 20103 sc := -1 20104 if result.Response != nil { 20105 sc = result.Response.StatusCode 20106 } 20107 tracing.EndSpan(ctx, sc, err) 20108 }() 20109 } 20110 if err := validation.Validate([]validation.Validation{ 20111 {TargetValue: timeout, 20112 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 20113 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 20114 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 20115 }}}}}); err != nil { 20116 return result, validation.NewError("servicefabric.BaseClient", "UpdateService", err.Error()) 20117 } 20118 20119 req, err := client.UpdateServicePreparer(ctx, serviceID, serviceUpdateDescription, timeout) 20120 if err != nil { 20121 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UpdateService", nil, "Failure preparing request") 20122 return 20123 } 20124 20125 resp, err := client.UpdateServiceSender(req) 20126 if err != nil { 20127 result.Response = resp 20128 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UpdateService", resp, "Failure sending request") 20129 return 20130 } 20131 20132 result, err = client.UpdateServiceResponder(resp) 20133 if err != nil { 20134 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UpdateService", resp, "Failure responding to request") 20135 } 20136 20137 return 20138} 20139 20140// UpdateServicePreparer prepares the UpdateService request. 20141func (client BaseClient) UpdateServicePreparer(ctx context.Context, serviceID string, serviceUpdateDescription BasicServiceUpdateDescription, timeout *int64) (*http.Request, error) { 20142 pathParameters := map[string]interface{}{ 20143 "serviceId": serviceID, 20144 } 20145 20146 const APIVersion = "6.0" 20147 queryParameters := map[string]interface{}{ 20148 "api-version": APIVersion, 20149 } 20150 if timeout != nil { 20151 queryParameters["timeout"] = autorest.Encode("query", *timeout) 20152 } else { 20153 queryParameters["timeout"] = autorest.Encode("query", 60) 20154 } 20155 20156 preparer := autorest.CreatePreparer( 20157 autorest.AsContentType("application/json; charset=utf-8"), 20158 autorest.AsPost(), 20159 autorest.WithBaseURL(client.BaseURI), 20160 autorest.WithPathParameters("/Services/{serviceId}/$/Update", pathParameters), 20161 autorest.WithJSON(serviceUpdateDescription), 20162 autorest.WithQueryParameters(queryParameters)) 20163 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 20164} 20165 20166// UpdateServiceSender sends the UpdateService request. The method will close the 20167// http.Response Body if it receives an error. 20168func (client BaseClient) UpdateServiceSender(req *http.Request) (*http.Response, error) { 20169 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 20170 return autorest.SendWithSender(client, req, sd...) 20171} 20172 20173// UpdateServiceResponder handles the response to the UpdateService request. The method always 20174// closes the http.Response Body. 20175func (client BaseClient) UpdateServiceResponder(resp *http.Response) (result autorest.Response, err error) { 20176 err = autorest.Respond( 20177 resp, 20178 client.ByInspecting(), 20179 azure.WithErrorUnlessStatusCode(http.StatusOK), 20180 autorest.ByClosing()) 20181 result.Response = resp 20182 return 20183} 20184 20185// UploadFile uploads contents of the file to the image store. Use this API if the file is small enough to upload again 20186// if the connection fails. The file's data needs to be added to the request body. The contents will be uploaded to the 20187// specified path. Image store service uses a mark file to indicate the availability of the folder. The mark file is an 20188// empty file named "_.dir". The mark file is generated by the image store service when all files in a folder are 20189// uploaded. When using File-by-File approach to upload application package in REST, the image store service isn't 20190// aware of the file hierarchy of the application package; you need to create a mark file per folder and upload it 20191// last, to let the image store service know that the folder is complete. 20192// Parameters: 20193// contentPath - relative path to file or folder in the image store from its root. 20194// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 20195// duration that the client is willing to wait for the requested operation to complete. The default value for 20196// this parameter is 60 seconds. 20197func (client BaseClient) UploadFile(ctx context.Context, contentPath string, timeout *int64) (result autorest.Response, err error) { 20198 if tracing.IsEnabled() { 20199 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.UploadFile") 20200 defer func() { 20201 sc := -1 20202 if result.Response != nil { 20203 sc = result.Response.StatusCode 20204 } 20205 tracing.EndSpan(ctx, sc, err) 20206 }() 20207 } 20208 if err := validation.Validate([]validation.Validation{ 20209 {TargetValue: timeout, 20210 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 20211 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 20212 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 20213 }}}}}); err != nil { 20214 return result, validation.NewError("servicefabric.BaseClient", "UploadFile", err.Error()) 20215 } 20216 20217 req, err := client.UploadFilePreparer(ctx, contentPath, timeout) 20218 if err != nil { 20219 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UploadFile", nil, "Failure preparing request") 20220 return 20221 } 20222 20223 resp, err := client.UploadFileSender(req) 20224 if err != nil { 20225 result.Response = resp 20226 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UploadFile", resp, "Failure sending request") 20227 return 20228 } 20229 20230 result, err = client.UploadFileResponder(resp) 20231 if err != nil { 20232 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UploadFile", resp, "Failure responding to request") 20233 } 20234 20235 return 20236} 20237 20238// UploadFilePreparer prepares the UploadFile request. 20239func (client BaseClient) UploadFilePreparer(ctx context.Context, contentPath string, timeout *int64) (*http.Request, error) { 20240 pathParameters := map[string]interface{}{ 20241 "contentPath": autorest.Encode("path", contentPath), 20242 } 20243 20244 const APIVersion = "6.0" 20245 queryParameters := map[string]interface{}{ 20246 "api-version": APIVersion, 20247 } 20248 if timeout != nil { 20249 queryParameters["timeout"] = autorest.Encode("query", *timeout) 20250 } else { 20251 queryParameters["timeout"] = autorest.Encode("query", 60) 20252 } 20253 20254 preparer := autorest.CreatePreparer( 20255 autorest.AsPut(), 20256 autorest.WithBaseURL(client.BaseURI), 20257 autorest.WithPathParameters("/ImageStore/{contentPath}", pathParameters), 20258 autorest.WithQueryParameters(queryParameters)) 20259 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 20260} 20261 20262// UploadFileSender sends the UploadFile request. The method will close the 20263// http.Response Body if it receives an error. 20264func (client BaseClient) UploadFileSender(req *http.Request) (*http.Response, error) { 20265 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 20266 return autorest.SendWithSender(client, req, sd...) 20267} 20268 20269// UploadFileResponder handles the response to the UploadFile request. The method always 20270// closes the http.Response Body. 20271func (client BaseClient) UploadFileResponder(resp *http.Response) (result autorest.Response, err error) { 20272 err = autorest.Respond( 20273 resp, 20274 client.ByInspecting(), 20275 azure.WithErrorUnlessStatusCode(http.StatusOK), 20276 autorest.ByClosing()) 20277 result.Response = resp 20278 return 20279} 20280 20281// UploadFileChunk uploads a file chunk to the image store with the specified upload session ID and image store 20282// relative path. This API allows user to resume the file upload operation. user doesn't have to restart the file 20283// upload from scratch whenever there is a network interruption. Use this option if the file size is large. 20284// 20285// To perform a resumable file upload, user need to break the file into multiple chunks and upload these chunks to the 20286// image store one-by-one. Chunks don't have to be uploaded in order. If the file represented by the image store 20287// relative path already exists, it will be overwritten when the upload session commits. 20288// Parameters: 20289// contentPath - relative path to file or folder in the image store from its root. 20290// sessionID - a GUID generated by the user for a file uploading. It identifies an image store upload session 20291// which keeps track of all file chunks until it is committed. 20292// contentRange - when uploading file chunks to the image store, the Content-Range header field need to be 20293// configured and sent with a request. The format should looks like "bytes 20294// {First-Byte-Position}-{Last-Byte-Position}/{File-Length}". For example, Content-Range:bytes 300-5000/20000 20295// indicates that user is sending bytes 300 through 5,000 and the total file length is 20,000 bytes. 20296// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 20297// duration that the client is willing to wait for the requested operation to complete. The default value for 20298// this parameter is 60 seconds. 20299func (client BaseClient) UploadFileChunk(ctx context.Context, contentPath string, sessionID uuid.UUID, contentRange string, timeout *int64) (result autorest.Response, err error) { 20300 if tracing.IsEnabled() { 20301 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.UploadFileChunk") 20302 defer func() { 20303 sc := -1 20304 if result.Response != nil { 20305 sc = result.Response.StatusCode 20306 } 20307 tracing.EndSpan(ctx, sc, err) 20308 }() 20309 } 20310 if err := validation.Validate([]validation.Validation{ 20311 {TargetValue: timeout, 20312 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 20313 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 20314 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: 1, Chain: nil}, 20315 }}}}}); err != nil { 20316 return result, validation.NewError("servicefabric.BaseClient", "UploadFileChunk", err.Error()) 20317 } 20318 20319 req, err := client.UploadFileChunkPreparer(ctx, contentPath, sessionID, contentRange, timeout) 20320 if err != nil { 20321 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UploadFileChunk", nil, "Failure preparing request") 20322 return 20323 } 20324 20325 resp, err := client.UploadFileChunkSender(req) 20326 if err != nil { 20327 result.Response = resp 20328 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UploadFileChunk", resp, "Failure sending request") 20329 return 20330 } 20331 20332 result, err = client.UploadFileChunkResponder(resp) 20333 if err != nil { 20334 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UploadFileChunk", resp, "Failure responding to request") 20335 } 20336 20337 return 20338} 20339 20340// UploadFileChunkPreparer prepares the UploadFileChunk request. 20341func (client BaseClient) UploadFileChunkPreparer(ctx context.Context, contentPath string, sessionID uuid.UUID, contentRange string, timeout *int64) (*http.Request, error) { 20342 pathParameters := map[string]interface{}{ 20343 "contentPath": autorest.Encode("path", contentPath), 20344 } 20345 20346 const APIVersion = "6.0" 20347 queryParameters := map[string]interface{}{ 20348 "api-version": APIVersion, 20349 "session-id": autorest.Encode("query", sessionID), 20350 } 20351 if timeout != nil { 20352 queryParameters["timeout"] = autorest.Encode("query", *timeout) 20353 } else { 20354 queryParameters["timeout"] = autorest.Encode("query", 60) 20355 } 20356 20357 preparer := autorest.CreatePreparer( 20358 autorest.AsPut(), 20359 autorest.WithBaseURL(client.BaseURI), 20360 autorest.WithPathParameters("/ImageStore/{contentPath}/$/UploadChunk", pathParameters), 20361 autorest.WithQueryParameters(queryParameters), 20362 autorest.WithHeader("Content-Range", autorest.String(contentRange))) 20363 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 20364} 20365 20366// UploadFileChunkSender sends the UploadFileChunk request. The method will close the 20367// http.Response Body if it receives an error. 20368func (client BaseClient) UploadFileChunkSender(req *http.Request) (*http.Response, error) { 20369 sd := autorest.GetSendDecorators(req.Context(), autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 20370 return autorest.SendWithSender(client, req, sd...) 20371} 20372 20373// UploadFileChunkResponder handles the response to the UploadFileChunk request. The method always 20374// closes the http.Response Body. 20375func (client BaseClient) UploadFileChunkResponder(resp *http.Response) (result autorest.Response, err error) { 20376 err = autorest.Respond( 20377 resp, 20378 client.ByInspecting(), 20379 azure.WithErrorUnlessStatusCode(http.StatusOK), 20380 autorest.ByClosing()) 20381 result.Response = resp 20382 return 20383} 20384