1// Package servicefabric implements the Azure ARM Servicefabric service API version 6.4.0.36. 2// 3// Service Fabric REST Client APIs allows management of Service Fabric clusters, applications and services. 4package servicefabric 5 6// Copyright (c) Microsoft Corporation. All rights reserved. 7// Licensed under the MIT License. See License.txt in the project root for license information. 8// 9// Code generated by Microsoft (R) AutoRest Code Generator. 10// Changes may cause incorrect behavior and will be lost if the code is regenerated. 11 12import ( 13 "context" 14 "github.com/Azure/go-autorest/autorest" 15 "github.com/Azure/go-autorest/autorest/azure" 16 "github.com/Azure/go-autorest/autorest/date" 17 "github.com/Azure/go-autorest/autorest/validation" 18 "github.com/Azure/go-autorest/tracing" 19 "github.com/gofrs/uuid" 20 "net/http" 21) 22 23const ( 24 // DefaultBaseURI is the default URI used for the service Servicefabric 25 DefaultBaseURI = "http://localhost:19080" 26) 27 28// BaseClient is the base client for Servicefabric. 29type BaseClient struct { 30 autorest.Client 31 BaseURI string 32} 33 34// New creates an instance of the BaseClient client. 35func New() BaseClient { 36 return NewWithBaseURI(DefaultBaseURI) 37} 38 39// NewWithBaseURI creates an instance of the BaseClient client using a custom endpoint. Use this when interacting with 40// an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). 41func NewWithBaseURI(baseURI string) BaseClient { 42 return BaseClient{ 43 Client: autorest.NewClientWithUserAgent(UserAgent()), 44 BaseURI: baseURI, 45 } 46} 47 48// BackupPartition creates a backup of the stateful persisted partition's state. In case the partition is already being 49// periodically backed up, then by default the new backup is created at the same backup storage. One can also override 50// the same by specifying the backup storage details as part of the request body. Once the backup is initiated, its 51// progress can be tracked using the GetBackupProgress operation. 52// In case, the operation times out, specify a greater backup timeout value in the query parameter. 53// Parameters: 54// partitionID - the identity of the partition. 55// backupPartitionDescription - describes the parameters to backup the partition now. If not present, backup 56// operation uses default parameters from the backup policy current associated with this partition. 57// backupTimeout - specifies the maximum amount of time, in minutes, to wait for the backup operation to 58// complete. Post that, the operation completes with timeout error. However, in certain corner cases it could 59// be that though the operation returns back timeout, the backup actually goes through. In case of timeout 60// error, its recommended to invoke this operation again with a greater timeout value. The default value for 61// the same is 10 minutes. 62// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 63// duration that the client is willing to wait for the requested operation to complete. The default value for 64// this parameter is 60 seconds. 65func (client BaseClient) BackupPartition(ctx context.Context, partitionID uuid.UUID, backupPartitionDescription *BackupPartitionDescription, backupTimeout *int32, timeout *int64) (result autorest.Response, err error) { 66 if tracing.IsEnabled() { 67 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.BackupPartition") 68 defer func() { 69 sc := -1 70 if result.Response != nil { 71 sc = result.Response.StatusCode 72 } 73 tracing.EndSpan(ctx, sc, err) 74 }() 75 } 76 if err := validation.Validate([]validation.Validation{ 77 {TargetValue: timeout, 78 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 79 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 80 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 81 }}}}}); err != nil { 82 return result, validation.NewError("servicefabric.BaseClient", "BackupPartition", err.Error()) 83 } 84 85 req, err := client.BackupPartitionPreparer(ctx, partitionID, backupPartitionDescription, backupTimeout, timeout) 86 if err != nil { 87 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "BackupPartition", nil, "Failure preparing request") 88 return 89 } 90 91 resp, err := client.BackupPartitionSender(req) 92 if err != nil { 93 result.Response = resp 94 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "BackupPartition", resp, "Failure sending request") 95 return 96 } 97 98 result, err = client.BackupPartitionResponder(resp) 99 if err != nil { 100 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "BackupPartition", resp, "Failure responding to request") 101 return 102 } 103 104 return 105} 106 107// BackupPartitionPreparer prepares the BackupPartition request. 108func (client BaseClient) BackupPartitionPreparer(ctx context.Context, partitionID uuid.UUID, backupPartitionDescription *BackupPartitionDescription, backupTimeout *int32, timeout *int64) (*http.Request, error) { 109 pathParameters := map[string]interface{}{ 110 "partitionId": partitionID, 111 } 112 113 const APIVersion = "6.4" 114 queryParameters := map[string]interface{}{ 115 "api-version": APIVersion, 116 } 117 if backupTimeout != nil { 118 queryParameters["BackupTimeout"] = autorest.Encode("query", *backupTimeout) 119 } else { 120 queryParameters["BackupTimeout"] = autorest.Encode("query", 10) 121 } 122 if timeout != nil { 123 queryParameters["timeout"] = autorest.Encode("query", *timeout) 124 } else { 125 queryParameters["timeout"] = autorest.Encode("query", 60) 126 } 127 128 preparer := autorest.CreatePreparer( 129 autorest.AsContentType("application/json; charset=utf-8"), 130 autorest.AsPost(), 131 autorest.WithBaseURL(client.BaseURI), 132 autorest.WithPathParameters("/Partitions/{partitionId}/$/Backup", pathParameters), 133 autorest.WithQueryParameters(queryParameters)) 134 if backupPartitionDescription != nil { 135 preparer = autorest.DecoratePreparer(preparer, 136 autorest.WithJSON(backupPartitionDescription)) 137 } 138 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 139} 140 141// BackupPartitionSender sends the BackupPartition request. The method will close the 142// http.Response Body if it receives an error. 143func (client BaseClient) BackupPartitionSender(req *http.Request) (*http.Response, error) { 144 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 145} 146 147// BackupPartitionResponder handles the response to the BackupPartition request. The method always 148// closes the http.Response Body. 149func (client BaseClient) BackupPartitionResponder(resp *http.Response) (result autorest.Response, err error) { 150 err = autorest.Respond( 151 resp, 152 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), 153 autorest.ByClosing()) 154 result.Response = resp 155 return 156} 157 158// CancelOperation the following APIs start fault operations that may be cancelled by using CancelOperation: 159// StartDataLoss, StartQuorumLoss, StartPartitionRestart, StartNodeTransition. 160// 161// If force is false, then the specified user-induced operation will be gracefully stopped and cleaned up. If force is 162// true, the command will be aborted, and some internal state 163// may be left behind. Specifying force as true should be used with care. Calling this API with force set to true is 164// not allowed until this API has already 165// been called on the same test command with force set to false first, or unless the test command already has an 166// OperationState of OperationState.RollingBack. 167// Clarification: OperationState.RollingBack means that the system will be/is cleaning up internal system state caused 168// by executing the command. It will not restore data if the 169// test command was to cause data loss. For example, if you call StartDataLoss then call this API, the system will 170// only clean up internal state from running the command. 171// It will not restore the target partition's data, if the command progressed far enough to cause data loss. 172// 173// Important note: if this API is invoked with force==true, internal state may be left behind. 174// Parameters: 175// operationID - a GUID that identifies a call of this API. This is passed into the corresponding GetProgress 176// API 177// force - indicates whether to gracefully roll back and clean up internal system state modified by executing 178// the user-induced operation. 179// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 180// duration that the client is willing to wait for the requested operation to complete. The default value for 181// this parameter is 60 seconds. 182func (client BaseClient) CancelOperation(ctx context.Context, operationID uuid.UUID, force bool, timeout *int64) (result autorest.Response, err error) { 183 if tracing.IsEnabled() { 184 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.CancelOperation") 185 defer func() { 186 sc := -1 187 if result.Response != nil { 188 sc = result.Response.StatusCode 189 } 190 tracing.EndSpan(ctx, sc, err) 191 }() 192 } 193 if err := validation.Validate([]validation.Validation{ 194 {TargetValue: timeout, 195 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 196 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 197 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 198 }}}}}); err != nil { 199 return result, validation.NewError("servicefabric.BaseClient", "CancelOperation", err.Error()) 200 } 201 202 req, err := client.CancelOperationPreparer(ctx, operationID, force, timeout) 203 if err != nil { 204 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CancelOperation", nil, "Failure preparing request") 205 return 206 } 207 208 resp, err := client.CancelOperationSender(req) 209 if err != nil { 210 result.Response = resp 211 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CancelOperation", resp, "Failure sending request") 212 return 213 } 214 215 result, err = client.CancelOperationResponder(resp) 216 if err != nil { 217 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CancelOperation", resp, "Failure responding to request") 218 return 219 } 220 221 return 222} 223 224// CancelOperationPreparer prepares the CancelOperation request. 225func (client BaseClient) CancelOperationPreparer(ctx context.Context, operationID uuid.UUID, force bool, timeout *int64) (*http.Request, error) { 226 const APIVersion = "6.0" 227 queryParameters := map[string]interface{}{ 228 "api-version": APIVersion, 229 "Force": autorest.Encode("query", force), 230 "OperationId": autorest.Encode("query", operationID), 231 } 232 if timeout != nil { 233 queryParameters["timeout"] = autorest.Encode("query", *timeout) 234 } else { 235 queryParameters["timeout"] = autorest.Encode("query", 60) 236 } 237 238 preparer := autorest.CreatePreparer( 239 autorest.AsPost(), 240 autorest.WithBaseURL(client.BaseURI), 241 autorest.WithPath("/Faults/$/Cancel"), 242 autorest.WithQueryParameters(queryParameters)) 243 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 244} 245 246// CancelOperationSender sends the CancelOperation request. The method will close the 247// http.Response Body if it receives an error. 248func (client BaseClient) CancelOperationSender(req *http.Request) (*http.Response, error) { 249 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 250} 251 252// CancelOperationResponder handles the response to the CancelOperation request. The method always 253// closes the http.Response Body. 254func (client BaseClient) CancelOperationResponder(resp *http.Response) (result autorest.Response, err error) { 255 err = autorest.Respond( 256 resp, 257 azure.WithErrorUnlessStatusCode(http.StatusOK), 258 autorest.ByClosing()) 259 result.Response = resp 260 return 261} 262 263// CancelRepairTask this API supports the Service Fabric platform; it is not meant to be used directly from your code. 264// Parameters: 265// repairTaskCancelDescription - describes the repair task to be cancelled. 266func (client BaseClient) CancelRepairTask(ctx context.Context, repairTaskCancelDescription RepairTaskCancelDescription) (result RepairTaskUpdateInfo, err error) { 267 if tracing.IsEnabled() { 268 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.CancelRepairTask") 269 defer func() { 270 sc := -1 271 if result.Response.Response != nil { 272 sc = result.Response.Response.StatusCode 273 } 274 tracing.EndSpan(ctx, sc, err) 275 }() 276 } 277 if err := validation.Validate([]validation.Validation{ 278 {TargetValue: repairTaskCancelDescription, 279 Constraints: []validation.Constraint{{Target: "repairTaskCancelDescription.TaskID", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { 280 return result, validation.NewError("servicefabric.BaseClient", "CancelRepairTask", err.Error()) 281 } 282 283 req, err := client.CancelRepairTaskPreparer(ctx, repairTaskCancelDescription) 284 if err != nil { 285 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CancelRepairTask", nil, "Failure preparing request") 286 return 287 } 288 289 resp, err := client.CancelRepairTaskSender(req) 290 if err != nil { 291 result.Response = autorest.Response{Response: resp} 292 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CancelRepairTask", resp, "Failure sending request") 293 return 294 } 295 296 result, err = client.CancelRepairTaskResponder(resp) 297 if err != nil { 298 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CancelRepairTask", resp, "Failure responding to request") 299 return 300 } 301 302 return 303} 304 305// CancelRepairTaskPreparer prepares the CancelRepairTask request. 306func (client BaseClient) CancelRepairTaskPreparer(ctx context.Context, repairTaskCancelDescription RepairTaskCancelDescription) (*http.Request, error) { 307 const APIVersion = "6.0" 308 queryParameters := map[string]interface{}{ 309 "api-version": APIVersion, 310 } 311 312 preparer := autorest.CreatePreparer( 313 autorest.AsContentType("application/json; charset=utf-8"), 314 autorest.AsPost(), 315 autorest.WithBaseURL(client.BaseURI), 316 autorest.WithPath("/$/CancelRepairTask"), 317 autorest.WithJSON(repairTaskCancelDescription), 318 autorest.WithQueryParameters(queryParameters)) 319 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 320} 321 322// CancelRepairTaskSender sends the CancelRepairTask request. The method will close the 323// http.Response Body if it receives an error. 324func (client BaseClient) CancelRepairTaskSender(req *http.Request) (*http.Response, error) { 325 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 326} 327 328// CancelRepairTaskResponder handles the response to the CancelRepairTask request. The method always 329// closes the http.Response Body. 330func (client BaseClient) CancelRepairTaskResponder(resp *http.Response) (result RepairTaskUpdateInfo, err error) { 331 err = autorest.Respond( 332 resp, 333 azure.WithErrorUnlessStatusCode(http.StatusOK), 334 autorest.ByUnmarshallingJSON(&result), 335 autorest.ByClosing()) 336 result.Response = autorest.Response{Response: resp} 337 return 338} 339 340// CommitImageStoreUploadSession when all file chunks have been uploaded, the upload session needs to be committed 341// explicitly to complete the upload. Image store preserves the upload session until the expiration time, which is 30 342// minutes after the last chunk received. 343// Parameters: 344// sessionID - a GUID generated by the user for a file uploading. It identifies an image store upload session 345// which keeps track of all file chunks until it is committed. 346// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 347// duration that the client is willing to wait for the requested operation to complete. The default value for 348// this parameter is 60 seconds. 349func (client BaseClient) CommitImageStoreUploadSession(ctx context.Context, sessionID uuid.UUID, timeout *int64) (result autorest.Response, err error) { 350 if tracing.IsEnabled() { 351 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.CommitImageStoreUploadSession") 352 defer func() { 353 sc := -1 354 if result.Response != nil { 355 sc = result.Response.StatusCode 356 } 357 tracing.EndSpan(ctx, sc, err) 358 }() 359 } 360 if err := validation.Validate([]validation.Validation{ 361 {TargetValue: timeout, 362 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 363 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 364 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 365 }}}}}); err != nil { 366 return result, validation.NewError("servicefabric.BaseClient", "CommitImageStoreUploadSession", err.Error()) 367 } 368 369 req, err := client.CommitImageStoreUploadSessionPreparer(ctx, sessionID, timeout) 370 if err != nil { 371 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CommitImageStoreUploadSession", nil, "Failure preparing request") 372 return 373 } 374 375 resp, err := client.CommitImageStoreUploadSessionSender(req) 376 if err != nil { 377 result.Response = resp 378 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CommitImageStoreUploadSession", resp, "Failure sending request") 379 return 380 } 381 382 result, err = client.CommitImageStoreUploadSessionResponder(resp) 383 if err != nil { 384 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CommitImageStoreUploadSession", resp, "Failure responding to request") 385 return 386 } 387 388 return 389} 390 391// CommitImageStoreUploadSessionPreparer prepares the CommitImageStoreUploadSession request. 392func (client BaseClient) CommitImageStoreUploadSessionPreparer(ctx context.Context, sessionID uuid.UUID, timeout *int64) (*http.Request, error) { 393 const APIVersion = "6.0" 394 queryParameters := map[string]interface{}{ 395 "api-version": APIVersion, 396 "session-id": autorest.Encode("query", sessionID), 397 } 398 if timeout != nil { 399 queryParameters["timeout"] = autorest.Encode("query", *timeout) 400 } else { 401 queryParameters["timeout"] = autorest.Encode("query", 60) 402 } 403 404 preparer := autorest.CreatePreparer( 405 autorest.AsPost(), 406 autorest.WithBaseURL(client.BaseURI), 407 autorest.WithPath("/ImageStore/$/CommitUploadSession"), 408 autorest.WithQueryParameters(queryParameters)) 409 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 410} 411 412// CommitImageStoreUploadSessionSender sends the CommitImageStoreUploadSession request. The method will close the 413// http.Response Body if it receives an error. 414func (client BaseClient) CommitImageStoreUploadSessionSender(req *http.Request) (*http.Response, error) { 415 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 416} 417 418// CommitImageStoreUploadSessionResponder handles the response to the CommitImageStoreUploadSession request. The method always 419// closes the http.Response Body. 420func (client BaseClient) CommitImageStoreUploadSessionResponder(resp *http.Response) (result autorest.Response, err error) { 421 err = autorest.Respond( 422 resp, 423 azure.WithErrorUnlessStatusCode(http.StatusOK), 424 autorest.ByClosing()) 425 result.Response = resp 426 return 427} 428 429// CopyImageStoreContent copies the image store content from the source image store relative path to the destination 430// image store relative path. 431// Parameters: 432// imageStoreCopyDescription - describes the copy description for the image store. 433// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 434// duration that the client is willing to wait for the requested operation to complete. The default value for 435// this parameter is 60 seconds. 436func (client BaseClient) CopyImageStoreContent(ctx context.Context, imageStoreCopyDescription ImageStoreCopyDescription, timeout *int64) (result autorest.Response, err error) { 437 if tracing.IsEnabled() { 438 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.CopyImageStoreContent") 439 defer func() { 440 sc := -1 441 if result.Response != nil { 442 sc = result.Response.StatusCode 443 } 444 tracing.EndSpan(ctx, sc, err) 445 }() 446 } 447 if err := validation.Validate([]validation.Validation{ 448 {TargetValue: imageStoreCopyDescription, 449 Constraints: []validation.Constraint{{Target: "imageStoreCopyDescription.RemoteSource", Name: validation.Null, Rule: true, Chain: nil}, 450 {Target: "imageStoreCopyDescription.RemoteDestination", Name: validation.Null, Rule: true, Chain: nil}}}, 451 {TargetValue: timeout, 452 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 453 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 454 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 455 }}}}}); err != nil { 456 return result, validation.NewError("servicefabric.BaseClient", "CopyImageStoreContent", err.Error()) 457 } 458 459 req, err := client.CopyImageStoreContentPreparer(ctx, imageStoreCopyDescription, timeout) 460 if err != nil { 461 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CopyImageStoreContent", nil, "Failure preparing request") 462 return 463 } 464 465 resp, err := client.CopyImageStoreContentSender(req) 466 if err != nil { 467 result.Response = resp 468 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CopyImageStoreContent", resp, "Failure sending request") 469 return 470 } 471 472 result, err = client.CopyImageStoreContentResponder(resp) 473 if err != nil { 474 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CopyImageStoreContent", resp, "Failure responding to request") 475 return 476 } 477 478 return 479} 480 481// CopyImageStoreContentPreparer prepares the CopyImageStoreContent request. 482func (client BaseClient) CopyImageStoreContentPreparer(ctx context.Context, imageStoreCopyDescription ImageStoreCopyDescription, timeout *int64) (*http.Request, error) { 483 const APIVersion = "6.0" 484 queryParameters := map[string]interface{}{ 485 "api-version": APIVersion, 486 } 487 if timeout != nil { 488 queryParameters["timeout"] = autorest.Encode("query", *timeout) 489 } else { 490 queryParameters["timeout"] = autorest.Encode("query", 60) 491 } 492 493 preparer := autorest.CreatePreparer( 494 autorest.AsContentType("application/json; charset=utf-8"), 495 autorest.AsPost(), 496 autorest.WithBaseURL(client.BaseURI), 497 autorest.WithPath("/ImageStore/$/Copy"), 498 autorest.WithJSON(imageStoreCopyDescription), 499 autorest.WithQueryParameters(queryParameters)) 500 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 501} 502 503// CopyImageStoreContentSender sends the CopyImageStoreContent request. The method will close the 504// http.Response Body if it receives an error. 505func (client BaseClient) CopyImageStoreContentSender(req *http.Request) (*http.Response, error) { 506 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 507} 508 509// CopyImageStoreContentResponder handles the response to the CopyImageStoreContent request. The method always 510// closes the http.Response Body. 511func (client BaseClient) CopyImageStoreContentResponder(resp *http.Response) (result autorest.Response, err error) { 512 err = autorest.Respond( 513 resp, 514 azure.WithErrorUnlessStatusCode(http.StatusOK), 515 autorest.ByClosing()) 516 result.Response = resp 517 return 518} 519 520// CreateApplication creates a Service Fabric application using the specified description. 521// Parameters: 522// applicationDescription - description for creating an application. 523// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 524// duration that the client is willing to wait for the requested operation to complete. The default value for 525// this parameter is 60 seconds. 526func (client BaseClient) CreateApplication(ctx context.Context, applicationDescription ApplicationDescription, timeout *int64) (result autorest.Response, err error) { 527 if tracing.IsEnabled() { 528 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.CreateApplication") 529 defer func() { 530 sc := -1 531 if result.Response != nil { 532 sc = result.Response.StatusCode 533 } 534 tracing.EndSpan(ctx, sc, err) 535 }() 536 } 537 if err := validation.Validate([]validation.Validation{ 538 {TargetValue: applicationDescription, 539 Constraints: []validation.Constraint{{Target: "applicationDescription.Name", Name: validation.Null, Rule: true, Chain: nil}, 540 {Target: "applicationDescription.TypeName", Name: validation.Null, Rule: true, Chain: nil}, 541 {Target: "applicationDescription.TypeVersion", Name: validation.Null, Rule: true, Chain: nil}, 542 {Target: "applicationDescription.ApplicationCapacity", Name: validation.Null, Rule: false, 543 Chain: []validation.Constraint{{Target: "applicationDescription.ApplicationCapacity.MinimumNodes", Name: validation.Null, Rule: false, 544 Chain: []validation.Constraint{{Target: "applicationDescription.ApplicationCapacity.MinimumNodes", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}}}, 545 {Target: "applicationDescription.ApplicationCapacity.MaximumNodes", Name: validation.Null, Rule: false, 546 Chain: []validation.Constraint{{Target: "applicationDescription.ApplicationCapacity.MaximumNodes", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}}}, 547 }}}}, 548 {TargetValue: timeout, 549 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 550 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 551 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 552 }}}}}); err != nil { 553 return result, validation.NewError("servicefabric.BaseClient", "CreateApplication", err.Error()) 554 } 555 556 req, err := client.CreateApplicationPreparer(ctx, applicationDescription, timeout) 557 if err != nil { 558 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CreateApplication", nil, "Failure preparing request") 559 return 560 } 561 562 resp, err := client.CreateApplicationSender(req) 563 if err != nil { 564 result.Response = resp 565 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CreateApplication", resp, "Failure sending request") 566 return 567 } 568 569 result, err = client.CreateApplicationResponder(resp) 570 if err != nil { 571 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CreateApplication", resp, "Failure responding to request") 572 return 573 } 574 575 return 576} 577 578// CreateApplicationPreparer prepares the CreateApplication request. 579func (client BaseClient) CreateApplicationPreparer(ctx context.Context, applicationDescription ApplicationDescription, timeout *int64) (*http.Request, error) { 580 const APIVersion = "6.0" 581 queryParameters := map[string]interface{}{ 582 "api-version": APIVersion, 583 } 584 if timeout != nil { 585 queryParameters["timeout"] = autorest.Encode("query", *timeout) 586 } else { 587 queryParameters["timeout"] = autorest.Encode("query", 60) 588 } 589 590 preparer := autorest.CreatePreparer( 591 autorest.AsContentType("application/json; charset=utf-8"), 592 autorest.AsPost(), 593 autorest.WithBaseURL(client.BaseURI), 594 autorest.WithPath("/Applications/$/Create"), 595 autorest.WithJSON(applicationDescription), 596 autorest.WithQueryParameters(queryParameters)) 597 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 598} 599 600// CreateApplicationSender sends the CreateApplication request. The method will close the 601// http.Response Body if it receives an error. 602func (client BaseClient) CreateApplicationSender(req *http.Request) (*http.Response, error) { 603 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 604} 605 606// CreateApplicationResponder handles the response to the CreateApplication request. The method always 607// closes the http.Response Body. 608func (client BaseClient) CreateApplicationResponder(resp *http.Response) (result autorest.Response, err error) { 609 err = autorest.Respond( 610 resp, 611 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), 612 autorest.ByClosing()) 613 result.Response = resp 614 return 615} 616 617// CreateBackupPolicy creates a backup policy which can be associated later with a Service Fabric application, service 618// or a partition for periodic backup. 619// Parameters: 620// backupPolicyDescription - describes the backup policy. 621// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 622// duration that the client is willing to wait for the requested operation to complete. The default value for 623// this parameter is 60 seconds. 624func (client BaseClient) CreateBackupPolicy(ctx context.Context, backupPolicyDescription BackupPolicyDescription, timeout *int64) (result autorest.Response, err error) { 625 if tracing.IsEnabled() { 626 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.CreateBackupPolicy") 627 defer func() { 628 sc := -1 629 if result.Response != nil { 630 sc = result.Response.StatusCode 631 } 632 tracing.EndSpan(ctx, sc, err) 633 }() 634 } 635 if err := validation.Validate([]validation.Validation{ 636 {TargetValue: backupPolicyDescription, 637 Constraints: []validation.Constraint{{Target: "backupPolicyDescription.Name", Name: validation.Null, Rule: true, Chain: nil}, 638 {Target: "backupPolicyDescription.AutoRestoreOnDataLoss", Name: validation.Null, Rule: true, Chain: nil}, 639 {Target: "backupPolicyDescription.MaxIncrementalBackups", Name: validation.Null, Rule: true, 640 Chain: []validation.Constraint{{Target: "backupPolicyDescription.MaxIncrementalBackups", Name: validation.InclusiveMaximum, Rule: int64(255), Chain: nil}, 641 {Target: "backupPolicyDescription.MaxIncrementalBackups", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}, 642 }}}}, 643 {TargetValue: timeout, 644 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 645 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 646 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 647 }}}}}); err != nil { 648 return result, validation.NewError("servicefabric.BaseClient", "CreateBackupPolicy", err.Error()) 649 } 650 651 req, err := client.CreateBackupPolicyPreparer(ctx, backupPolicyDescription, timeout) 652 if err != nil { 653 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CreateBackupPolicy", nil, "Failure preparing request") 654 return 655 } 656 657 resp, err := client.CreateBackupPolicySender(req) 658 if err != nil { 659 result.Response = resp 660 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CreateBackupPolicy", resp, "Failure sending request") 661 return 662 } 663 664 result, err = client.CreateBackupPolicyResponder(resp) 665 if err != nil { 666 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CreateBackupPolicy", resp, "Failure responding to request") 667 return 668 } 669 670 return 671} 672 673// CreateBackupPolicyPreparer prepares the CreateBackupPolicy request. 674func (client BaseClient) CreateBackupPolicyPreparer(ctx context.Context, backupPolicyDescription BackupPolicyDescription, timeout *int64) (*http.Request, error) { 675 const APIVersion = "6.4" 676 queryParameters := map[string]interface{}{ 677 "api-version": APIVersion, 678 } 679 if timeout != nil { 680 queryParameters["timeout"] = autorest.Encode("query", *timeout) 681 } else { 682 queryParameters["timeout"] = autorest.Encode("query", 60) 683 } 684 685 preparer := autorest.CreatePreparer( 686 autorest.AsContentType("application/json; charset=utf-8"), 687 autorest.AsPost(), 688 autorest.WithBaseURL(client.BaseURI), 689 autorest.WithPath("/BackupRestore/BackupPolicies/$/Create"), 690 autorest.WithJSON(backupPolicyDescription), 691 autorest.WithQueryParameters(queryParameters)) 692 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 693} 694 695// CreateBackupPolicySender sends the CreateBackupPolicy request. The method will close the 696// http.Response Body if it receives an error. 697func (client BaseClient) CreateBackupPolicySender(req *http.Request) (*http.Response, error) { 698 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 699} 700 701// CreateBackupPolicyResponder handles the response to the CreateBackupPolicy request. The method always 702// closes the http.Response Body. 703func (client BaseClient) CreateBackupPolicyResponder(resp *http.Response) (result autorest.Response, err error) { 704 err = autorest.Respond( 705 resp, 706 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), 707 autorest.ByClosing()) 708 result.Response = resp 709 return 710} 711 712// CreateComposeDeployment compose is a file format that describes multi-container applications. This API allows 713// deploying container based applications defined in compose format in a Service Fabric cluster. Once the deployment is 714// created, its status can be tracked via the `GetComposeDeploymentStatus` API. 715// Parameters: 716// createComposeDeploymentDescription - describes the compose deployment that needs to be created. 717// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 718// duration that the client is willing to wait for the requested operation to complete. The default value for 719// this parameter is 60 seconds. 720func (client BaseClient) CreateComposeDeployment(ctx context.Context, createComposeDeploymentDescription CreateComposeDeploymentDescription, timeout *int64) (result autorest.Response, err error) { 721 if tracing.IsEnabled() { 722 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.CreateComposeDeployment") 723 defer func() { 724 sc := -1 725 if result.Response != nil { 726 sc = result.Response.StatusCode 727 } 728 tracing.EndSpan(ctx, sc, err) 729 }() 730 } 731 if err := validation.Validate([]validation.Validation{ 732 {TargetValue: createComposeDeploymentDescription, 733 Constraints: []validation.Constraint{{Target: "createComposeDeploymentDescription.DeploymentName", Name: validation.Null, Rule: true, Chain: nil}, 734 {Target: "createComposeDeploymentDescription.ComposeFileContent", Name: validation.Null, Rule: true, Chain: nil}}}, 735 {TargetValue: timeout, 736 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 737 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 738 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 739 }}}}}); err != nil { 740 return result, validation.NewError("servicefabric.BaseClient", "CreateComposeDeployment", err.Error()) 741 } 742 743 req, err := client.CreateComposeDeploymentPreparer(ctx, createComposeDeploymentDescription, timeout) 744 if err != nil { 745 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CreateComposeDeployment", nil, "Failure preparing request") 746 return 747 } 748 749 resp, err := client.CreateComposeDeploymentSender(req) 750 if err != nil { 751 result.Response = resp 752 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CreateComposeDeployment", resp, "Failure sending request") 753 return 754 } 755 756 result, err = client.CreateComposeDeploymentResponder(resp) 757 if err != nil { 758 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CreateComposeDeployment", resp, "Failure responding to request") 759 return 760 } 761 762 return 763} 764 765// CreateComposeDeploymentPreparer prepares the CreateComposeDeployment request. 766func (client BaseClient) CreateComposeDeploymentPreparer(ctx context.Context, createComposeDeploymentDescription CreateComposeDeploymentDescription, timeout *int64) (*http.Request, error) { 767 const APIVersion = "6.0-preview" 768 queryParameters := map[string]interface{}{ 769 "api-version": APIVersion, 770 } 771 if timeout != nil { 772 queryParameters["timeout"] = autorest.Encode("query", *timeout) 773 } else { 774 queryParameters["timeout"] = autorest.Encode("query", 60) 775 } 776 777 preparer := autorest.CreatePreparer( 778 autorest.AsContentType("application/json; charset=utf-8"), 779 autorest.AsPut(), 780 autorest.WithBaseURL(client.BaseURI), 781 autorest.WithPath("/ComposeDeployments/$/Create"), 782 autorest.WithJSON(createComposeDeploymentDescription), 783 autorest.WithQueryParameters(queryParameters)) 784 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 785} 786 787// CreateComposeDeploymentSender sends the CreateComposeDeployment request. The method will close the 788// http.Response Body if it receives an error. 789func (client BaseClient) CreateComposeDeploymentSender(req *http.Request) (*http.Response, error) { 790 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 791} 792 793// CreateComposeDeploymentResponder handles the response to the CreateComposeDeployment request. The method always 794// closes the http.Response Body. 795func (client BaseClient) CreateComposeDeploymentResponder(resp *http.Response) (result autorest.Response, err error) { 796 err = autorest.Respond( 797 resp, 798 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), 799 autorest.ByClosing()) 800 result.Response = resp 801 return 802} 803 804// CreateName creates the specified Service Fabric name. 805// Parameters: 806// nameDescription - describes the Service Fabric name to be created. 807// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 808// duration that the client is willing to wait for the requested operation to complete. The default value for 809// this parameter is 60 seconds. 810func (client BaseClient) CreateName(ctx context.Context, nameDescription NameDescription, timeout *int64) (result autorest.Response, err error) { 811 if tracing.IsEnabled() { 812 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.CreateName") 813 defer func() { 814 sc := -1 815 if result.Response != nil { 816 sc = result.Response.StatusCode 817 } 818 tracing.EndSpan(ctx, sc, err) 819 }() 820 } 821 if err := validation.Validate([]validation.Validation{ 822 {TargetValue: nameDescription, 823 Constraints: []validation.Constraint{{Target: "nameDescription.Name", Name: validation.Null, Rule: true, Chain: nil}}}, 824 {TargetValue: timeout, 825 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 826 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 827 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 828 }}}}}); err != nil { 829 return result, validation.NewError("servicefabric.BaseClient", "CreateName", err.Error()) 830 } 831 832 req, err := client.CreateNamePreparer(ctx, nameDescription, timeout) 833 if err != nil { 834 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CreateName", nil, "Failure preparing request") 835 return 836 } 837 838 resp, err := client.CreateNameSender(req) 839 if err != nil { 840 result.Response = resp 841 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CreateName", resp, "Failure sending request") 842 return 843 } 844 845 result, err = client.CreateNameResponder(resp) 846 if err != nil { 847 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CreateName", resp, "Failure responding to request") 848 return 849 } 850 851 return 852} 853 854// CreateNamePreparer prepares the CreateName request. 855func (client BaseClient) CreateNamePreparer(ctx context.Context, nameDescription NameDescription, timeout *int64) (*http.Request, error) { 856 const APIVersion = "6.0" 857 queryParameters := map[string]interface{}{ 858 "api-version": APIVersion, 859 } 860 if timeout != nil { 861 queryParameters["timeout"] = autorest.Encode("query", *timeout) 862 } else { 863 queryParameters["timeout"] = autorest.Encode("query", 60) 864 } 865 866 preparer := autorest.CreatePreparer( 867 autorest.AsContentType("application/json; charset=utf-8"), 868 autorest.AsPost(), 869 autorest.WithBaseURL(client.BaseURI), 870 autorest.WithPath("/Names/$/Create"), 871 autorest.WithJSON(nameDescription), 872 autorest.WithQueryParameters(queryParameters)) 873 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 874} 875 876// CreateNameSender sends the CreateName request. The method will close the 877// http.Response Body if it receives an error. 878func (client BaseClient) CreateNameSender(req *http.Request) (*http.Response, error) { 879 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 880} 881 882// CreateNameResponder handles the response to the CreateName request. The method always 883// closes the http.Response Body. 884func (client BaseClient) CreateNameResponder(resp *http.Response) (result autorest.Response, err error) { 885 err = autorest.Respond( 886 resp, 887 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), 888 autorest.ByClosing()) 889 result.Response = resp 890 return 891} 892 893// CreateRepairTask for clusters that have the Repair Manager Service configured, 894// this API provides a way to create repair tasks that run automatically or manually. 895// For repair tasks that run automatically, an appropriate repair executor 896// must be running for each repair action to run automatically. 897// These are currently only available in specially-configured Azure Cloud Services. 898// 899// To create a manual repair task, provide the set of impacted node names and the 900// expected impact. When the state of the created repair task changes to approved, 901// you can safely perform repair actions on those nodes. 902// 903// This API supports the Service Fabric platform; it is not meant to be used directly from your code. 904// Parameters: 905// repairTask - describes the repair task to be created or updated. 906func (client BaseClient) CreateRepairTask(ctx context.Context, repairTask RepairTask) (result RepairTaskUpdateInfo, err error) { 907 if tracing.IsEnabled() { 908 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.CreateRepairTask") 909 defer func() { 910 sc := -1 911 if result.Response.Response != nil { 912 sc = result.Response.Response.StatusCode 913 } 914 tracing.EndSpan(ctx, sc, err) 915 }() 916 } 917 if err := validation.Validate([]validation.Validation{ 918 {TargetValue: repairTask, 919 Constraints: []validation.Constraint{{Target: "repairTask.TaskID", Name: validation.Null, Rule: true, Chain: nil}, 920 {Target: "repairTask.Action", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { 921 return result, validation.NewError("servicefabric.BaseClient", "CreateRepairTask", err.Error()) 922 } 923 924 req, err := client.CreateRepairTaskPreparer(ctx, repairTask) 925 if err != nil { 926 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CreateRepairTask", nil, "Failure preparing request") 927 return 928 } 929 930 resp, err := client.CreateRepairTaskSender(req) 931 if err != nil { 932 result.Response = autorest.Response{Response: resp} 933 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CreateRepairTask", resp, "Failure sending request") 934 return 935 } 936 937 result, err = client.CreateRepairTaskResponder(resp) 938 if err != nil { 939 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CreateRepairTask", resp, "Failure responding to request") 940 return 941 } 942 943 return 944} 945 946// CreateRepairTaskPreparer prepares the CreateRepairTask request. 947func (client BaseClient) CreateRepairTaskPreparer(ctx context.Context, repairTask RepairTask) (*http.Request, error) { 948 const APIVersion = "6.0" 949 queryParameters := map[string]interface{}{ 950 "api-version": APIVersion, 951 } 952 953 preparer := autorest.CreatePreparer( 954 autorest.AsContentType("application/json; charset=utf-8"), 955 autorest.AsPost(), 956 autorest.WithBaseURL(client.BaseURI), 957 autorest.WithPath("/$/CreateRepairTask"), 958 autorest.WithJSON(repairTask), 959 autorest.WithQueryParameters(queryParameters)) 960 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 961} 962 963// CreateRepairTaskSender sends the CreateRepairTask request. The method will close the 964// http.Response Body if it receives an error. 965func (client BaseClient) CreateRepairTaskSender(req *http.Request) (*http.Response, error) { 966 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 967} 968 969// CreateRepairTaskResponder handles the response to the CreateRepairTask request. The method always 970// closes the http.Response Body. 971func (client BaseClient) CreateRepairTaskResponder(resp *http.Response) (result RepairTaskUpdateInfo, err error) { 972 err = autorest.Respond( 973 resp, 974 azure.WithErrorUnlessStatusCode(http.StatusOK), 975 autorest.ByUnmarshallingJSON(&result), 976 autorest.ByClosing()) 977 result.Response = autorest.Response{Response: resp} 978 return 979} 980 981// CreateService this api allows creating a new Service Fabric stateless or stateful service under a specified Service 982// Fabric application. The description for creating the service includes partitioning information and optional 983// properties for placement and load balancing. Some of the properties can later be modified using `UpdateService` API. 984// Parameters: 985// applicationID - the identity of the application. This is typically the full name of the application without 986// the 'fabric:' URI scheme. 987// Starting from version 6.0, hierarchical names are delimited with the "~" character. 988// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" 989// in 6.0+ and "myapp/app1" in previous versions. 990// serviceDescription - the information necessary to create a service. 991// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 992// duration that the client is willing to wait for the requested operation to complete. The default value for 993// this parameter is 60 seconds. 994func (client BaseClient) CreateService(ctx context.Context, applicationID string, serviceDescription BasicServiceDescription, timeout *int64) (result autorest.Response, err error) { 995 if tracing.IsEnabled() { 996 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.CreateService") 997 defer func() { 998 sc := -1 999 if result.Response != nil { 1000 sc = result.Response.StatusCode 1001 } 1002 tracing.EndSpan(ctx, sc, err) 1003 }() 1004 } 1005 if err := validation.Validate([]validation.Validation{ 1006 {TargetValue: serviceDescription, 1007 Constraints: []validation.Constraint{{Target: "serviceDescription.ServiceName", Name: validation.Null, Rule: true, Chain: nil}, 1008 {Target: "serviceDescription.ServiceTypeName", Name: validation.Null, Rule: true, Chain: nil}}}, 1009 {TargetValue: timeout, 1010 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 1011 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 1012 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 1013 }}}}}); err != nil { 1014 return result, validation.NewError("servicefabric.BaseClient", "CreateService", err.Error()) 1015 } 1016 1017 req, err := client.CreateServicePreparer(ctx, applicationID, serviceDescription, timeout) 1018 if err != nil { 1019 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CreateService", nil, "Failure preparing request") 1020 return 1021 } 1022 1023 resp, err := client.CreateServiceSender(req) 1024 if err != nil { 1025 result.Response = resp 1026 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CreateService", resp, "Failure sending request") 1027 return 1028 } 1029 1030 result, err = client.CreateServiceResponder(resp) 1031 if err != nil { 1032 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CreateService", resp, "Failure responding to request") 1033 return 1034 } 1035 1036 return 1037} 1038 1039// CreateServicePreparer prepares the CreateService request. 1040func (client BaseClient) CreateServicePreparer(ctx context.Context, applicationID string, serviceDescription BasicServiceDescription, timeout *int64) (*http.Request, error) { 1041 pathParameters := map[string]interface{}{ 1042 "applicationId": applicationID, 1043 } 1044 1045 const APIVersion = "6.0" 1046 queryParameters := map[string]interface{}{ 1047 "api-version": APIVersion, 1048 } 1049 if timeout != nil { 1050 queryParameters["timeout"] = autorest.Encode("query", *timeout) 1051 } else { 1052 queryParameters["timeout"] = autorest.Encode("query", 60) 1053 } 1054 1055 preparer := autorest.CreatePreparer( 1056 autorest.AsContentType("application/json; charset=utf-8"), 1057 autorest.AsPost(), 1058 autorest.WithBaseURL(client.BaseURI), 1059 autorest.WithPathParameters("/Applications/{applicationId}/$/GetServices/$/Create", pathParameters), 1060 autorest.WithJSON(serviceDescription), 1061 autorest.WithQueryParameters(queryParameters)) 1062 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 1063} 1064 1065// CreateServiceSender sends the CreateService request. The method will close the 1066// http.Response Body if it receives an error. 1067func (client BaseClient) CreateServiceSender(req *http.Request) (*http.Response, error) { 1068 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 1069} 1070 1071// CreateServiceResponder handles the response to the CreateService request. The method always 1072// closes the http.Response Body. 1073func (client BaseClient) CreateServiceResponder(resp *http.Response) (result autorest.Response, err error) { 1074 err = autorest.Respond( 1075 resp, 1076 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), 1077 autorest.ByClosing()) 1078 result.Response = resp 1079 return 1080} 1081 1082// CreateServiceFromTemplate creates a Service Fabric service from the service template defined in the application 1083// manifest. A service template contains the properties that will be same for the service instance of the same type. 1084// The API allows overriding the properties that are usually different for different services of the same service type. 1085// Parameters: 1086// applicationID - the identity of the application. This is typically the full name of the application without 1087// the 'fabric:' URI scheme. 1088// Starting from version 6.0, hierarchical names are delimited with the "~" character. 1089// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" 1090// in 6.0+ and "myapp/app1" in previous versions. 1091// serviceFromTemplateDescription - describes the service that needs to be created from the template defined in 1092// the application manifest. 1093// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 1094// duration that the client is willing to wait for the requested operation to complete. The default value for 1095// this parameter is 60 seconds. 1096func (client BaseClient) CreateServiceFromTemplate(ctx context.Context, applicationID string, serviceFromTemplateDescription ServiceFromTemplateDescription, timeout *int64) (result autorest.Response, err error) { 1097 if tracing.IsEnabled() { 1098 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.CreateServiceFromTemplate") 1099 defer func() { 1100 sc := -1 1101 if result.Response != nil { 1102 sc = result.Response.StatusCode 1103 } 1104 tracing.EndSpan(ctx, sc, err) 1105 }() 1106 } 1107 if err := validation.Validate([]validation.Validation{ 1108 {TargetValue: serviceFromTemplateDescription, 1109 Constraints: []validation.Constraint{{Target: "serviceFromTemplateDescription.ApplicationName", Name: validation.Null, Rule: true, Chain: nil}, 1110 {Target: "serviceFromTemplateDescription.ServiceName", Name: validation.Null, Rule: true, Chain: nil}, 1111 {Target: "serviceFromTemplateDescription.ServiceTypeName", Name: validation.Null, Rule: true, Chain: nil}}}, 1112 {TargetValue: timeout, 1113 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 1114 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 1115 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 1116 }}}}}); err != nil { 1117 return result, validation.NewError("servicefabric.BaseClient", "CreateServiceFromTemplate", err.Error()) 1118 } 1119 1120 req, err := client.CreateServiceFromTemplatePreparer(ctx, applicationID, serviceFromTemplateDescription, timeout) 1121 if err != nil { 1122 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CreateServiceFromTemplate", nil, "Failure preparing request") 1123 return 1124 } 1125 1126 resp, err := client.CreateServiceFromTemplateSender(req) 1127 if err != nil { 1128 result.Response = resp 1129 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CreateServiceFromTemplate", resp, "Failure sending request") 1130 return 1131 } 1132 1133 result, err = client.CreateServiceFromTemplateResponder(resp) 1134 if err != nil { 1135 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "CreateServiceFromTemplate", resp, "Failure responding to request") 1136 return 1137 } 1138 1139 return 1140} 1141 1142// CreateServiceFromTemplatePreparer prepares the CreateServiceFromTemplate request. 1143func (client BaseClient) CreateServiceFromTemplatePreparer(ctx context.Context, applicationID string, serviceFromTemplateDescription ServiceFromTemplateDescription, timeout *int64) (*http.Request, error) { 1144 pathParameters := map[string]interface{}{ 1145 "applicationId": applicationID, 1146 } 1147 1148 const APIVersion = "6.0" 1149 queryParameters := map[string]interface{}{ 1150 "api-version": APIVersion, 1151 } 1152 if timeout != nil { 1153 queryParameters["timeout"] = autorest.Encode("query", *timeout) 1154 } else { 1155 queryParameters["timeout"] = autorest.Encode("query", 60) 1156 } 1157 1158 preparer := autorest.CreatePreparer( 1159 autorest.AsContentType("application/json; charset=utf-8"), 1160 autorest.AsPost(), 1161 autorest.WithBaseURL(client.BaseURI), 1162 autorest.WithPathParameters("/Applications/{applicationId}/$/GetServices/$/CreateFromTemplate", pathParameters), 1163 autorest.WithJSON(serviceFromTemplateDescription), 1164 autorest.WithQueryParameters(queryParameters)) 1165 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 1166} 1167 1168// CreateServiceFromTemplateSender sends the CreateServiceFromTemplate request. The method will close the 1169// http.Response Body if it receives an error. 1170func (client BaseClient) CreateServiceFromTemplateSender(req *http.Request) (*http.Response, error) { 1171 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 1172} 1173 1174// CreateServiceFromTemplateResponder handles the response to the CreateServiceFromTemplate request. The method always 1175// closes the http.Response Body. 1176func (client BaseClient) CreateServiceFromTemplateResponder(resp *http.Response) (result autorest.Response, err error) { 1177 err = autorest.Respond( 1178 resp, 1179 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), 1180 autorest.ByClosing()) 1181 result.Response = resp 1182 return 1183} 1184 1185// DeleteApplication an application must be created before it can be deleted. Deleting an application will delete all 1186// services that are part of that application. By default, Service Fabric will try to close service replicas in a 1187// graceful manner and then delete the service. However, if a service is having issues closing the replica gracefully, 1188// the delete operation may take a long time or get stuck. Use the optional ForceRemove flag to skip the graceful close 1189// sequence and forcefully delete the application and all of its services. 1190// Parameters: 1191// applicationID - the identity of the application. This is typically the full name of the application without 1192// the 'fabric:' URI scheme. 1193// Starting from version 6.0, hierarchical names are delimited with the "~" character. 1194// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" 1195// in 6.0+ and "myapp/app1" in previous versions. 1196// forceRemove - remove a Service Fabric application or service forcefully without going through the graceful 1197// shutdown sequence. This parameter can be used to forcefully delete an application or service for which 1198// delete is timing out due to issues in the service code that prevents graceful close of replicas. 1199// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 1200// duration that the client is willing to wait for the requested operation to complete. The default value for 1201// this parameter is 60 seconds. 1202func (client BaseClient) DeleteApplication(ctx context.Context, applicationID string, forceRemove *bool, timeout *int64) (result autorest.Response, err error) { 1203 if tracing.IsEnabled() { 1204 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.DeleteApplication") 1205 defer func() { 1206 sc := -1 1207 if result.Response != nil { 1208 sc = result.Response.StatusCode 1209 } 1210 tracing.EndSpan(ctx, sc, err) 1211 }() 1212 } 1213 if err := validation.Validate([]validation.Validation{ 1214 {TargetValue: timeout, 1215 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 1216 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 1217 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 1218 }}}}}); err != nil { 1219 return result, validation.NewError("servicefabric.BaseClient", "DeleteApplication", err.Error()) 1220 } 1221 1222 req, err := client.DeleteApplicationPreparer(ctx, applicationID, forceRemove, timeout) 1223 if err != nil { 1224 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeleteApplication", nil, "Failure preparing request") 1225 return 1226 } 1227 1228 resp, err := client.DeleteApplicationSender(req) 1229 if err != nil { 1230 result.Response = resp 1231 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeleteApplication", resp, "Failure sending request") 1232 return 1233 } 1234 1235 result, err = client.DeleteApplicationResponder(resp) 1236 if err != nil { 1237 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeleteApplication", resp, "Failure responding to request") 1238 return 1239 } 1240 1241 return 1242} 1243 1244// DeleteApplicationPreparer prepares the DeleteApplication request. 1245func (client BaseClient) DeleteApplicationPreparer(ctx context.Context, applicationID string, forceRemove *bool, timeout *int64) (*http.Request, error) { 1246 pathParameters := map[string]interface{}{ 1247 "applicationId": applicationID, 1248 } 1249 1250 const APIVersion = "6.0" 1251 queryParameters := map[string]interface{}{ 1252 "api-version": APIVersion, 1253 } 1254 if forceRemove != nil { 1255 queryParameters["ForceRemove"] = autorest.Encode("query", *forceRemove) 1256 } 1257 if timeout != nil { 1258 queryParameters["timeout"] = autorest.Encode("query", *timeout) 1259 } else { 1260 queryParameters["timeout"] = autorest.Encode("query", 60) 1261 } 1262 1263 preparer := autorest.CreatePreparer( 1264 autorest.AsPost(), 1265 autorest.WithBaseURL(client.BaseURI), 1266 autorest.WithPathParameters("/Applications/{applicationId}/$/Delete", pathParameters), 1267 autorest.WithQueryParameters(queryParameters)) 1268 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 1269} 1270 1271// DeleteApplicationSender sends the DeleteApplication request. The method will close the 1272// http.Response Body if it receives an error. 1273func (client BaseClient) DeleteApplicationSender(req *http.Request) (*http.Response, error) { 1274 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 1275} 1276 1277// DeleteApplicationResponder handles the response to the DeleteApplication request. The method always 1278// closes the http.Response Body. 1279func (client BaseClient) DeleteApplicationResponder(resp *http.Response) (result autorest.Response, err error) { 1280 err = autorest.Respond( 1281 resp, 1282 azure.WithErrorUnlessStatusCode(http.StatusOK), 1283 autorest.ByClosing()) 1284 result.Response = resp 1285 return 1286} 1287 1288// DeleteBackupPolicy deletes an existing backup policy. A backup policy must be created before it can be deleted. A 1289// currently active backup policy, associated with any Service Fabric application, service or partition, cannot be 1290// deleted without first deleting the mapping. 1291// Parameters: 1292// backupPolicyName - the name of the backup policy. 1293// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 1294// duration that the client is willing to wait for the requested operation to complete. The default value for 1295// this parameter is 60 seconds. 1296func (client BaseClient) DeleteBackupPolicy(ctx context.Context, backupPolicyName string, timeout *int64) (result autorest.Response, err error) { 1297 if tracing.IsEnabled() { 1298 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.DeleteBackupPolicy") 1299 defer func() { 1300 sc := -1 1301 if result.Response != nil { 1302 sc = result.Response.StatusCode 1303 } 1304 tracing.EndSpan(ctx, sc, err) 1305 }() 1306 } 1307 if err := validation.Validate([]validation.Validation{ 1308 {TargetValue: timeout, 1309 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 1310 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 1311 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 1312 }}}}}); err != nil { 1313 return result, validation.NewError("servicefabric.BaseClient", "DeleteBackupPolicy", err.Error()) 1314 } 1315 1316 req, err := client.DeleteBackupPolicyPreparer(ctx, backupPolicyName, timeout) 1317 if err != nil { 1318 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeleteBackupPolicy", nil, "Failure preparing request") 1319 return 1320 } 1321 1322 resp, err := client.DeleteBackupPolicySender(req) 1323 if err != nil { 1324 result.Response = resp 1325 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeleteBackupPolicy", resp, "Failure sending request") 1326 return 1327 } 1328 1329 result, err = client.DeleteBackupPolicyResponder(resp) 1330 if err != nil { 1331 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeleteBackupPolicy", resp, "Failure responding to request") 1332 return 1333 } 1334 1335 return 1336} 1337 1338// DeleteBackupPolicyPreparer prepares the DeleteBackupPolicy request. 1339func (client BaseClient) DeleteBackupPolicyPreparer(ctx context.Context, backupPolicyName string, timeout *int64) (*http.Request, error) { 1340 pathParameters := map[string]interface{}{ 1341 "backupPolicyName": autorest.Encode("path", backupPolicyName), 1342 } 1343 1344 const APIVersion = "6.4" 1345 queryParameters := map[string]interface{}{ 1346 "api-version": APIVersion, 1347 } 1348 if timeout != nil { 1349 queryParameters["timeout"] = autorest.Encode("query", *timeout) 1350 } else { 1351 queryParameters["timeout"] = autorest.Encode("query", 60) 1352 } 1353 1354 preparer := autorest.CreatePreparer( 1355 autorest.AsPost(), 1356 autorest.WithBaseURL(client.BaseURI), 1357 autorest.WithPathParameters("/BackupRestore/BackupPolicies/{backupPolicyName}/$/Delete", pathParameters), 1358 autorest.WithQueryParameters(queryParameters)) 1359 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 1360} 1361 1362// DeleteBackupPolicySender sends the DeleteBackupPolicy request. The method will close the 1363// http.Response Body if it receives an error. 1364func (client BaseClient) DeleteBackupPolicySender(req *http.Request) (*http.Response, error) { 1365 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 1366} 1367 1368// DeleteBackupPolicyResponder handles the response to the DeleteBackupPolicy request. The method always 1369// closes the http.Response Body. 1370func (client BaseClient) DeleteBackupPolicyResponder(resp *http.Response) (result autorest.Response, err error) { 1371 err = autorest.Respond( 1372 resp, 1373 azure.WithErrorUnlessStatusCode(http.StatusOK), 1374 autorest.ByClosing()) 1375 result.Response = resp 1376 return 1377} 1378 1379// DeleteImageStoreContent deletes existing image store content being found within the given image store relative path. 1380// This command can be used to delete uploaded application packages once they are provisioned. 1381// Parameters: 1382// contentPath - relative path to file or folder in the image store from its root. 1383// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 1384// duration that the client is willing to wait for the requested operation to complete. The default value for 1385// this parameter is 60 seconds. 1386func (client BaseClient) DeleteImageStoreContent(ctx context.Context, contentPath string, timeout *int64) (result autorest.Response, err error) { 1387 if tracing.IsEnabled() { 1388 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.DeleteImageStoreContent") 1389 defer func() { 1390 sc := -1 1391 if result.Response != nil { 1392 sc = result.Response.StatusCode 1393 } 1394 tracing.EndSpan(ctx, sc, err) 1395 }() 1396 } 1397 if err := validation.Validate([]validation.Validation{ 1398 {TargetValue: timeout, 1399 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 1400 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 1401 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 1402 }}}}}); err != nil { 1403 return result, validation.NewError("servicefabric.BaseClient", "DeleteImageStoreContent", err.Error()) 1404 } 1405 1406 req, err := client.DeleteImageStoreContentPreparer(ctx, contentPath, timeout) 1407 if err != nil { 1408 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeleteImageStoreContent", nil, "Failure preparing request") 1409 return 1410 } 1411 1412 resp, err := client.DeleteImageStoreContentSender(req) 1413 if err != nil { 1414 result.Response = resp 1415 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeleteImageStoreContent", resp, "Failure sending request") 1416 return 1417 } 1418 1419 result, err = client.DeleteImageStoreContentResponder(resp) 1420 if err != nil { 1421 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeleteImageStoreContent", resp, "Failure responding to request") 1422 return 1423 } 1424 1425 return 1426} 1427 1428// DeleteImageStoreContentPreparer prepares the DeleteImageStoreContent request. 1429func (client BaseClient) DeleteImageStoreContentPreparer(ctx context.Context, contentPath string, timeout *int64) (*http.Request, error) { 1430 pathParameters := map[string]interface{}{ 1431 "contentPath": autorest.Encode("path", contentPath), 1432 } 1433 1434 const APIVersion = "6.0" 1435 queryParameters := map[string]interface{}{ 1436 "api-version": APIVersion, 1437 } 1438 if timeout != nil { 1439 queryParameters["timeout"] = autorest.Encode("query", *timeout) 1440 } else { 1441 queryParameters["timeout"] = autorest.Encode("query", 60) 1442 } 1443 1444 preparer := autorest.CreatePreparer( 1445 autorest.AsDelete(), 1446 autorest.WithBaseURL(client.BaseURI), 1447 autorest.WithPathParameters("/ImageStore/{contentPath}", pathParameters), 1448 autorest.WithQueryParameters(queryParameters)) 1449 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 1450} 1451 1452// DeleteImageStoreContentSender sends the DeleteImageStoreContent request. The method will close the 1453// http.Response Body if it receives an error. 1454func (client BaseClient) DeleteImageStoreContentSender(req *http.Request) (*http.Response, error) { 1455 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 1456} 1457 1458// DeleteImageStoreContentResponder handles the response to the DeleteImageStoreContent request. The method always 1459// closes the http.Response Body. 1460func (client BaseClient) DeleteImageStoreContentResponder(resp *http.Response) (result autorest.Response, err error) { 1461 err = autorest.Respond( 1462 resp, 1463 azure.WithErrorUnlessStatusCode(http.StatusOK), 1464 autorest.ByClosing()) 1465 result.Response = resp 1466 return 1467} 1468 1469// DeleteImageStoreUploadSession the DELETE request will cause the existing upload session to expire and remove any 1470// previously uploaded file chunks. 1471// Parameters: 1472// sessionID - a GUID generated by the user for a file uploading. It identifies an image store upload session 1473// which keeps track of all file chunks until it is committed. 1474// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 1475// duration that the client is willing to wait for the requested operation to complete. The default value for 1476// this parameter is 60 seconds. 1477func (client BaseClient) DeleteImageStoreUploadSession(ctx context.Context, sessionID uuid.UUID, timeout *int64) (result autorest.Response, err error) { 1478 if tracing.IsEnabled() { 1479 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.DeleteImageStoreUploadSession") 1480 defer func() { 1481 sc := -1 1482 if result.Response != nil { 1483 sc = result.Response.StatusCode 1484 } 1485 tracing.EndSpan(ctx, sc, err) 1486 }() 1487 } 1488 if err := validation.Validate([]validation.Validation{ 1489 {TargetValue: timeout, 1490 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 1491 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 1492 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 1493 }}}}}); err != nil { 1494 return result, validation.NewError("servicefabric.BaseClient", "DeleteImageStoreUploadSession", err.Error()) 1495 } 1496 1497 req, err := client.DeleteImageStoreUploadSessionPreparer(ctx, sessionID, timeout) 1498 if err != nil { 1499 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeleteImageStoreUploadSession", nil, "Failure preparing request") 1500 return 1501 } 1502 1503 resp, err := client.DeleteImageStoreUploadSessionSender(req) 1504 if err != nil { 1505 result.Response = resp 1506 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeleteImageStoreUploadSession", resp, "Failure sending request") 1507 return 1508 } 1509 1510 result, err = client.DeleteImageStoreUploadSessionResponder(resp) 1511 if err != nil { 1512 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeleteImageStoreUploadSession", resp, "Failure responding to request") 1513 return 1514 } 1515 1516 return 1517} 1518 1519// DeleteImageStoreUploadSessionPreparer prepares the DeleteImageStoreUploadSession request. 1520func (client BaseClient) DeleteImageStoreUploadSessionPreparer(ctx context.Context, sessionID uuid.UUID, timeout *int64) (*http.Request, error) { 1521 const APIVersion = "6.0" 1522 queryParameters := map[string]interface{}{ 1523 "api-version": APIVersion, 1524 "session-id": autorest.Encode("query", sessionID), 1525 } 1526 if timeout != nil { 1527 queryParameters["timeout"] = autorest.Encode("query", *timeout) 1528 } else { 1529 queryParameters["timeout"] = autorest.Encode("query", 60) 1530 } 1531 1532 preparer := autorest.CreatePreparer( 1533 autorest.AsDelete(), 1534 autorest.WithBaseURL(client.BaseURI), 1535 autorest.WithPath("/ImageStore/$/DeleteUploadSession"), 1536 autorest.WithQueryParameters(queryParameters)) 1537 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 1538} 1539 1540// DeleteImageStoreUploadSessionSender sends the DeleteImageStoreUploadSession request. The method will close the 1541// http.Response Body if it receives an error. 1542func (client BaseClient) DeleteImageStoreUploadSessionSender(req *http.Request) (*http.Response, error) { 1543 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 1544} 1545 1546// DeleteImageStoreUploadSessionResponder handles the response to the DeleteImageStoreUploadSession request. The method always 1547// closes the http.Response Body. 1548func (client BaseClient) DeleteImageStoreUploadSessionResponder(resp *http.Response) (result autorest.Response, err error) { 1549 err = autorest.Respond( 1550 resp, 1551 azure.WithErrorUnlessStatusCode(http.StatusOK), 1552 autorest.ByClosing()) 1553 result.Response = resp 1554 return 1555} 1556 1557// DeleteName deletes the specified Service Fabric name. A name must be created before it can be deleted. Deleting a 1558// name with child properties will fail. 1559// Parameters: 1560// nameID - the Service Fabric name, without the 'fabric:' URI scheme. 1561// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 1562// duration that the client is willing to wait for the requested operation to complete. The default value for 1563// this parameter is 60 seconds. 1564func (client BaseClient) DeleteName(ctx context.Context, nameID string, timeout *int64) (result autorest.Response, err error) { 1565 if tracing.IsEnabled() { 1566 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.DeleteName") 1567 defer func() { 1568 sc := -1 1569 if result.Response != nil { 1570 sc = result.Response.StatusCode 1571 } 1572 tracing.EndSpan(ctx, sc, err) 1573 }() 1574 } 1575 if err := validation.Validate([]validation.Validation{ 1576 {TargetValue: timeout, 1577 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 1578 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 1579 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 1580 }}}}}); err != nil { 1581 return result, validation.NewError("servicefabric.BaseClient", "DeleteName", err.Error()) 1582 } 1583 1584 req, err := client.DeleteNamePreparer(ctx, nameID, timeout) 1585 if err != nil { 1586 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeleteName", nil, "Failure preparing request") 1587 return 1588 } 1589 1590 resp, err := client.DeleteNameSender(req) 1591 if err != nil { 1592 result.Response = resp 1593 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeleteName", resp, "Failure sending request") 1594 return 1595 } 1596 1597 result, err = client.DeleteNameResponder(resp) 1598 if err != nil { 1599 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeleteName", resp, "Failure responding to request") 1600 return 1601 } 1602 1603 return 1604} 1605 1606// DeleteNamePreparer prepares the DeleteName request. 1607func (client BaseClient) DeleteNamePreparer(ctx context.Context, nameID string, timeout *int64) (*http.Request, error) { 1608 pathParameters := map[string]interface{}{ 1609 "nameId": nameID, 1610 } 1611 1612 const APIVersion = "6.0" 1613 queryParameters := map[string]interface{}{ 1614 "api-version": APIVersion, 1615 } 1616 if timeout != nil { 1617 queryParameters["timeout"] = autorest.Encode("query", *timeout) 1618 } else { 1619 queryParameters["timeout"] = autorest.Encode("query", 60) 1620 } 1621 1622 preparer := autorest.CreatePreparer( 1623 autorest.AsDelete(), 1624 autorest.WithBaseURL(client.BaseURI), 1625 autorest.WithPathParameters("/Names/{nameId}", pathParameters), 1626 autorest.WithQueryParameters(queryParameters)) 1627 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 1628} 1629 1630// DeleteNameSender sends the DeleteName request. The method will close the 1631// http.Response Body if it receives an error. 1632func (client BaseClient) DeleteNameSender(req *http.Request) (*http.Response, error) { 1633 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 1634} 1635 1636// DeleteNameResponder handles the response to the DeleteName request. The method always 1637// closes the http.Response Body. 1638func (client BaseClient) DeleteNameResponder(resp *http.Response) (result autorest.Response, err error) { 1639 err = autorest.Respond( 1640 resp, 1641 azure.WithErrorUnlessStatusCode(http.StatusOK), 1642 autorest.ByClosing()) 1643 result.Response = resp 1644 return 1645} 1646 1647// DeleteProperty deletes the specified Service Fabric property under a given name. A property must be created before 1648// it can be deleted. 1649// Parameters: 1650// nameID - the Service Fabric name, without the 'fabric:' URI scheme. 1651// propertyName - specifies the name of the property to get. 1652// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 1653// duration that the client is willing to wait for the requested operation to complete. The default value for 1654// this parameter is 60 seconds. 1655func (client BaseClient) DeleteProperty(ctx context.Context, nameID string, propertyName string, timeout *int64) (result autorest.Response, err error) { 1656 if tracing.IsEnabled() { 1657 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.DeleteProperty") 1658 defer func() { 1659 sc := -1 1660 if result.Response != nil { 1661 sc = result.Response.StatusCode 1662 } 1663 tracing.EndSpan(ctx, sc, err) 1664 }() 1665 } 1666 if err := validation.Validate([]validation.Validation{ 1667 {TargetValue: timeout, 1668 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 1669 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 1670 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 1671 }}}}}); err != nil { 1672 return result, validation.NewError("servicefabric.BaseClient", "DeleteProperty", err.Error()) 1673 } 1674 1675 req, err := client.DeletePropertyPreparer(ctx, nameID, propertyName, timeout) 1676 if err != nil { 1677 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeleteProperty", nil, "Failure preparing request") 1678 return 1679 } 1680 1681 resp, err := client.DeletePropertySender(req) 1682 if err != nil { 1683 result.Response = resp 1684 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeleteProperty", resp, "Failure sending request") 1685 return 1686 } 1687 1688 result, err = client.DeletePropertyResponder(resp) 1689 if err != nil { 1690 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeleteProperty", resp, "Failure responding to request") 1691 return 1692 } 1693 1694 return 1695} 1696 1697// DeletePropertyPreparer prepares the DeleteProperty request. 1698func (client BaseClient) DeletePropertyPreparer(ctx context.Context, nameID string, propertyName string, timeout *int64) (*http.Request, error) { 1699 pathParameters := map[string]interface{}{ 1700 "nameId": nameID, 1701 } 1702 1703 const APIVersion = "6.0" 1704 queryParameters := map[string]interface{}{ 1705 "api-version": APIVersion, 1706 "PropertyName": autorest.Encode("query", propertyName), 1707 } 1708 if timeout != nil { 1709 queryParameters["timeout"] = autorest.Encode("query", *timeout) 1710 } else { 1711 queryParameters["timeout"] = autorest.Encode("query", 60) 1712 } 1713 1714 preparer := autorest.CreatePreparer( 1715 autorest.AsDelete(), 1716 autorest.WithBaseURL(client.BaseURI), 1717 autorest.WithPathParameters("/Names/{nameId}/$/GetProperty", pathParameters), 1718 autorest.WithQueryParameters(queryParameters)) 1719 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 1720} 1721 1722// DeletePropertySender sends the DeleteProperty request. The method will close the 1723// http.Response Body if it receives an error. 1724func (client BaseClient) DeletePropertySender(req *http.Request) (*http.Response, error) { 1725 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 1726} 1727 1728// DeletePropertyResponder handles the response to the DeleteProperty request. The method always 1729// closes the http.Response Body. 1730func (client BaseClient) DeletePropertyResponder(resp *http.Response) (result autorest.Response, err error) { 1731 err = autorest.Respond( 1732 resp, 1733 azure.WithErrorUnlessStatusCode(http.StatusOK), 1734 autorest.ByClosing()) 1735 result.Response = resp 1736 return 1737} 1738 1739// DeleteRepairTask this API supports the Service Fabric platform; it is not meant to be used directly from your code. 1740// Parameters: 1741// repairTaskDeleteDescription - describes the repair task to be deleted. 1742func (client BaseClient) DeleteRepairTask(ctx context.Context, repairTaskDeleteDescription RepairTaskDeleteDescription) (result autorest.Response, err error) { 1743 if tracing.IsEnabled() { 1744 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.DeleteRepairTask") 1745 defer func() { 1746 sc := -1 1747 if result.Response != nil { 1748 sc = result.Response.StatusCode 1749 } 1750 tracing.EndSpan(ctx, sc, err) 1751 }() 1752 } 1753 if err := validation.Validate([]validation.Validation{ 1754 {TargetValue: repairTaskDeleteDescription, 1755 Constraints: []validation.Constraint{{Target: "repairTaskDeleteDescription.TaskID", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { 1756 return result, validation.NewError("servicefabric.BaseClient", "DeleteRepairTask", err.Error()) 1757 } 1758 1759 req, err := client.DeleteRepairTaskPreparer(ctx, repairTaskDeleteDescription) 1760 if err != nil { 1761 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeleteRepairTask", nil, "Failure preparing request") 1762 return 1763 } 1764 1765 resp, err := client.DeleteRepairTaskSender(req) 1766 if err != nil { 1767 result.Response = resp 1768 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeleteRepairTask", resp, "Failure sending request") 1769 return 1770 } 1771 1772 result, err = client.DeleteRepairTaskResponder(resp) 1773 if err != nil { 1774 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeleteRepairTask", resp, "Failure responding to request") 1775 return 1776 } 1777 1778 return 1779} 1780 1781// DeleteRepairTaskPreparer prepares the DeleteRepairTask request. 1782func (client BaseClient) DeleteRepairTaskPreparer(ctx context.Context, repairTaskDeleteDescription RepairTaskDeleteDescription) (*http.Request, error) { 1783 const APIVersion = "6.0" 1784 queryParameters := map[string]interface{}{ 1785 "api-version": APIVersion, 1786 } 1787 1788 preparer := autorest.CreatePreparer( 1789 autorest.AsContentType("application/json; charset=utf-8"), 1790 autorest.AsPost(), 1791 autorest.WithBaseURL(client.BaseURI), 1792 autorest.WithPath("/$/DeleteRepairTask"), 1793 autorest.WithJSON(repairTaskDeleteDescription), 1794 autorest.WithQueryParameters(queryParameters)) 1795 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 1796} 1797 1798// DeleteRepairTaskSender sends the DeleteRepairTask request. The method will close the 1799// http.Response Body if it receives an error. 1800func (client BaseClient) DeleteRepairTaskSender(req *http.Request) (*http.Response, error) { 1801 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 1802} 1803 1804// DeleteRepairTaskResponder handles the response to the DeleteRepairTask request. The method always 1805// closes the http.Response Body. 1806func (client BaseClient) DeleteRepairTaskResponder(resp *http.Response) (result autorest.Response, err error) { 1807 err = autorest.Respond( 1808 resp, 1809 azure.WithErrorUnlessStatusCode(http.StatusOK), 1810 autorest.ByClosing()) 1811 result.Response = resp 1812 return 1813} 1814 1815// DeleteService a service must be created before it can be deleted. By default, Service Fabric will try to close 1816// service replicas in a graceful manner and then delete the service. However, if the service is having issues closing 1817// the replica gracefully, the delete operation may take a long time or get stuck. Use the optional ForceRemove flag to 1818// skip the graceful close sequence and forcefully delete the service. 1819// Parameters: 1820// serviceID - the identity of the service. This ID is typically the full name of the service without the 1821// 'fabric:' URI scheme. 1822// Starting from version 6.0, hierarchical names are delimited with the "~" character. 1823// For example, if the service name is "fabric:/myapp/app1/svc1", the service identity would be 1824// "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in previous versions. 1825// forceRemove - remove a Service Fabric application or service forcefully without going through the graceful 1826// shutdown sequence. This parameter can be used to forcefully delete an application or service for which 1827// delete is timing out due to issues in the service code that prevents graceful close of replicas. 1828// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 1829// duration that the client is willing to wait for the requested operation to complete. The default value for 1830// this parameter is 60 seconds. 1831func (client BaseClient) DeleteService(ctx context.Context, serviceID string, forceRemove *bool, timeout *int64) (result autorest.Response, err error) { 1832 if tracing.IsEnabled() { 1833 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.DeleteService") 1834 defer func() { 1835 sc := -1 1836 if result.Response != nil { 1837 sc = result.Response.StatusCode 1838 } 1839 tracing.EndSpan(ctx, sc, err) 1840 }() 1841 } 1842 if err := validation.Validate([]validation.Validation{ 1843 {TargetValue: timeout, 1844 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 1845 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 1846 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 1847 }}}}}); err != nil { 1848 return result, validation.NewError("servicefabric.BaseClient", "DeleteService", err.Error()) 1849 } 1850 1851 req, err := client.DeleteServicePreparer(ctx, serviceID, forceRemove, timeout) 1852 if err != nil { 1853 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeleteService", nil, "Failure preparing request") 1854 return 1855 } 1856 1857 resp, err := client.DeleteServiceSender(req) 1858 if err != nil { 1859 result.Response = resp 1860 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeleteService", resp, "Failure sending request") 1861 return 1862 } 1863 1864 result, err = client.DeleteServiceResponder(resp) 1865 if err != nil { 1866 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeleteService", resp, "Failure responding to request") 1867 return 1868 } 1869 1870 return 1871} 1872 1873// DeleteServicePreparer prepares the DeleteService request. 1874func (client BaseClient) DeleteServicePreparer(ctx context.Context, serviceID string, forceRemove *bool, timeout *int64) (*http.Request, error) { 1875 pathParameters := map[string]interface{}{ 1876 "serviceId": serviceID, 1877 } 1878 1879 const APIVersion = "6.0" 1880 queryParameters := map[string]interface{}{ 1881 "api-version": APIVersion, 1882 } 1883 if forceRemove != nil { 1884 queryParameters["ForceRemove"] = autorest.Encode("query", *forceRemove) 1885 } 1886 if timeout != nil { 1887 queryParameters["timeout"] = autorest.Encode("query", *timeout) 1888 } else { 1889 queryParameters["timeout"] = autorest.Encode("query", 60) 1890 } 1891 1892 preparer := autorest.CreatePreparer( 1893 autorest.AsPost(), 1894 autorest.WithBaseURL(client.BaseURI), 1895 autorest.WithPathParameters("/Services/{serviceId}/$/Delete", pathParameters), 1896 autorest.WithQueryParameters(queryParameters)) 1897 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 1898} 1899 1900// DeleteServiceSender sends the DeleteService request. The method will close the 1901// http.Response Body if it receives an error. 1902func (client BaseClient) DeleteServiceSender(req *http.Request) (*http.Response, error) { 1903 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 1904} 1905 1906// DeleteServiceResponder handles the response to the DeleteService request. The method always 1907// closes the http.Response Body. 1908func (client BaseClient) DeleteServiceResponder(resp *http.Response) (result autorest.Response, err error) { 1909 err = autorest.Respond( 1910 resp, 1911 azure.WithErrorUnlessStatusCode(http.StatusOK), 1912 autorest.ByClosing()) 1913 result.Response = resp 1914 return 1915} 1916 1917// DeployServicePackageToNode this API provides a way to download code packages including the container images on a 1918// specific node outside of the normal application deployment and upgrade path. This is useful for the large code 1919// packages and container images to be present on the node before the actual application deployment and upgrade, thus 1920// significantly reducing the total time required for the deployment or upgrade. 1921// Parameters: 1922// nodeName - the name of the node. 1923// deployServicePackageToNodeDescription - describes information for deploying a service package to a Service 1924// Fabric node. 1925// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 1926// duration that the client is willing to wait for the requested operation to complete. The default value for 1927// this parameter is 60 seconds. 1928func (client BaseClient) DeployServicePackageToNode(ctx context.Context, nodeName string, deployServicePackageToNodeDescription DeployServicePackageToNodeDescription, timeout *int64) (result autorest.Response, err error) { 1929 if tracing.IsEnabled() { 1930 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.DeployServicePackageToNode") 1931 defer func() { 1932 sc := -1 1933 if result.Response != nil { 1934 sc = result.Response.StatusCode 1935 } 1936 tracing.EndSpan(ctx, sc, err) 1937 }() 1938 } 1939 if err := validation.Validate([]validation.Validation{ 1940 {TargetValue: deployServicePackageToNodeDescription, 1941 Constraints: []validation.Constraint{{Target: "deployServicePackageToNodeDescription.ServiceManifestName", Name: validation.Null, Rule: true, Chain: nil}, 1942 {Target: "deployServicePackageToNodeDescription.ApplicationTypeName", Name: validation.Null, Rule: true, Chain: nil}, 1943 {Target: "deployServicePackageToNodeDescription.ApplicationTypeVersion", Name: validation.Null, Rule: true, Chain: nil}, 1944 {Target: "deployServicePackageToNodeDescription.NodeName", Name: validation.Null, Rule: true, Chain: nil}}}, 1945 {TargetValue: timeout, 1946 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 1947 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 1948 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 1949 }}}}}); err != nil { 1950 return result, validation.NewError("servicefabric.BaseClient", "DeployServicePackageToNode", err.Error()) 1951 } 1952 1953 req, err := client.DeployServicePackageToNodePreparer(ctx, nodeName, deployServicePackageToNodeDescription, timeout) 1954 if err != nil { 1955 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeployServicePackageToNode", nil, "Failure preparing request") 1956 return 1957 } 1958 1959 resp, err := client.DeployServicePackageToNodeSender(req) 1960 if err != nil { 1961 result.Response = resp 1962 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeployServicePackageToNode", resp, "Failure sending request") 1963 return 1964 } 1965 1966 result, err = client.DeployServicePackageToNodeResponder(resp) 1967 if err != nil { 1968 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DeployServicePackageToNode", resp, "Failure responding to request") 1969 return 1970 } 1971 1972 return 1973} 1974 1975// DeployServicePackageToNodePreparer prepares the DeployServicePackageToNode request. 1976func (client BaseClient) DeployServicePackageToNodePreparer(ctx context.Context, nodeName string, deployServicePackageToNodeDescription DeployServicePackageToNodeDescription, timeout *int64) (*http.Request, error) { 1977 pathParameters := map[string]interface{}{ 1978 "nodeName": autorest.Encode("path", nodeName), 1979 } 1980 1981 const APIVersion = "6.0" 1982 queryParameters := map[string]interface{}{ 1983 "api-version": APIVersion, 1984 } 1985 if timeout != nil { 1986 queryParameters["timeout"] = autorest.Encode("query", *timeout) 1987 } else { 1988 queryParameters["timeout"] = autorest.Encode("query", 60) 1989 } 1990 1991 preparer := autorest.CreatePreparer( 1992 autorest.AsContentType("application/json; charset=utf-8"), 1993 autorest.AsPost(), 1994 autorest.WithBaseURL(client.BaseURI), 1995 autorest.WithPathParameters("/Nodes/{nodeName}/$/DeployServicePackage", pathParameters), 1996 autorest.WithJSON(deployServicePackageToNodeDescription), 1997 autorest.WithQueryParameters(queryParameters)) 1998 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 1999} 2000 2001// DeployServicePackageToNodeSender sends the DeployServicePackageToNode request. The method will close the 2002// http.Response Body if it receives an error. 2003func (client BaseClient) DeployServicePackageToNodeSender(req *http.Request) (*http.Response, error) { 2004 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 2005} 2006 2007// DeployServicePackageToNodeResponder handles the response to the DeployServicePackageToNode request. The method always 2008// closes the http.Response Body. 2009func (client BaseClient) DeployServicePackageToNodeResponder(resp *http.Response) (result autorest.Response, err error) { 2010 err = autorest.Respond( 2011 resp, 2012 azure.WithErrorUnlessStatusCode(http.StatusOK), 2013 autorest.ByClosing()) 2014 result.Response = resp 2015 return 2016} 2017 2018// DisableApplicationBackup disables periodic backup of Service Fabric application which was previously enabled. 2019// Parameters: 2020// applicationID - the identity of the application. This is typically the full name of the application without 2021// the 'fabric:' URI scheme. 2022// Starting from version 6.0, hierarchical names are delimited with the "~" character. 2023// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" 2024// in 6.0+ and "myapp/app1" in previous versions. 2025// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 2026// duration that the client is willing to wait for the requested operation to complete. The default value for 2027// this parameter is 60 seconds. 2028// disableBackupDescription - specifies the parameters to disable backup for any backup entity. 2029func (client BaseClient) DisableApplicationBackup(ctx context.Context, applicationID string, timeout *int64, disableBackupDescription *DisableBackupDescription) (result autorest.Response, err error) { 2030 if tracing.IsEnabled() { 2031 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.DisableApplicationBackup") 2032 defer func() { 2033 sc := -1 2034 if result.Response != nil { 2035 sc = result.Response.StatusCode 2036 } 2037 tracing.EndSpan(ctx, sc, err) 2038 }() 2039 } 2040 if err := validation.Validate([]validation.Validation{ 2041 {TargetValue: timeout, 2042 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 2043 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 2044 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 2045 }}}}, 2046 {TargetValue: disableBackupDescription, 2047 Constraints: []validation.Constraint{{Target: "disableBackupDescription", Name: validation.Null, Rule: false, 2048 Chain: []validation.Constraint{{Target: "disableBackupDescription.CleanBackup", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { 2049 return result, validation.NewError("servicefabric.BaseClient", "DisableApplicationBackup", err.Error()) 2050 } 2051 2052 req, err := client.DisableApplicationBackupPreparer(ctx, applicationID, timeout, disableBackupDescription) 2053 if err != nil { 2054 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DisableApplicationBackup", nil, "Failure preparing request") 2055 return 2056 } 2057 2058 resp, err := client.DisableApplicationBackupSender(req) 2059 if err != nil { 2060 result.Response = resp 2061 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DisableApplicationBackup", resp, "Failure sending request") 2062 return 2063 } 2064 2065 result, err = client.DisableApplicationBackupResponder(resp) 2066 if err != nil { 2067 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DisableApplicationBackup", resp, "Failure responding to request") 2068 return 2069 } 2070 2071 return 2072} 2073 2074// DisableApplicationBackupPreparer prepares the DisableApplicationBackup request. 2075func (client BaseClient) DisableApplicationBackupPreparer(ctx context.Context, applicationID string, timeout *int64, disableBackupDescription *DisableBackupDescription) (*http.Request, error) { 2076 pathParameters := map[string]interface{}{ 2077 "applicationId": applicationID, 2078 } 2079 2080 const APIVersion = "6.4" 2081 queryParameters := map[string]interface{}{ 2082 "api-version": APIVersion, 2083 } 2084 if timeout != nil { 2085 queryParameters["timeout"] = autorest.Encode("query", *timeout) 2086 } else { 2087 queryParameters["timeout"] = autorest.Encode("query", 60) 2088 } 2089 2090 preparer := autorest.CreatePreparer( 2091 autorest.AsContentType("application/json; charset=utf-8"), 2092 autorest.AsPost(), 2093 autorest.WithBaseURL(client.BaseURI), 2094 autorest.WithPathParameters("/Applications/{applicationId}/$/DisableBackup", pathParameters), 2095 autorest.WithQueryParameters(queryParameters)) 2096 if disableBackupDescription != nil { 2097 preparer = autorest.DecoratePreparer(preparer, 2098 autorest.WithJSON(disableBackupDescription)) 2099 } 2100 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 2101} 2102 2103// DisableApplicationBackupSender sends the DisableApplicationBackup request. The method will close the 2104// http.Response Body if it receives an error. 2105func (client BaseClient) DisableApplicationBackupSender(req *http.Request) (*http.Response, error) { 2106 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 2107} 2108 2109// DisableApplicationBackupResponder handles the response to the DisableApplicationBackup request. The method always 2110// closes the http.Response Body. 2111func (client BaseClient) DisableApplicationBackupResponder(resp *http.Response) (result autorest.Response, err error) { 2112 err = autorest.Respond( 2113 resp, 2114 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), 2115 autorest.ByClosing()) 2116 result.Response = resp 2117 return 2118} 2119 2120// DisableNode deactivate a Service Fabric cluster node with the specified deactivation intent. Once the deactivation 2121// is in progress, the deactivation intent can be increased, but not decreased (for example, a node that is deactivated 2122// with the Pause intent can be deactivated further with Restart, but not the other way around. Nodes may be 2123// reactivated using the Activate a node operation any time after they are deactivated. If the deactivation is not 2124// complete, this will cancel the deactivation. A node that goes down and comes back up while deactivated will still 2125// need to be reactivated before services will be placed on that node. 2126// Parameters: 2127// nodeName - the name of the node. 2128// deactivationIntentDescription - describes the intent or reason for deactivating the node. 2129// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 2130// duration that the client is willing to wait for the requested operation to complete. The default value for 2131// this parameter is 60 seconds. 2132func (client BaseClient) DisableNode(ctx context.Context, nodeName string, deactivationIntentDescription DeactivationIntentDescription, timeout *int64) (result autorest.Response, err error) { 2133 if tracing.IsEnabled() { 2134 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.DisableNode") 2135 defer func() { 2136 sc := -1 2137 if result.Response != nil { 2138 sc = result.Response.StatusCode 2139 } 2140 tracing.EndSpan(ctx, sc, err) 2141 }() 2142 } 2143 if err := validation.Validate([]validation.Validation{ 2144 {TargetValue: timeout, 2145 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 2146 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 2147 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 2148 }}}}}); err != nil { 2149 return result, validation.NewError("servicefabric.BaseClient", "DisableNode", err.Error()) 2150 } 2151 2152 req, err := client.DisableNodePreparer(ctx, nodeName, deactivationIntentDescription, timeout) 2153 if err != nil { 2154 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DisableNode", nil, "Failure preparing request") 2155 return 2156 } 2157 2158 resp, err := client.DisableNodeSender(req) 2159 if err != nil { 2160 result.Response = resp 2161 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DisableNode", resp, "Failure sending request") 2162 return 2163 } 2164 2165 result, err = client.DisableNodeResponder(resp) 2166 if err != nil { 2167 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DisableNode", resp, "Failure responding to request") 2168 return 2169 } 2170 2171 return 2172} 2173 2174// DisableNodePreparer prepares the DisableNode request. 2175func (client BaseClient) DisableNodePreparer(ctx context.Context, nodeName string, deactivationIntentDescription DeactivationIntentDescription, timeout *int64) (*http.Request, error) { 2176 pathParameters := map[string]interface{}{ 2177 "nodeName": autorest.Encode("path", nodeName), 2178 } 2179 2180 const APIVersion = "6.0" 2181 queryParameters := map[string]interface{}{ 2182 "api-version": APIVersion, 2183 } 2184 if timeout != nil { 2185 queryParameters["timeout"] = autorest.Encode("query", *timeout) 2186 } else { 2187 queryParameters["timeout"] = autorest.Encode("query", 60) 2188 } 2189 2190 preparer := autorest.CreatePreparer( 2191 autorest.AsContentType("application/json; charset=utf-8"), 2192 autorest.AsPost(), 2193 autorest.WithBaseURL(client.BaseURI), 2194 autorest.WithPathParameters("/Nodes/{nodeName}/$/Deactivate", pathParameters), 2195 autorest.WithJSON(deactivationIntentDescription), 2196 autorest.WithQueryParameters(queryParameters)) 2197 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 2198} 2199 2200// DisableNodeSender sends the DisableNode request. The method will close the 2201// http.Response Body if it receives an error. 2202func (client BaseClient) DisableNodeSender(req *http.Request) (*http.Response, error) { 2203 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 2204} 2205 2206// DisableNodeResponder handles the response to the DisableNode request. The method always 2207// closes the http.Response Body. 2208func (client BaseClient) DisableNodeResponder(resp *http.Response) (result autorest.Response, err error) { 2209 err = autorest.Respond( 2210 resp, 2211 azure.WithErrorUnlessStatusCode(http.StatusOK), 2212 autorest.ByClosing()) 2213 result.Response = resp 2214 return 2215} 2216 2217// DisablePartitionBackup disables periodic backup of partition which was previously enabled. Backup must be explicitly 2218// enabled before it can be disabled. 2219// In case the backup is enabled for the Service Fabric application or service, which this partition is part of, this 2220// partition would continue to be periodically backed up as per the policy mapped at the higher level entity. 2221// Parameters: 2222// partitionID - the identity of the partition. 2223// disableBackupDescription - specifies the parameters to disable backup for any backup entity. 2224// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 2225// duration that the client is willing to wait for the requested operation to complete. The default value for 2226// this parameter is 60 seconds. 2227func (client BaseClient) DisablePartitionBackup(ctx context.Context, partitionID uuid.UUID, disableBackupDescription *DisableBackupDescription, timeout *int64) (result autorest.Response, err error) { 2228 if tracing.IsEnabled() { 2229 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.DisablePartitionBackup") 2230 defer func() { 2231 sc := -1 2232 if result.Response != nil { 2233 sc = result.Response.StatusCode 2234 } 2235 tracing.EndSpan(ctx, sc, err) 2236 }() 2237 } 2238 if err := validation.Validate([]validation.Validation{ 2239 {TargetValue: disableBackupDescription, 2240 Constraints: []validation.Constraint{{Target: "disableBackupDescription", Name: validation.Null, Rule: false, 2241 Chain: []validation.Constraint{{Target: "disableBackupDescription.CleanBackup", Name: validation.Null, Rule: true, Chain: nil}}}}}, 2242 {TargetValue: timeout, 2243 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 2244 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 2245 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 2246 }}}}}); err != nil { 2247 return result, validation.NewError("servicefabric.BaseClient", "DisablePartitionBackup", err.Error()) 2248 } 2249 2250 req, err := client.DisablePartitionBackupPreparer(ctx, partitionID, disableBackupDescription, timeout) 2251 if err != nil { 2252 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DisablePartitionBackup", nil, "Failure preparing request") 2253 return 2254 } 2255 2256 resp, err := client.DisablePartitionBackupSender(req) 2257 if err != nil { 2258 result.Response = resp 2259 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DisablePartitionBackup", resp, "Failure sending request") 2260 return 2261 } 2262 2263 result, err = client.DisablePartitionBackupResponder(resp) 2264 if err != nil { 2265 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DisablePartitionBackup", resp, "Failure responding to request") 2266 return 2267 } 2268 2269 return 2270} 2271 2272// DisablePartitionBackupPreparer prepares the DisablePartitionBackup request. 2273func (client BaseClient) DisablePartitionBackupPreparer(ctx context.Context, partitionID uuid.UUID, disableBackupDescription *DisableBackupDescription, timeout *int64) (*http.Request, error) { 2274 pathParameters := map[string]interface{}{ 2275 "partitionId": partitionID, 2276 } 2277 2278 const APIVersion = "6.4" 2279 queryParameters := map[string]interface{}{ 2280 "api-version": APIVersion, 2281 } 2282 if timeout != nil { 2283 queryParameters["timeout"] = autorest.Encode("query", *timeout) 2284 } else { 2285 queryParameters["timeout"] = autorest.Encode("query", 60) 2286 } 2287 2288 preparer := autorest.CreatePreparer( 2289 autorest.AsContentType("application/json; charset=utf-8"), 2290 autorest.AsPost(), 2291 autorest.WithBaseURL(client.BaseURI), 2292 autorest.WithPathParameters("/Partitions/{partitionId}/$/DisableBackup", pathParameters), 2293 autorest.WithQueryParameters(queryParameters)) 2294 if disableBackupDescription != nil { 2295 preparer = autorest.DecoratePreparer(preparer, 2296 autorest.WithJSON(disableBackupDescription)) 2297 } 2298 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 2299} 2300 2301// DisablePartitionBackupSender sends the DisablePartitionBackup request. The method will close the 2302// http.Response Body if it receives an error. 2303func (client BaseClient) DisablePartitionBackupSender(req *http.Request) (*http.Response, error) { 2304 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 2305} 2306 2307// DisablePartitionBackupResponder handles the response to the DisablePartitionBackup request. The method always 2308// closes the http.Response Body. 2309func (client BaseClient) DisablePartitionBackupResponder(resp *http.Response) (result autorest.Response, err error) { 2310 err = autorest.Respond( 2311 resp, 2312 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), 2313 autorest.ByClosing()) 2314 result.Response = resp 2315 return 2316} 2317 2318// DisableServiceBackup disables periodic backup of Service Fabric service which was previously enabled. Backup must be 2319// explicitly enabled before it can be disabled. 2320// In case the backup is enabled for the Service Fabric application, which this service is part of, this service would 2321// continue to be periodically backed up as per the policy mapped at the application level. 2322// Parameters: 2323// serviceID - the identity of the service. This ID is typically the full name of the service without the 2324// 'fabric:' URI scheme. 2325// Starting from version 6.0, hierarchical names are delimited with the "~" character. 2326// For example, if the service name is "fabric:/myapp/app1/svc1", the service identity would be 2327// "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in previous versions. 2328// disableBackupDescription - specifies the parameters to disable backup for any backup entity. 2329// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 2330// duration that the client is willing to wait for the requested operation to complete. The default value for 2331// this parameter is 60 seconds. 2332func (client BaseClient) DisableServiceBackup(ctx context.Context, serviceID string, disableBackupDescription *DisableBackupDescription, timeout *int64) (result autorest.Response, err error) { 2333 if tracing.IsEnabled() { 2334 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.DisableServiceBackup") 2335 defer func() { 2336 sc := -1 2337 if result.Response != nil { 2338 sc = result.Response.StatusCode 2339 } 2340 tracing.EndSpan(ctx, sc, err) 2341 }() 2342 } 2343 if err := validation.Validate([]validation.Validation{ 2344 {TargetValue: disableBackupDescription, 2345 Constraints: []validation.Constraint{{Target: "disableBackupDescription", Name: validation.Null, Rule: false, 2346 Chain: []validation.Constraint{{Target: "disableBackupDescription.CleanBackup", Name: validation.Null, Rule: true, Chain: nil}}}}}, 2347 {TargetValue: timeout, 2348 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 2349 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 2350 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 2351 }}}}}); err != nil { 2352 return result, validation.NewError("servicefabric.BaseClient", "DisableServiceBackup", err.Error()) 2353 } 2354 2355 req, err := client.DisableServiceBackupPreparer(ctx, serviceID, disableBackupDescription, timeout) 2356 if err != nil { 2357 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DisableServiceBackup", nil, "Failure preparing request") 2358 return 2359 } 2360 2361 resp, err := client.DisableServiceBackupSender(req) 2362 if err != nil { 2363 result.Response = resp 2364 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DisableServiceBackup", resp, "Failure sending request") 2365 return 2366 } 2367 2368 result, err = client.DisableServiceBackupResponder(resp) 2369 if err != nil { 2370 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "DisableServiceBackup", resp, "Failure responding to request") 2371 return 2372 } 2373 2374 return 2375} 2376 2377// DisableServiceBackupPreparer prepares the DisableServiceBackup request. 2378func (client BaseClient) DisableServiceBackupPreparer(ctx context.Context, serviceID string, disableBackupDescription *DisableBackupDescription, timeout *int64) (*http.Request, error) { 2379 pathParameters := map[string]interface{}{ 2380 "serviceId": serviceID, 2381 } 2382 2383 const APIVersion = "6.4" 2384 queryParameters := map[string]interface{}{ 2385 "api-version": APIVersion, 2386 } 2387 if timeout != nil { 2388 queryParameters["timeout"] = autorest.Encode("query", *timeout) 2389 } else { 2390 queryParameters["timeout"] = autorest.Encode("query", 60) 2391 } 2392 2393 preparer := autorest.CreatePreparer( 2394 autorest.AsContentType("application/json; charset=utf-8"), 2395 autorest.AsPost(), 2396 autorest.WithBaseURL(client.BaseURI), 2397 autorest.WithPathParameters("/Services/{serviceId}/$/DisableBackup", pathParameters), 2398 autorest.WithQueryParameters(queryParameters)) 2399 if disableBackupDescription != nil { 2400 preparer = autorest.DecoratePreparer(preparer, 2401 autorest.WithJSON(disableBackupDescription)) 2402 } 2403 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 2404} 2405 2406// DisableServiceBackupSender sends the DisableServiceBackup request. The method will close the 2407// http.Response Body if it receives an error. 2408func (client BaseClient) DisableServiceBackupSender(req *http.Request) (*http.Response, error) { 2409 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 2410} 2411 2412// DisableServiceBackupResponder handles the response to the DisableServiceBackup request. The method always 2413// closes the http.Response Body. 2414func (client BaseClient) DisableServiceBackupResponder(resp *http.Response) (result autorest.Response, err error) { 2415 err = autorest.Respond( 2416 resp, 2417 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), 2418 autorest.ByClosing()) 2419 result.Response = resp 2420 return 2421} 2422 2423// EnableApplicationBackup enables periodic backup of stateful partitions which are part of this Service Fabric 2424// application. Each partition is backed up individually as per the specified backup policy description. 2425// Note only C# based Reliable Actor and Reliable Stateful services are currently supported for periodic backup. 2426// Parameters: 2427// applicationID - the identity of the application. This is typically the full name of the application without 2428// the 'fabric:' URI scheme. 2429// Starting from version 6.0, hierarchical names are delimited with the "~" character. 2430// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" 2431// in 6.0+ and "myapp/app1" in previous versions. 2432// enableBackupDescription - specifies the parameters for enabling backup. 2433// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 2434// duration that the client is willing to wait for the requested operation to complete. The default value for 2435// this parameter is 60 seconds. 2436func (client BaseClient) EnableApplicationBackup(ctx context.Context, applicationID string, enableBackupDescription EnableBackupDescription, timeout *int64) (result autorest.Response, err error) { 2437 if tracing.IsEnabled() { 2438 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.EnableApplicationBackup") 2439 defer func() { 2440 sc := -1 2441 if result.Response != nil { 2442 sc = result.Response.StatusCode 2443 } 2444 tracing.EndSpan(ctx, sc, err) 2445 }() 2446 } 2447 if err := validation.Validate([]validation.Validation{ 2448 {TargetValue: enableBackupDescription, 2449 Constraints: []validation.Constraint{{Target: "enableBackupDescription.BackupPolicyName", Name: validation.Null, Rule: true, Chain: nil}}}, 2450 {TargetValue: timeout, 2451 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 2452 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 2453 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 2454 }}}}}); err != nil { 2455 return result, validation.NewError("servicefabric.BaseClient", "EnableApplicationBackup", err.Error()) 2456 } 2457 2458 req, err := client.EnableApplicationBackupPreparer(ctx, applicationID, enableBackupDescription, timeout) 2459 if err != nil { 2460 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "EnableApplicationBackup", nil, "Failure preparing request") 2461 return 2462 } 2463 2464 resp, err := client.EnableApplicationBackupSender(req) 2465 if err != nil { 2466 result.Response = resp 2467 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "EnableApplicationBackup", resp, "Failure sending request") 2468 return 2469 } 2470 2471 result, err = client.EnableApplicationBackupResponder(resp) 2472 if err != nil { 2473 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "EnableApplicationBackup", resp, "Failure responding to request") 2474 return 2475 } 2476 2477 return 2478} 2479 2480// EnableApplicationBackupPreparer prepares the EnableApplicationBackup request. 2481func (client BaseClient) EnableApplicationBackupPreparer(ctx context.Context, applicationID string, enableBackupDescription EnableBackupDescription, timeout *int64) (*http.Request, error) { 2482 pathParameters := map[string]interface{}{ 2483 "applicationId": applicationID, 2484 } 2485 2486 const APIVersion = "6.4" 2487 queryParameters := map[string]interface{}{ 2488 "api-version": APIVersion, 2489 } 2490 if timeout != nil { 2491 queryParameters["timeout"] = autorest.Encode("query", *timeout) 2492 } else { 2493 queryParameters["timeout"] = autorest.Encode("query", 60) 2494 } 2495 2496 preparer := autorest.CreatePreparer( 2497 autorest.AsContentType("application/json; charset=utf-8"), 2498 autorest.AsPost(), 2499 autorest.WithBaseURL(client.BaseURI), 2500 autorest.WithPathParameters("/Applications/{applicationId}/$/EnableBackup", pathParameters), 2501 autorest.WithJSON(enableBackupDescription), 2502 autorest.WithQueryParameters(queryParameters)) 2503 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 2504} 2505 2506// EnableApplicationBackupSender sends the EnableApplicationBackup request. The method will close the 2507// http.Response Body if it receives an error. 2508func (client BaseClient) EnableApplicationBackupSender(req *http.Request) (*http.Response, error) { 2509 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 2510} 2511 2512// EnableApplicationBackupResponder handles the response to the EnableApplicationBackup request. The method always 2513// closes the http.Response Body. 2514func (client BaseClient) EnableApplicationBackupResponder(resp *http.Response) (result autorest.Response, err error) { 2515 err = autorest.Respond( 2516 resp, 2517 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), 2518 autorest.ByClosing()) 2519 result.Response = resp 2520 return 2521} 2522 2523// EnableNode activates a Service Fabric cluster node that is currently deactivated. Once activated, the node will 2524// again become a viable target for placing new replicas, and any deactivated replicas remaining on the node will be 2525// reactivated. 2526// Parameters: 2527// nodeName - the name of the node. 2528// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 2529// duration that the client is willing to wait for the requested operation to complete. The default value for 2530// this parameter is 60 seconds. 2531func (client BaseClient) EnableNode(ctx context.Context, nodeName string, timeout *int64) (result autorest.Response, err error) { 2532 if tracing.IsEnabled() { 2533 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.EnableNode") 2534 defer func() { 2535 sc := -1 2536 if result.Response != nil { 2537 sc = result.Response.StatusCode 2538 } 2539 tracing.EndSpan(ctx, sc, err) 2540 }() 2541 } 2542 if err := validation.Validate([]validation.Validation{ 2543 {TargetValue: timeout, 2544 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 2545 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 2546 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 2547 }}}}}); err != nil { 2548 return result, validation.NewError("servicefabric.BaseClient", "EnableNode", err.Error()) 2549 } 2550 2551 req, err := client.EnableNodePreparer(ctx, nodeName, timeout) 2552 if err != nil { 2553 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "EnableNode", nil, "Failure preparing request") 2554 return 2555 } 2556 2557 resp, err := client.EnableNodeSender(req) 2558 if err != nil { 2559 result.Response = resp 2560 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "EnableNode", resp, "Failure sending request") 2561 return 2562 } 2563 2564 result, err = client.EnableNodeResponder(resp) 2565 if err != nil { 2566 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "EnableNode", resp, "Failure responding to request") 2567 return 2568 } 2569 2570 return 2571} 2572 2573// EnableNodePreparer prepares the EnableNode request. 2574func (client BaseClient) EnableNodePreparer(ctx context.Context, nodeName string, timeout *int64) (*http.Request, error) { 2575 pathParameters := map[string]interface{}{ 2576 "nodeName": autorest.Encode("path", nodeName), 2577 } 2578 2579 const APIVersion = "6.0" 2580 queryParameters := map[string]interface{}{ 2581 "api-version": APIVersion, 2582 } 2583 if timeout != nil { 2584 queryParameters["timeout"] = autorest.Encode("query", *timeout) 2585 } else { 2586 queryParameters["timeout"] = autorest.Encode("query", 60) 2587 } 2588 2589 preparer := autorest.CreatePreparer( 2590 autorest.AsPost(), 2591 autorest.WithBaseURL(client.BaseURI), 2592 autorest.WithPathParameters("/Nodes/{nodeName}/$/Activate", pathParameters), 2593 autorest.WithQueryParameters(queryParameters)) 2594 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 2595} 2596 2597// EnableNodeSender sends the EnableNode request. The method will close the 2598// http.Response Body if it receives an error. 2599func (client BaseClient) EnableNodeSender(req *http.Request) (*http.Response, error) { 2600 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 2601} 2602 2603// EnableNodeResponder handles the response to the EnableNode request. The method always 2604// closes the http.Response Body. 2605func (client BaseClient) EnableNodeResponder(resp *http.Response) (result autorest.Response, err error) { 2606 err = autorest.Respond( 2607 resp, 2608 azure.WithErrorUnlessStatusCode(http.StatusOK), 2609 autorest.ByClosing()) 2610 result.Response = resp 2611 return 2612} 2613 2614// EnablePartitionBackup enables periodic backup of stateful persisted partition. Each partition is backed up as per 2615// the specified backup policy description. In case the application or service, which is partition is part of, is 2616// already enabled for backup then this operation would override the policy being used to take the periodic backup of 2617// this partition. 2618// Note only C# based Reliable Actor and Reliable Stateful services are currently supported for periodic backup. 2619// Parameters: 2620// partitionID - the identity of the partition. 2621// enableBackupDescription - specifies the parameters for enabling backup. 2622// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 2623// duration that the client is willing to wait for the requested operation to complete. The default value for 2624// this parameter is 60 seconds. 2625func (client BaseClient) EnablePartitionBackup(ctx context.Context, partitionID uuid.UUID, enableBackupDescription EnableBackupDescription, timeout *int64) (result autorest.Response, err error) { 2626 if tracing.IsEnabled() { 2627 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.EnablePartitionBackup") 2628 defer func() { 2629 sc := -1 2630 if result.Response != nil { 2631 sc = result.Response.StatusCode 2632 } 2633 tracing.EndSpan(ctx, sc, err) 2634 }() 2635 } 2636 if err := validation.Validate([]validation.Validation{ 2637 {TargetValue: enableBackupDescription, 2638 Constraints: []validation.Constraint{{Target: "enableBackupDescription.BackupPolicyName", Name: validation.Null, Rule: true, Chain: nil}}}, 2639 {TargetValue: timeout, 2640 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 2641 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 2642 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 2643 }}}}}); err != nil { 2644 return result, validation.NewError("servicefabric.BaseClient", "EnablePartitionBackup", err.Error()) 2645 } 2646 2647 req, err := client.EnablePartitionBackupPreparer(ctx, partitionID, enableBackupDescription, timeout) 2648 if err != nil { 2649 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "EnablePartitionBackup", nil, "Failure preparing request") 2650 return 2651 } 2652 2653 resp, err := client.EnablePartitionBackupSender(req) 2654 if err != nil { 2655 result.Response = resp 2656 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "EnablePartitionBackup", resp, "Failure sending request") 2657 return 2658 } 2659 2660 result, err = client.EnablePartitionBackupResponder(resp) 2661 if err != nil { 2662 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "EnablePartitionBackup", resp, "Failure responding to request") 2663 return 2664 } 2665 2666 return 2667} 2668 2669// EnablePartitionBackupPreparer prepares the EnablePartitionBackup request. 2670func (client BaseClient) EnablePartitionBackupPreparer(ctx context.Context, partitionID uuid.UUID, enableBackupDescription EnableBackupDescription, timeout *int64) (*http.Request, error) { 2671 pathParameters := map[string]interface{}{ 2672 "partitionId": partitionID, 2673 } 2674 2675 const APIVersion = "6.4" 2676 queryParameters := map[string]interface{}{ 2677 "api-version": APIVersion, 2678 } 2679 if timeout != nil { 2680 queryParameters["timeout"] = autorest.Encode("query", *timeout) 2681 } else { 2682 queryParameters["timeout"] = autorest.Encode("query", 60) 2683 } 2684 2685 preparer := autorest.CreatePreparer( 2686 autorest.AsContentType("application/json; charset=utf-8"), 2687 autorest.AsPost(), 2688 autorest.WithBaseURL(client.BaseURI), 2689 autorest.WithPathParameters("/Partitions/{partitionId}/$/EnableBackup", pathParameters), 2690 autorest.WithJSON(enableBackupDescription), 2691 autorest.WithQueryParameters(queryParameters)) 2692 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 2693} 2694 2695// EnablePartitionBackupSender sends the EnablePartitionBackup request. The method will close the 2696// http.Response Body if it receives an error. 2697func (client BaseClient) EnablePartitionBackupSender(req *http.Request) (*http.Response, error) { 2698 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 2699} 2700 2701// EnablePartitionBackupResponder handles the response to the EnablePartitionBackup request. The method always 2702// closes the http.Response Body. 2703func (client BaseClient) EnablePartitionBackupResponder(resp *http.Response) (result autorest.Response, err error) { 2704 err = autorest.Respond( 2705 resp, 2706 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), 2707 autorest.ByClosing()) 2708 result.Response = resp 2709 return 2710} 2711 2712// EnableServiceBackup enables periodic backup of stateful partitions which are part of this Service Fabric service. 2713// Each partition is backed up individually as per the specified backup policy description. In case the application, 2714// which the service is part of, is already enabled for backup then this operation would override the policy being used 2715// to take the periodic backup for this service and its partitions (unless explicitly overridden at the partition 2716// level). 2717// Note only C# based Reliable Actor and Reliable Stateful services are currently supported for periodic backup. 2718// Parameters: 2719// serviceID - the identity of the service. This ID is typically the full name of the service without the 2720// 'fabric:' URI scheme. 2721// Starting from version 6.0, hierarchical names are delimited with the "~" character. 2722// For example, if the service name is "fabric:/myapp/app1/svc1", the service identity would be 2723// "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in previous versions. 2724// enableBackupDescription - specifies the parameters for enabling backup. 2725// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 2726// duration that the client is willing to wait for the requested operation to complete. The default value for 2727// this parameter is 60 seconds. 2728func (client BaseClient) EnableServiceBackup(ctx context.Context, serviceID string, enableBackupDescription EnableBackupDescription, timeout *int64) (result autorest.Response, err error) { 2729 if tracing.IsEnabled() { 2730 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.EnableServiceBackup") 2731 defer func() { 2732 sc := -1 2733 if result.Response != nil { 2734 sc = result.Response.StatusCode 2735 } 2736 tracing.EndSpan(ctx, sc, err) 2737 }() 2738 } 2739 if err := validation.Validate([]validation.Validation{ 2740 {TargetValue: enableBackupDescription, 2741 Constraints: []validation.Constraint{{Target: "enableBackupDescription.BackupPolicyName", Name: validation.Null, Rule: true, Chain: nil}}}, 2742 {TargetValue: timeout, 2743 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 2744 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 2745 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 2746 }}}}}); err != nil { 2747 return result, validation.NewError("servicefabric.BaseClient", "EnableServiceBackup", err.Error()) 2748 } 2749 2750 req, err := client.EnableServiceBackupPreparer(ctx, serviceID, enableBackupDescription, timeout) 2751 if err != nil { 2752 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "EnableServiceBackup", nil, "Failure preparing request") 2753 return 2754 } 2755 2756 resp, err := client.EnableServiceBackupSender(req) 2757 if err != nil { 2758 result.Response = resp 2759 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "EnableServiceBackup", resp, "Failure sending request") 2760 return 2761 } 2762 2763 result, err = client.EnableServiceBackupResponder(resp) 2764 if err != nil { 2765 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "EnableServiceBackup", resp, "Failure responding to request") 2766 return 2767 } 2768 2769 return 2770} 2771 2772// EnableServiceBackupPreparer prepares the EnableServiceBackup request. 2773func (client BaseClient) EnableServiceBackupPreparer(ctx context.Context, serviceID string, enableBackupDescription EnableBackupDescription, timeout *int64) (*http.Request, error) { 2774 pathParameters := map[string]interface{}{ 2775 "serviceId": serviceID, 2776 } 2777 2778 const APIVersion = "6.4" 2779 queryParameters := map[string]interface{}{ 2780 "api-version": APIVersion, 2781 } 2782 if timeout != nil { 2783 queryParameters["timeout"] = autorest.Encode("query", *timeout) 2784 } else { 2785 queryParameters["timeout"] = autorest.Encode("query", 60) 2786 } 2787 2788 preparer := autorest.CreatePreparer( 2789 autorest.AsContentType("application/json; charset=utf-8"), 2790 autorest.AsPost(), 2791 autorest.WithBaseURL(client.BaseURI), 2792 autorest.WithPathParameters("/Services/{serviceId}/$/EnableBackup", pathParameters), 2793 autorest.WithJSON(enableBackupDescription), 2794 autorest.WithQueryParameters(queryParameters)) 2795 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 2796} 2797 2798// EnableServiceBackupSender sends the EnableServiceBackup request. The method will close the 2799// http.Response Body if it receives an error. 2800func (client BaseClient) EnableServiceBackupSender(req *http.Request) (*http.Response, error) { 2801 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 2802} 2803 2804// EnableServiceBackupResponder handles the response to the EnableServiceBackup request. The method always 2805// closes the http.Response Body. 2806func (client BaseClient) EnableServiceBackupResponder(resp *http.Response) (result autorest.Response, err error) { 2807 err = autorest.Respond( 2808 resp, 2809 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), 2810 autorest.ByClosing()) 2811 result.Response = resp 2812 return 2813} 2814 2815// ForceApproveRepairTask this API supports the Service Fabric platform; it is not meant to be used directly from your 2816// code. 2817// Parameters: 2818// repairTaskApproveDescription - describes the repair task to be approved. 2819func (client BaseClient) ForceApproveRepairTask(ctx context.Context, repairTaskApproveDescription RepairTaskApproveDescription) (result RepairTaskUpdateInfo, err error) { 2820 if tracing.IsEnabled() { 2821 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ForceApproveRepairTask") 2822 defer func() { 2823 sc := -1 2824 if result.Response.Response != nil { 2825 sc = result.Response.Response.StatusCode 2826 } 2827 tracing.EndSpan(ctx, sc, err) 2828 }() 2829 } 2830 if err := validation.Validate([]validation.Validation{ 2831 {TargetValue: repairTaskApproveDescription, 2832 Constraints: []validation.Constraint{{Target: "repairTaskApproveDescription.TaskID", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { 2833 return result, validation.NewError("servicefabric.BaseClient", "ForceApproveRepairTask", err.Error()) 2834 } 2835 2836 req, err := client.ForceApproveRepairTaskPreparer(ctx, repairTaskApproveDescription) 2837 if err != nil { 2838 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ForceApproveRepairTask", nil, "Failure preparing request") 2839 return 2840 } 2841 2842 resp, err := client.ForceApproveRepairTaskSender(req) 2843 if err != nil { 2844 result.Response = autorest.Response{Response: resp} 2845 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ForceApproveRepairTask", resp, "Failure sending request") 2846 return 2847 } 2848 2849 result, err = client.ForceApproveRepairTaskResponder(resp) 2850 if err != nil { 2851 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ForceApproveRepairTask", resp, "Failure responding to request") 2852 return 2853 } 2854 2855 return 2856} 2857 2858// ForceApproveRepairTaskPreparer prepares the ForceApproveRepairTask request. 2859func (client BaseClient) ForceApproveRepairTaskPreparer(ctx context.Context, repairTaskApproveDescription RepairTaskApproveDescription) (*http.Request, error) { 2860 const APIVersion = "6.0" 2861 queryParameters := map[string]interface{}{ 2862 "api-version": APIVersion, 2863 } 2864 2865 preparer := autorest.CreatePreparer( 2866 autorest.AsContentType("application/json; charset=utf-8"), 2867 autorest.AsPost(), 2868 autorest.WithBaseURL(client.BaseURI), 2869 autorest.WithPath("/$/ForceApproveRepairTask"), 2870 autorest.WithJSON(repairTaskApproveDescription), 2871 autorest.WithQueryParameters(queryParameters)) 2872 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 2873} 2874 2875// ForceApproveRepairTaskSender sends the ForceApproveRepairTask request. The method will close the 2876// http.Response Body if it receives an error. 2877func (client BaseClient) ForceApproveRepairTaskSender(req *http.Request) (*http.Response, error) { 2878 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 2879} 2880 2881// ForceApproveRepairTaskResponder handles the response to the ForceApproveRepairTask request. The method always 2882// closes the http.Response Body. 2883func (client BaseClient) ForceApproveRepairTaskResponder(resp *http.Response) (result RepairTaskUpdateInfo, err error) { 2884 err = autorest.Respond( 2885 resp, 2886 azure.WithErrorUnlessStatusCode(http.StatusOK), 2887 autorest.ByUnmarshallingJSON(&result), 2888 autorest.ByClosing()) 2889 result.Response = autorest.Response{Response: resp} 2890 return 2891} 2892 2893// GetAadMetadata gets the Azure Active Directory metadata used for secured connection to cluster. 2894// This API is not supposed to be called separately. It provides information needed to set up an Azure Active Directory 2895// secured connection with a Service Fabric cluster. 2896// Parameters: 2897// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 2898// duration that the client is willing to wait for the requested operation to complete. The default value for 2899// this parameter is 60 seconds. 2900func (client BaseClient) GetAadMetadata(ctx context.Context, timeout *int64) (result AadMetadataObject, err error) { 2901 if tracing.IsEnabled() { 2902 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetAadMetadata") 2903 defer func() { 2904 sc := -1 2905 if result.Response.Response != nil { 2906 sc = result.Response.Response.StatusCode 2907 } 2908 tracing.EndSpan(ctx, sc, err) 2909 }() 2910 } 2911 if err := validation.Validate([]validation.Validation{ 2912 {TargetValue: timeout, 2913 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 2914 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 2915 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 2916 }}}}}); err != nil { 2917 return result, validation.NewError("servicefabric.BaseClient", "GetAadMetadata", err.Error()) 2918 } 2919 2920 req, err := client.GetAadMetadataPreparer(ctx, timeout) 2921 if err != nil { 2922 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetAadMetadata", nil, "Failure preparing request") 2923 return 2924 } 2925 2926 resp, err := client.GetAadMetadataSender(req) 2927 if err != nil { 2928 result.Response = autorest.Response{Response: resp} 2929 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetAadMetadata", resp, "Failure sending request") 2930 return 2931 } 2932 2933 result, err = client.GetAadMetadataResponder(resp) 2934 if err != nil { 2935 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetAadMetadata", resp, "Failure responding to request") 2936 return 2937 } 2938 2939 return 2940} 2941 2942// GetAadMetadataPreparer prepares the GetAadMetadata request. 2943func (client BaseClient) GetAadMetadataPreparer(ctx context.Context, timeout *int64) (*http.Request, error) { 2944 const APIVersion = "6.0" 2945 queryParameters := map[string]interface{}{ 2946 "api-version": APIVersion, 2947 } 2948 if timeout != nil { 2949 queryParameters["timeout"] = autorest.Encode("query", *timeout) 2950 } else { 2951 queryParameters["timeout"] = autorest.Encode("query", 60) 2952 } 2953 2954 preparer := autorest.CreatePreparer( 2955 autorest.AsGet(), 2956 autorest.WithBaseURL(client.BaseURI), 2957 autorest.WithPath("/$/GetAadMetadata"), 2958 autorest.WithQueryParameters(queryParameters)) 2959 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 2960} 2961 2962// GetAadMetadataSender sends the GetAadMetadata request. The method will close the 2963// http.Response Body if it receives an error. 2964func (client BaseClient) GetAadMetadataSender(req *http.Request) (*http.Response, error) { 2965 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 2966} 2967 2968// GetAadMetadataResponder handles the response to the GetAadMetadata request. The method always 2969// closes the http.Response Body. 2970func (client BaseClient) GetAadMetadataResponder(resp *http.Response) (result AadMetadataObject, err error) { 2971 err = autorest.Respond( 2972 resp, 2973 azure.WithErrorUnlessStatusCode(http.StatusOK), 2974 autorest.ByUnmarshallingJSON(&result), 2975 autorest.ByClosing()) 2976 result.Response = autorest.Response{Response: resp} 2977 return 2978} 2979 2980// GetAllEntitiesBackedUpByPolicy returns a list of Service Fabric application, service or partition which are 2981// associated with this backup policy. 2982// Parameters: 2983// backupPolicyName - the name of the backup policy. 2984// continuationToken - the continuation token parameter is used to obtain next set of results. A continuation 2985// token with a non-empty value is included in the response of the API when the results from the system do not 2986// fit in a single response. When this value is passed to the next API call, the API returns next set of 2987// results. If there are no further results, then the continuation token does not contain a value. The value of 2988// this parameter should not be URL encoded. 2989// maxResults - the maximum number of results to be returned as part of the paged queries. This parameter 2990// defines the upper bound on the number of results returned. The results returned can be less than the 2991// specified maximum results if they do not fit in the message as per the max message size restrictions defined 2992// in the configuration. If this parameter is zero or not specified, the paged query includes as many results 2993// as possible that fit in the return message. 2994// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 2995// duration that the client is willing to wait for the requested operation to complete. The default value for 2996// this parameter is 60 seconds. 2997func (client BaseClient) GetAllEntitiesBackedUpByPolicy(ctx context.Context, backupPolicyName string, continuationToken string, maxResults *int64, timeout *int64) (result PagedBackupEntityList, err error) { 2998 if tracing.IsEnabled() { 2999 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetAllEntitiesBackedUpByPolicy") 3000 defer func() { 3001 sc := -1 3002 if result.Response.Response != nil { 3003 sc = result.Response.Response.StatusCode 3004 } 3005 tracing.EndSpan(ctx, sc, err) 3006 }() 3007 } 3008 if err := validation.Validate([]validation.Validation{ 3009 {TargetValue: maxResults, 3010 Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false, 3011 Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}}}}}, 3012 {TargetValue: timeout, 3013 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 3014 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 3015 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 3016 }}}}}); err != nil { 3017 return result, validation.NewError("servicefabric.BaseClient", "GetAllEntitiesBackedUpByPolicy", err.Error()) 3018 } 3019 3020 req, err := client.GetAllEntitiesBackedUpByPolicyPreparer(ctx, backupPolicyName, continuationToken, maxResults, timeout) 3021 if err != nil { 3022 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetAllEntitiesBackedUpByPolicy", nil, "Failure preparing request") 3023 return 3024 } 3025 3026 resp, err := client.GetAllEntitiesBackedUpByPolicySender(req) 3027 if err != nil { 3028 result.Response = autorest.Response{Response: resp} 3029 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetAllEntitiesBackedUpByPolicy", resp, "Failure sending request") 3030 return 3031 } 3032 3033 result, err = client.GetAllEntitiesBackedUpByPolicyResponder(resp) 3034 if err != nil { 3035 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetAllEntitiesBackedUpByPolicy", resp, "Failure responding to request") 3036 return 3037 } 3038 3039 return 3040} 3041 3042// GetAllEntitiesBackedUpByPolicyPreparer prepares the GetAllEntitiesBackedUpByPolicy request. 3043func (client BaseClient) GetAllEntitiesBackedUpByPolicyPreparer(ctx context.Context, backupPolicyName string, continuationToken string, maxResults *int64, timeout *int64) (*http.Request, error) { 3044 pathParameters := map[string]interface{}{ 3045 "backupPolicyName": autorest.Encode("path", backupPolicyName), 3046 } 3047 3048 const APIVersion = "6.4" 3049 queryParameters := map[string]interface{}{ 3050 "api-version": APIVersion, 3051 } 3052 if len(continuationToken) > 0 { 3053 queryParameters["ContinuationToken"] = continuationToken 3054 } 3055 if maxResults != nil { 3056 queryParameters["MaxResults"] = autorest.Encode("query", *maxResults) 3057 } else { 3058 queryParameters["MaxResults"] = autorest.Encode("query", 0) 3059 } 3060 if timeout != nil { 3061 queryParameters["timeout"] = autorest.Encode("query", *timeout) 3062 } else { 3063 queryParameters["timeout"] = autorest.Encode("query", 60) 3064 } 3065 3066 preparer := autorest.CreatePreparer( 3067 autorest.AsGet(), 3068 autorest.WithBaseURL(client.BaseURI), 3069 autorest.WithPathParameters("/BackupRestore/BackupPolicies/{backupPolicyName}/$/GetBackupEnabledEntities", pathParameters), 3070 autorest.WithQueryParameters(queryParameters)) 3071 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 3072} 3073 3074// GetAllEntitiesBackedUpByPolicySender sends the GetAllEntitiesBackedUpByPolicy request. The method will close the 3075// http.Response Body if it receives an error. 3076func (client BaseClient) GetAllEntitiesBackedUpByPolicySender(req *http.Request) (*http.Response, error) { 3077 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 3078} 3079 3080// GetAllEntitiesBackedUpByPolicyResponder handles the response to the GetAllEntitiesBackedUpByPolicy request. The method always 3081// closes the http.Response Body. 3082func (client BaseClient) GetAllEntitiesBackedUpByPolicyResponder(resp *http.Response) (result PagedBackupEntityList, err error) { 3083 err = autorest.Respond( 3084 resp, 3085 azure.WithErrorUnlessStatusCode(http.StatusOK), 3086 autorest.ByUnmarshallingJSON(&result), 3087 autorest.ByClosing()) 3088 result.Response = autorest.Response{Response: resp} 3089 return 3090} 3091 3092// GetApplicationBackupConfigurationInfo gets the Service Fabric backup configuration information for the application 3093// and the services and partitions under this application. 3094// Parameters: 3095// applicationID - the identity of the application. This is typically the full name of the application without 3096// the 'fabric:' URI scheme. 3097// Starting from version 6.0, hierarchical names are delimited with the "~" character. 3098// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" 3099// in 6.0+ and "myapp/app1" in previous versions. 3100// continuationToken - the continuation token parameter is used to obtain next set of results. A continuation 3101// token with a non-empty value is included in the response of the API when the results from the system do not 3102// fit in a single response. When this value is passed to the next API call, the API returns next set of 3103// results. If there are no further results, then the continuation token does not contain a value. The value of 3104// this parameter should not be URL encoded. 3105// maxResults - the maximum number of results to be returned as part of the paged queries. This parameter 3106// defines the upper bound on the number of results returned. The results returned can be less than the 3107// specified maximum results if they do not fit in the message as per the max message size restrictions defined 3108// in the configuration. If this parameter is zero or not specified, the paged query includes as many results 3109// as possible that fit in the return message. 3110// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 3111// duration that the client is willing to wait for the requested operation to complete. The default value for 3112// this parameter is 60 seconds. 3113func (client BaseClient) GetApplicationBackupConfigurationInfo(ctx context.Context, applicationID string, continuationToken string, maxResults *int64, timeout *int64) (result PagedBackupConfigurationInfoList, err error) { 3114 if tracing.IsEnabled() { 3115 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetApplicationBackupConfigurationInfo") 3116 defer func() { 3117 sc := -1 3118 if result.Response.Response != nil { 3119 sc = result.Response.Response.StatusCode 3120 } 3121 tracing.EndSpan(ctx, sc, err) 3122 }() 3123 } 3124 if err := validation.Validate([]validation.Validation{ 3125 {TargetValue: maxResults, 3126 Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false, 3127 Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}}}}}, 3128 {TargetValue: timeout, 3129 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 3130 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 3131 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 3132 }}}}}); err != nil { 3133 return result, validation.NewError("servicefabric.BaseClient", "GetApplicationBackupConfigurationInfo", err.Error()) 3134 } 3135 3136 req, err := client.GetApplicationBackupConfigurationInfoPreparer(ctx, applicationID, continuationToken, maxResults, timeout) 3137 if err != nil { 3138 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationBackupConfigurationInfo", nil, "Failure preparing request") 3139 return 3140 } 3141 3142 resp, err := client.GetApplicationBackupConfigurationInfoSender(req) 3143 if err != nil { 3144 result.Response = autorest.Response{Response: resp} 3145 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationBackupConfigurationInfo", resp, "Failure sending request") 3146 return 3147 } 3148 3149 result, err = client.GetApplicationBackupConfigurationInfoResponder(resp) 3150 if err != nil { 3151 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationBackupConfigurationInfo", resp, "Failure responding to request") 3152 return 3153 } 3154 3155 return 3156} 3157 3158// GetApplicationBackupConfigurationInfoPreparer prepares the GetApplicationBackupConfigurationInfo request. 3159func (client BaseClient) GetApplicationBackupConfigurationInfoPreparer(ctx context.Context, applicationID string, continuationToken string, maxResults *int64, timeout *int64) (*http.Request, error) { 3160 pathParameters := map[string]interface{}{ 3161 "applicationId": applicationID, 3162 } 3163 3164 const APIVersion = "6.4" 3165 queryParameters := map[string]interface{}{ 3166 "api-version": APIVersion, 3167 } 3168 if len(continuationToken) > 0 { 3169 queryParameters["ContinuationToken"] = continuationToken 3170 } 3171 if maxResults != nil { 3172 queryParameters["MaxResults"] = autorest.Encode("query", *maxResults) 3173 } else { 3174 queryParameters["MaxResults"] = autorest.Encode("query", 0) 3175 } 3176 if timeout != nil { 3177 queryParameters["timeout"] = autorest.Encode("query", *timeout) 3178 } else { 3179 queryParameters["timeout"] = autorest.Encode("query", 60) 3180 } 3181 3182 preparer := autorest.CreatePreparer( 3183 autorest.AsGet(), 3184 autorest.WithBaseURL(client.BaseURI), 3185 autorest.WithPathParameters("/Applications/{applicationId}/$/GetBackupConfigurationInfo", pathParameters), 3186 autorest.WithQueryParameters(queryParameters)) 3187 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 3188} 3189 3190// GetApplicationBackupConfigurationInfoSender sends the GetApplicationBackupConfigurationInfo request. The method will close the 3191// http.Response Body if it receives an error. 3192func (client BaseClient) GetApplicationBackupConfigurationInfoSender(req *http.Request) (*http.Response, error) { 3193 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 3194} 3195 3196// GetApplicationBackupConfigurationInfoResponder handles the response to the GetApplicationBackupConfigurationInfo request. The method always 3197// closes the http.Response Body. 3198func (client BaseClient) GetApplicationBackupConfigurationInfoResponder(resp *http.Response) (result PagedBackupConfigurationInfoList, err error) { 3199 err = autorest.Respond( 3200 resp, 3201 azure.WithErrorUnlessStatusCode(http.StatusOK), 3202 autorest.ByUnmarshallingJSON(&result), 3203 autorest.ByClosing()) 3204 result.Response = autorest.Response{Response: resp} 3205 return 3206} 3207 3208// GetApplicationBackupList returns a list of backups available for every partition in this Service Fabric application. 3209// The server enumerates all the backups available at the backup location configured in the backup policy. It also 3210// allows filtering of the result based on start and end datetime or just fetching the latest available backup for 3211// every partition. 3212// Parameters: 3213// applicationID - the identity of the application. This is typically the full name of the application without 3214// the 'fabric:' URI scheme. 3215// Starting from version 6.0, hierarchical names are delimited with the "~" character. 3216// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" 3217// in 6.0+ and "myapp/app1" in previous versions. 3218// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 3219// duration that the client is willing to wait for the requested operation to complete. The default value for 3220// this parameter is 60 seconds. 3221// latest - specifies whether to get only the most recent backup available for a partition for the specified 3222// time range. 3223// startDateTimeFilter - specify the start date time from which to enumerate backups, in datetime format. The 3224// date time must be specified in ISO8601 format. This is an optional parameter. If not specified, all backups 3225// from the beginning are enumerated. 3226// endDateTimeFilter - specify the end date time till which to enumerate backups, in datetime format. The date 3227// time must be specified in ISO8601 format. This is an optional parameter. If not specified, enumeration is 3228// done till the most recent backup. 3229// continuationToken - the continuation token parameter is used to obtain next set of results. A continuation 3230// token with a non-empty value is included in the response of the API when the results from the system do not 3231// fit in a single response. When this value is passed to the next API call, the API returns next set of 3232// results. If there are no further results, then the continuation token does not contain a value. The value of 3233// this parameter should not be URL encoded. 3234// maxResults - the maximum number of results to be returned as part of the paged queries. This parameter 3235// defines the upper bound on the number of results returned. The results returned can be less than the 3236// specified maximum results if they do not fit in the message as per the max message size restrictions defined 3237// in the configuration. If this parameter is zero or not specified, the paged query includes as many results 3238// as possible that fit in the return message. 3239func (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) { 3240 if tracing.IsEnabled() { 3241 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetApplicationBackupList") 3242 defer func() { 3243 sc := -1 3244 if result.Response.Response != nil { 3245 sc = result.Response.Response.StatusCode 3246 } 3247 tracing.EndSpan(ctx, sc, err) 3248 }() 3249 } 3250 if err := validation.Validate([]validation.Validation{ 3251 {TargetValue: timeout, 3252 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 3253 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 3254 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 3255 }}}}, 3256 {TargetValue: maxResults, 3257 Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false, 3258 Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}}}}}}); err != nil { 3259 return result, validation.NewError("servicefabric.BaseClient", "GetApplicationBackupList", err.Error()) 3260 } 3261 3262 req, err := client.GetApplicationBackupListPreparer(ctx, applicationID, timeout, latest, startDateTimeFilter, endDateTimeFilter, continuationToken, maxResults) 3263 if err != nil { 3264 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationBackupList", nil, "Failure preparing request") 3265 return 3266 } 3267 3268 resp, err := client.GetApplicationBackupListSender(req) 3269 if err != nil { 3270 result.Response = autorest.Response{Response: resp} 3271 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationBackupList", resp, "Failure sending request") 3272 return 3273 } 3274 3275 result, err = client.GetApplicationBackupListResponder(resp) 3276 if err != nil { 3277 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationBackupList", resp, "Failure responding to request") 3278 return 3279 } 3280 3281 return 3282} 3283 3284// GetApplicationBackupListPreparer prepares the GetApplicationBackupList request. 3285func (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) { 3286 pathParameters := map[string]interface{}{ 3287 "applicationId": applicationID, 3288 } 3289 3290 const APIVersion = "6.4" 3291 queryParameters := map[string]interface{}{ 3292 "api-version": APIVersion, 3293 } 3294 if timeout != nil { 3295 queryParameters["timeout"] = autorest.Encode("query", *timeout) 3296 } else { 3297 queryParameters["timeout"] = autorest.Encode("query", 60) 3298 } 3299 if latest != nil { 3300 queryParameters["Latest"] = autorest.Encode("query", *latest) 3301 } else { 3302 queryParameters["Latest"] = autorest.Encode("query", false) 3303 } 3304 if startDateTimeFilter != nil { 3305 queryParameters["StartDateTimeFilter"] = autorest.Encode("query", *startDateTimeFilter) 3306 } 3307 if endDateTimeFilter != nil { 3308 queryParameters["EndDateTimeFilter"] = autorest.Encode("query", *endDateTimeFilter) 3309 } 3310 if len(continuationToken) > 0 { 3311 queryParameters["ContinuationToken"] = continuationToken 3312 } 3313 if maxResults != nil { 3314 queryParameters["MaxResults"] = autorest.Encode("query", *maxResults) 3315 } else { 3316 queryParameters["MaxResults"] = autorest.Encode("query", 0) 3317 } 3318 3319 preparer := autorest.CreatePreparer( 3320 autorest.AsGet(), 3321 autorest.WithBaseURL(client.BaseURI), 3322 autorest.WithPathParameters("/Applications/{applicationId}/$/GetBackups", pathParameters), 3323 autorest.WithQueryParameters(queryParameters)) 3324 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 3325} 3326 3327// GetApplicationBackupListSender sends the GetApplicationBackupList request. The method will close the 3328// http.Response Body if it receives an error. 3329func (client BaseClient) GetApplicationBackupListSender(req *http.Request) (*http.Response, error) { 3330 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 3331} 3332 3333// GetApplicationBackupListResponder handles the response to the GetApplicationBackupList request. The method always 3334// closes the http.Response Body. 3335func (client BaseClient) GetApplicationBackupListResponder(resp *http.Response) (result PagedBackupInfoList, err error) { 3336 err = autorest.Respond( 3337 resp, 3338 azure.WithErrorUnlessStatusCode(http.StatusOK), 3339 autorest.ByUnmarshallingJSON(&result), 3340 autorest.ByClosing()) 3341 result.Response = autorest.Response{Response: resp} 3342 return 3343} 3344 3345// GetApplicationEventList the response is list of ApplicationEvent objects. 3346// Parameters: 3347// applicationID - the identity of the application. This is typically the full name of the application without 3348// the 'fabric:' URI scheme. 3349// Starting from version 6.0, hierarchical names are delimited with the "~" character. 3350// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" 3351// in 6.0+ and "myapp/app1" in previous versions. 3352// startTimeUtc - the start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. 3353// endTimeUtc - the end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. 3354// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 3355// duration that the client is willing to wait for the requested operation to complete. The default value for 3356// this parameter is 60 seconds. 3357// eventsTypesFilter - this is a comma separated string specifying the types of FabricEvents that should only 3358// be included in the response. 3359// excludeAnalysisEvents - this param disables the retrieval of AnalysisEvents if true is passed. 3360// skipCorrelationLookup - this param disables the search of CorrelatedEvents information if true is passed. 3361// otherwise the CorrelationEvents get processed and HasCorrelatedEvents field in every FabricEvent gets 3362// populated. 3363func (client BaseClient) GetApplicationEventList(ctx context.Context, applicationID string, startTimeUtc string, endTimeUtc string, timeout *int64, eventsTypesFilter string, excludeAnalysisEvents *bool, skipCorrelationLookup *bool) (result ListApplicationEvent, err error) { 3364 if tracing.IsEnabled() { 3365 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetApplicationEventList") 3366 defer func() { 3367 sc := -1 3368 if result.Response.Response != nil { 3369 sc = result.Response.Response.StatusCode 3370 } 3371 tracing.EndSpan(ctx, sc, err) 3372 }() 3373 } 3374 if err := validation.Validate([]validation.Validation{ 3375 {TargetValue: timeout, 3376 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 3377 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 3378 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 3379 }}}}}); err != nil { 3380 return result, validation.NewError("servicefabric.BaseClient", "GetApplicationEventList", err.Error()) 3381 } 3382 3383 req, err := client.GetApplicationEventListPreparer(ctx, applicationID, startTimeUtc, endTimeUtc, timeout, eventsTypesFilter, excludeAnalysisEvents, skipCorrelationLookup) 3384 if err != nil { 3385 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationEventList", nil, "Failure preparing request") 3386 return 3387 } 3388 3389 resp, err := client.GetApplicationEventListSender(req) 3390 if err != nil { 3391 result.Response = autorest.Response{Response: resp} 3392 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationEventList", resp, "Failure sending request") 3393 return 3394 } 3395 3396 result, err = client.GetApplicationEventListResponder(resp) 3397 if err != nil { 3398 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationEventList", resp, "Failure responding to request") 3399 return 3400 } 3401 3402 return 3403} 3404 3405// GetApplicationEventListPreparer prepares the GetApplicationEventList request. 3406func (client BaseClient) GetApplicationEventListPreparer(ctx context.Context, applicationID string, startTimeUtc string, endTimeUtc string, timeout *int64, eventsTypesFilter string, excludeAnalysisEvents *bool, skipCorrelationLookup *bool) (*http.Request, error) { 3407 pathParameters := map[string]interface{}{ 3408 "applicationId": applicationID, 3409 } 3410 3411 const APIVersion = "6.4" 3412 queryParameters := map[string]interface{}{ 3413 "api-version": APIVersion, 3414 "EndTimeUtc": autorest.Encode("query", endTimeUtc), 3415 "StartTimeUtc": autorest.Encode("query", startTimeUtc), 3416 } 3417 if timeout != nil { 3418 queryParameters["timeout"] = autorest.Encode("query", *timeout) 3419 } else { 3420 queryParameters["timeout"] = autorest.Encode("query", 60) 3421 } 3422 if len(eventsTypesFilter) > 0 { 3423 queryParameters["EventsTypesFilter"] = autorest.Encode("query", eventsTypesFilter) 3424 } 3425 if excludeAnalysisEvents != nil { 3426 queryParameters["ExcludeAnalysisEvents"] = autorest.Encode("query", *excludeAnalysisEvents) 3427 } 3428 if skipCorrelationLookup != nil { 3429 queryParameters["SkipCorrelationLookup"] = autorest.Encode("query", *skipCorrelationLookup) 3430 } 3431 3432 preparer := autorest.CreatePreparer( 3433 autorest.AsGet(), 3434 autorest.WithBaseURL(client.BaseURI), 3435 autorest.WithPathParameters("/EventsStore/Applications/{applicationId}/$/Events", pathParameters), 3436 autorest.WithQueryParameters(queryParameters)) 3437 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 3438} 3439 3440// GetApplicationEventListSender sends the GetApplicationEventList request. The method will close the 3441// http.Response Body if it receives an error. 3442func (client BaseClient) GetApplicationEventListSender(req *http.Request) (*http.Response, error) { 3443 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 3444} 3445 3446// GetApplicationEventListResponder handles the response to the GetApplicationEventList request. The method always 3447// closes the http.Response Body. 3448func (client BaseClient) GetApplicationEventListResponder(resp *http.Response) (result ListApplicationEvent, err error) { 3449 err = autorest.Respond( 3450 resp, 3451 azure.WithErrorUnlessStatusCode(http.StatusOK), 3452 autorest.ByUnmarshallingJSON(&result), 3453 autorest.ByClosing()) 3454 result.Response = autorest.Response{Response: resp} 3455 return 3456} 3457 3458// GetApplicationHealth returns the heath state of the service fabric application. The response reports either Ok, 3459// Error or Warning health state. If the entity is not found in the health store, it will return Error. 3460// Parameters: 3461// applicationID - the identity of the application. This is typically the full name of the application without 3462// the 'fabric:' URI scheme. 3463// Starting from version 6.0, hierarchical names are delimited with the "~" character. 3464// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" 3465// in 6.0+ and "myapp/app1" in previous versions. 3466// eventsHealthStateFilter - allows filtering the collection of HealthEvent objects returned based on health 3467// state. 3468// The possible values for this parameter include integer value of one of the following health states. 3469// Only events that match the filter are returned. All events are used to evaluate the aggregated health state. 3470// If not specified, all entries are returned. The state values are flag-based enumeration, so the value could 3471// be a combination of these values, obtained using the bitwise 'OR' operator. For example, If the provided 3472// value is 6 then all of the events with HealthState value of OK (2) and Warning (4) are returned. 3473// 3474// - Default - Default value. Matches any HealthState. The value is zero. 3475// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given 3476// collection of states. The value is 1. 3477// - Ok - Filter that matches input with HealthState value Ok. The value is 2. 3478// - Warning - Filter that matches input with HealthState value Warning. The value is 4. 3479// - Error - Filter that matches input with HealthState value Error. The value is 8. 3480// - All - Filter that matches input with any HealthState value. The value is 65535. 3481// deployedApplicationsHealthStateFilter - allows filtering of the deployed applications health state objects 3482// returned in the result of application health query based on their health state. 3483// The possible values for this parameter include integer value of one of the following health states. Only 3484// deployed applications that match the filter will be returned. 3485// All deployed applications are used to evaluate the aggregated health state. If not specified, all entries 3486// are returned. 3487// The state values are flag-based enumeration, so the value could be a combination of these values, obtained 3488// using bitwise 'OR' operator. 3489// For example, if the provided value is 6 then health state of deployed applications with HealthState value of 3490// OK (2) and Warning (4) are returned. 3491// 3492// - Default - Default value. Matches any HealthState. The value is zero. 3493// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given 3494// collection of states. The value is 1. 3495// - Ok - Filter that matches input with HealthState value Ok. The value is 2. 3496// - Warning - Filter that matches input with HealthState value Warning. The value is 4. 3497// - Error - Filter that matches input with HealthState value Error. The value is 8. 3498// - All - Filter that matches input with any HealthState value. The value is 65535. 3499// servicesHealthStateFilter - allows filtering of the services health state objects returned in the result of 3500// services health query based on their health state. 3501// The possible values for this parameter include integer value of one of the following health states. 3502// Only services that match the filter are returned. All services are used to evaluate the aggregated health 3503// state. 3504// If not specified, all entries are returned. The state values are flag-based enumeration, so the value could 3505// be a combination of these values, 3506// obtained using bitwise 'OR' operator. For example, if the provided value is 6 then health state of services 3507// with HealthState value of OK (2) and Warning (4) will be returned. 3508// 3509// - Default - Default value. Matches any HealthState. The value is zero. 3510// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given 3511// collection of states. The value is 1. 3512// - Ok - Filter that matches input with HealthState value Ok. The value is 2. 3513// - Warning - Filter that matches input with HealthState value Warning. The value is 4. 3514// - Error - Filter that matches input with HealthState value Error. The value is 8. 3515// - All - Filter that matches input with any HealthState value. The value is 65535. 3516// excludeHealthStatistics - indicates whether the health statistics should be returned as part of the query 3517// result. False by default. 3518// The statistics show the number of children entities in health state Ok, Warning, and Error. 3519// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 3520// duration that the client is willing to wait for the requested operation to complete. The default value for 3521// this parameter is 60 seconds. 3522func (client BaseClient) GetApplicationHealth(ctx context.Context, applicationID string, eventsHealthStateFilter *int32, deployedApplicationsHealthStateFilter *int32, servicesHealthStateFilter *int32, excludeHealthStatistics *bool, timeout *int64) (result ApplicationHealth, err error) { 3523 if tracing.IsEnabled() { 3524 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetApplicationHealth") 3525 defer func() { 3526 sc := -1 3527 if result.Response.Response != nil { 3528 sc = result.Response.Response.StatusCode 3529 } 3530 tracing.EndSpan(ctx, sc, err) 3531 }() 3532 } 3533 if err := validation.Validate([]validation.Validation{ 3534 {TargetValue: timeout, 3535 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 3536 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 3537 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 3538 }}}}}); err != nil { 3539 return result, validation.NewError("servicefabric.BaseClient", "GetApplicationHealth", err.Error()) 3540 } 3541 3542 req, err := client.GetApplicationHealthPreparer(ctx, applicationID, eventsHealthStateFilter, deployedApplicationsHealthStateFilter, servicesHealthStateFilter, excludeHealthStatistics, timeout) 3543 if err != nil { 3544 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationHealth", nil, "Failure preparing request") 3545 return 3546 } 3547 3548 resp, err := client.GetApplicationHealthSender(req) 3549 if err != nil { 3550 result.Response = autorest.Response{Response: resp} 3551 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationHealth", resp, "Failure sending request") 3552 return 3553 } 3554 3555 result, err = client.GetApplicationHealthResponder(resp) 3556 if err != nil { 3557 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationHealth", resp, "Failure responding to request") 3558 return 3559 } 3560 3561 return 3562} 3563 3564// GetApplicationHealthPreparer prepares the GetApplicationHealth request. 3565func (client BaseClient) GetApplicationHealthPreparer(ctx context.Context, applicationID string, eventsHealthStateFilter *int32, deployedApplicationsHealthStateFilter *int32, servicesHealthStateFilter *int32, excludeHealthStatistics *bool, timeout *int64) (*http.Request, error) { 3566 pathParameters := map[string]interface{}{ 3567 "applicationId": applicationID, 3568 } 3569 3570 const APIVersion = "6.0" 3571 queryParameters := map[string]interface{}{ 3572 "api-version": APIVersion, 3573 } 3574 if eventsHealthStateFilter != nil { 3575 queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", *eventsHealthStateFilter) 3576 } else { 3577 queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", 0) 3578 } 3579 if deployedApplicationsHealthStateFilter != nil { 3580 queryParameters["DeployedApplicationsHealthStateFilter"] = autorest.Encode("query", *deployedApplicationsHealthStateFilter) 3581 } else { 3582 queryParameters["DeployedApplicationsHealthStateFilter"] = autorest.Encode("query", 0) 3583 } 3584 if servicesHealthStateFilter != nil { 3585 queryParameters["ServicesHealthStateFilter"] = autorest.Encode("query", *servicesHealthStateFilter) 3586 } else { 3587 queryParameters["ServicesHealthStateFilter"] = autorest.Encode("query", 0) 3588 } 3589 if excludeHealthStatistics != nil { 3590 queryParameters["ExcludeHealthStatistics"] = autorest.Encode("query", *excludeHealthStatistics) 3591 } else { 3592 queryParameters["ExcludeHealthStatistics"] = autorest.Encode("query", false) 3593 } 3594 if timeout != nil { 3595 queryParameters["timeout"] = autorest.Encode("query", *timeout) 3596 } else { 3597 queryParameters["timeout"] = autorest.Encode("query", 60) 3598 } 3599 3600 preparer := autorest.CreatePreparer( 3601 autorest.AsGet(), 3602 autorest.WithBaseURL(client.BaseURI), 3603 autorest.WithPathParameters("/Applications/{applicationId}/$/GetHealth", pathParameters), 3604 autorest.WithQueryParameters(queryParameters)) 3605 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 3606} 3607 3608// GetApplicationHealthSender sends the GetApplicationHealth request. The method will close the 3609// http.Response Body if it receives an error. 3610func (client BaseClient) GetApplicationHealthSender(req *http.Request) (*http.Response, error) { 3611 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 3612} 3613 3614// GetApplicationHealthResponder handles the response to the GetApplicationHealth request. The method always 3615// closes the http.Response Body. 3616func (client BaseClient) GetApplicationHealthResponder(resp *http.Response) (result ApplicationHealth, err error) { 3617 err = autorest.Respond( 3618 resp, 3619 azure.WithErrorUnlessStatusCode(http.StatusOK), 3620 autorest.ByUnmarshallingJSON(&result), 3621 autorest.ByClosing()) 3622 result.Response = autorest.Response{Response: resp} 3623 return 3624} 3625 3626// GetApplicationHealthUsingPolicy gets the health of a Service Fabric application. Use EventsHealthStateFilter to 3627// filter the collection of health events reported on the node based on the health state. Use ClusterHealthPolicies to 3628// override the health policies used to evaluate the health. 3629// Parameters: 3630// applicationID - the identity of the application. This is typically the full name of the application without 3631// the 'fabric:' URI scheme. 3632// Starting from version 6.0, hierarchical names are delimited with the "~" character. 3633// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" 3634// in 6.0+ and "myapp/app1" in previous versions. 3635// eventsHealthStateFilter - allows filtering the collection of HealthEvent objects returned based on health 3636// state. 3637// The possible values for this parameter include integer value of one of the following health states. 3638// Only events that match the filter are returned. All events are used to evaluate the aggregated health state. 3639// If not specified, all entries are returned. The state values are flag-based enumeration, so the value could 3640// be a combination of these values, obtained using the bitwise 'OR' operator. For example, If the provided 3641// value is 6 then all of the events with HealthState value of OK (2) and Warning (4) are returned. 3642// 3643// - Default - Default value. Matches any HealthState. The value is zero. 3644// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given 3645// collection of states. The value is 1. 3646// - Ok - Filter that matches input with HealthState value Ok. The value is 2. 3647// - Warning - Filter that matches input with HealthState value Warning. The value is 4. 3648// - Error - Filter that matches input with HealthState value Error. The value is 8. 3649// - All - Filter that matches input with any HealthState value. The value is 65535. 3650// deployedApplicationsHealthStateFilter - allows filtering of the deployed applications health state objects 3651// returned in the result of application health query based on their health state. 3652// The possible values for this parameter include integer value of one of the following health states. Only 3653// deployed applications that match the filter will be returned. 3654// All deployed applications are used to evaluate the aggregated health state. If not specified, all entries 3655// are returned. 3656// The state values are flag-based enumeration, so the value could be a combination of these values, obtained 3657// using bitwise 'OR' operator. 3658// For example, if the provided value is 6 then health state of deployed applications with HealthState value of 3659// OK (2) and Warning (4) are returned. 3660// 3661// - Default - Default value. Matches any HealthState. The value is zero. 3662// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given 3663// collection of states. The value is 1. 3664// - Ok - Filter that matches input with HealthState value Ok. The value is 2. 3665// - Warning - Filter that matches input with HealthState value Warning. The value is 4. 3666// - Error - Filter that matches input with HealthState value Error. The value is 8. 3667// - All - Filter that matches input with any HealthState value. The value is 65535. 3668// servicesHealthStateFilter - allows filtering of the services health state objects returned in the result of 3669// services health query based on their health state. 3670// The possible values for this parameter include integer value of one of the following health states. 3671// Only services that match the filter are returned. All services are used to evaluate the aggregated health 3672// state. 3673// If not specified, all entries are returned. The state values are flag-based enumeration, so the value could 3674// be a combination of these values, 3675// obtained using bitwise 'OR' operator. For example, if the provided value is 6 then health state of services 3676// with HealthState value of OK (2) and Warning (4) will be returned. 3677// 3678// - Default - Default value. Matches any HealthState. The value is zero. 3679// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given 3680// collection of states. The value is 1. 3681// - Ok - Filter that matches input with HealthState value Ok. The value is 2. 3682// - Warning - Filter that matches input with HealthState value Warning. The value is 4. 3683// - Error - Filter that matches input with HealthState value Error. The value is 8. 3684// - All - Filter that matches input with any HealthState value. The value is 65535. 3685// excludeHealthStatistics - indicates whether the health statistics should be returned as part of the query 3686// result. False by default. 3687// The statistics show the number of children entities in health state Ok, Warning, and Error. 3688// applicationHealthPolicy - describes the health policies used to evaluate the health of an application or one 3689// of its children. 3690// If not present, the health evaluation uses the health policy from application manifest or the default health 3691// policy. 3692// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 3693// duration that the client is willing to wait for the requested operation to complete. The default value for 3694// this parameter is 60 seconds. 3695func (client BaseClient) GetApplicationHealthUsingPolicy(ctx context.Context, applicationID string, eventsHealthStateFilter *int32, deployedApplicationsHealthStateFilter *int32, servicesHealthStateFilter *int32, excludeHealthStatistics *bool, applicationHealthPolicy *ApplicationHealthPolicy, timeout *int64) (result ApplicationHealth, err error) { 3696 if tracing.IsEnabled() { 3697 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetApplicationHealthUsingPolicy") 3698 defer func() { 3699 sc := -1 3700 if result.Response.Response != nil { 3701 sc = result.Response.Response.StatusCode 3702 } 3703 tracing.EndSpan(ctx, sc, err) 3704 }() 3705 } 3706 if err := validation.Validate([]validation.Validation{ 3707 {TargetValue: timeout, 3708 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 3709 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 3710 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 3711 }}}}}); err != nil { 3712 return result, validation.NewError("servicefabric.BaseClient", "GetApplicationHealthUsingPolicy", err.Error()) 3713 } 3714 3715 req, err := client.GetApplicationHealthUsingPolicyPreparer(ctx, applicationID, eventsHealthStateFilter, deployedApplicationsHealthStateFilter, servicesHealthStateFilter, excludeHealthStatistics, applicationHealthPolicy, timeout) 3716 if err != nil { 3717 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationHealthUsingPolicy", nil, "Failure preparing request") 3718 return 3719 } 3720 3721 resp, err := client.GetApplicationHealthUsingPolicySender(req) 3722 if err != nil { 3723 result.Response = autorest.Response{Response: resp} 3724 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationHealthUsingPolicy", resp, "Failure sending request") 3725 return 3726 } 3727 3728 result, err = client.GetApplicationHealthUsingPolicyResponder(resp) 3729 if err != nil { 3730 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationHealthUsingPolicy", resp, "Failure responding to request") 3731 return 3732 } 3733 3734 return 3735} 3736 3737// GetApplicationHealthUsingPolicyPreparer prepares the GetApplicationHealthUsingPolicy request. 3738func (client BaseClient) GetApplicationHealthUsingPolicyPreparer(ctx context.Context, applicationID string, eventsHealthStateFilter *int32, deployedApplicationsHealthStateFilter *int32, servicesHealthStateFilter *int32, excludeHealthStatistics *bool, applicationHealthPolicy *ApplicationHealthPolicy, timeout *int64) (*http.Request, error) { 3739 pathParameters := map[string]interface{}{ 3740 "applicationId": applicationID, 3741 } 3742 3743 const APIVersion = "6.0" 3744 queryParameters := map[string]interface{}{ 3745 "api-version": APIVersion, 3746 } 3747 if eventsHealthStateFilter != nil { 3748 queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", *eventsHealthStateFilter) 3749 } else { 3750 queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", 0) 3751 } 3752 if deployedApplicationsHealthStateFilter != nil { 3753 queryParameters["DeployedApplicationsHealthStateFilter"] = autorest.Encode("query", *deployedApplicationsHealthStateFilter) 3754 } else { 3755 queryParameters["DeployedApplicationsHealthStateFilter"] = autorest.Encode("query", 0) 3756 } 3757 if servicesHealthStateFilter != nil { 3758 queryParameters["ServicesHealthStateFilter"] = autorest.Encode("query", *servicesHealthStateFilter) 3759 } else { 3760 queryParameters["ServicesHealthStateFilter"] = autorest.Encode("query", 0) 3761 } 3762 if excludeHealthStatistics != nil { 3763 queryParameters["ExcludeHealthStatistics"] = autorest.Encode("query", *excludeHealthStatistics) 3764 } else { 3765 queryParameters["ExcludeHealthStatistics"] = autorest.Encode("query", false) 3766 } 3767 if timeout != nil { 3768 queryParameters["timeout"] = autorest.Encode("query", *timeout) 3769 } else { 3770 queryParameters["timeout"] = autorest.Encode("query", 60) 3771 } 3772 3773 preparer := autorest.CreatePreparer( 3774 autorest.AsContentType("application/json; charset=utf-8"), 3775 autorest.AsPost(), 3776 autorest.WithBaseURL(client.BaseURI), 3777 autorest.WithPathParameters("/Applications/{applicationId}/$/GetHealth", pathParameters), 3778 autorest.WithQueryParameters(queryParameters)) 3779 if applicationHealthPolicy != nil { 3780 preparer = autorest.DecoratePreparer(preparer, 3781 autorest.WithJSON(applicationHealthPolicy)) 3782 } 3783 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 3784} 3785 3786// GetApplicationHealthUsingPolicySender sends the GetApplicationHealthUsingPolicy request. The method will close the 3787// http.Response Body if it receives an error. 3788func (client BaseClient) GetApplicationHealthUsingPolicySender(req *http.Request) (*http.Response, error) { 3789 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 3790} 3791 3792// GetApplicationHealthUsingPolicyResponder handles the response to the GetApplicationHealthUsingPolicy request. The method always 3793// closes the http.Response Body. 3794func (client BaseClient) GetApplicationHealthUsingPolicyResponder(resp *http.Response) (result ApplicationHealth, err error) { 3795 err = autorest.Respond( 3796 resp, 3797 azure.WithErrorUnlessStatusCode(http.StatusOK), 3798 autorest.ByUnmarshallingJSON(&result), 3799 autorest.ByClosing()) 3800 result.Response = autorest.Response{Response: resp} 3801 return 3802} 3803 3804// GetApplicationInfo returns the information about the application that was created or in the process of being created 3805// in the Service Fabric cluster and whose name matches the one specified as the parameter. The response includes the 3806// name, type, status, parameters, and other details about the application. 3807// Parameters: 3808// applicationID - the identity of the application. This is typically the full name of the application without 3809// the 'fabric:' URI scheme. 3810// Starting from version 6.0, hierarchical names are delimited with the "~" character. 3811// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" 3812// in 6.0+ and "myapp/app1" in previous versions. 3813// excludeApplicationParameters - the flag that specifies whether application parameters will be excluded from 3814// the result. 3815// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 3816// duration that the client is willing to wait for the requested operation to complete. The default value for 3817// this parameter is 60 seconds. 3818func (client BaseClient) GetApplicationInfo(ctx context.Context, applicationID string, excludeApplicationParameters *bool, timeout *int64) (result ApplicationInfo, err error) { 3819 if tracing.IsEnabled() { 3820 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetApplicationInfo") 3821 defer func() { 3822 sc := -1 3823 if result.Response.Response != nil { 3824 sc = result.Response.Response.StatusCode 3825 } 3826 tracing.EndSpan(ctx, sc, err) 3827 }() 3828 } 3829 if err := validation.Validate([]validation.Validation{ 3830 {TargetValue: timeout, 3831 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 3832 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 3833 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 3834 }}}}}); err != nil { 3835 return result, validation.NewError("servicefabric.BaseClient", "GetApplicationInfo", err.Error()) 3836 } 3837 3838 req, err := client.GetApplicationInfoPreparer(ctx, applicationID, excludeApplicationParameters, timeout) 3839 if err != nil { 3840 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationInfo", nil, "Failure preparing request") 3841 return 3842 } 3843 3844 resp, err := client.GetApplicationInfoSender(req) 3845 if err != nil { 3846 result.Response = autorest.Response{Response: resp} 3847 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationInfo", resp, "Failure sending request") 3848 return 3849 } 3850 3851 result, err = client.GetApplicationInfoResponder(resp) 3852 if err != nil { 3853 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationInfo", resp, "Failure responding to request") 3854 return 3855 } 3856 3857 return 3858} 3859 3860// GetApplicationInfoPreparer prepares the GetApplicationInfo request. 3861func (client BaseClient) GetApplicationInfoPreparer(ctx context.Context, applicationID string, excludeApplicationParameters *bool, timeout *int64) (*http.Request, error) { 3862 pathParameters := map[string]interface{}{ 3863 "applicationId": applicationID, 3864 } 3865 3866 const APIVersion = "6.0" 3867 queryParameters := map[string]interface{}{ 3868 "api-version": APIVersion, 3869 } 3870 if excludeApplicationParameters != nil { 3871 queryParameters["ExcludeApplicationParameters"] = autorest.Encode("query", *excludeApplicationParameters) 3872 } else { 3873 queryParameters["ExcludeApplicationParameters"] = autorest.Encode("query", false) 3874 } 3875 if timeout != nil { 3876 queryParameters["timeout"] = autorest.Encode("query", *timeout) 3877 } else { 3878 queryParameters["timeout"] = autorest.Encode("query", 60) 3879 } 3880 3881 preparer := autorest.CreatePreparer( 3882 autorest.AsGet(), 3883 autorest.WithBaseURL(client.BaseURI), 3884 autorest.WithPathParameters("/Applications/{applicationId}", pathParameters), 3885 autorest.WithQueryParameters(queryParameters)) 3886 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 3887} 3888 3889// GetApplicationInfoSender sends the GetApplicationInfo request. The method will close the 3890// http.Response Body if it receives an error. 3891func (client BaseClient) GetApplicationInfoSender(req *http.Request) (*http.Response, error) { 3892 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 3893} 3894 3895// GetApplicationInfoResponder handles the response to the GetApplicationInfo request. The method always 3896// closes the http.Response Body. 3897func (client BaseClient) GetApplicationInfoResponder(resp *http.Response) (result ApplicationInfo, err error) { 3898 err = autorest.Respond( 3899 resp, 3900 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), 3901 autorest.ByUnmarshallingJSON(&result), 3902 autorest.ByClosing()) 3903 result.Response = autorest.Response{Response: resp} 3904 return 3905} 3906 3907// GetApplicationInfoList gets the information about the applications that were created or in the process of being 3908// created in the Service Fabric cluster and match the specified filters. The response includes the name, type, status, 3909// parameters, and other details about the application. If the applications do not fit in a page, one page of results 3910// is returned as well as a continuation token, which can be used to get the next page. Filters ApplicationTypeName and 3911// ApplicationDefinitionKindFilter cannot be specified at the same time. 3912// Parameters: 3913// applicationDefinitionKindFilter - used to filter on ApplicationDefinitionKind, which is the mechanism used 3914// to define a Service Fabric application. 3915// - Default - Default value, which performs the same function as selecting "All". The value is 0. 3916// - All - Filter that matches input with any ApplicationDefinitionKind value. The value is 65535. 3917// - ServiceFabricApplicationDescription - Filter that matches input with ApplicationDefinitionKind value 3918// ServiceFabricApplicationDescription. The value is 1. 3919// - Compose - Filter that matches input with ApplicationDefinitionKind value Compose. The value is 2. 3920// applicationTypeName - the application type name used to filter the applications to query for. This value 3921// should not contain the application type version. 3922// excludeApplicationParameters - the flag that specifies whether application parameters will be excluded from 3923// the result. 3924// continuationToken - the continuation token parameter is used to obtain next set of results. A continuation 3925// token with a non-empty value is included in the response of the API when the results from the system do not 3926// fit in a single response. When this value is passed to the next API call, the API returns next set of 3927// results. If there are no further results, then the continuation token does not contain a value. The value of 3928// this parameter should not be URL encoded. 3929// maxResults - the maximum number of results to be returned as part of the paged queries. This parameter 3930// defines the upper bound on the number of results returned. The results returned can be less than the 3931// specified maximum results if they do not fit in the message as per the max message size restrictions defined 3932// in the configuration. If this parameter is zero or not specified, the paged query includes as many results 3933// as possible that fit in the return message. 3934// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 3935// duration that the client is willing to wait for the requested operation to complete. The default value for 3936// this parameter is 60 seconds. 3937func (client BaseClient) GetApplicationInfoList(ctx context.Context, applicationDefinitionKindFilter *int32, applicationTypeName string, excludeApplicationParameters *bool, continuationToken string, maxResults *int64, timeout *int64) (result PagedApplicationInfoList, err error) { 3938 if tracing.IsEnabled() { 3939 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetApplicationInfoList") 3940 defer func() { 3941 sc := -1 3942 if result.Response.Response != nil { 3943 sc = result.Response.Response.StatusCode 3944 } 3945 tracing.EndSpan(ctx, sc, err) 3946 }() 3947 } 3948 if err := validation.Validate([]validation.Validation{ 3949 {TargetValue: maxResults, 3950 Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false, 3951 Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}}}}}, 3952 {TargetValue: timeout, 3953 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 3954 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 3955 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 3956 }}}}}); err != nil { 3957 return result, validation.NewError("servicefabric.BaseClient", "GetApplicationInfoList", err.Error()) 3958 } 3959 3960 req, err := client.GetApplicationInfoListPreparer(ctx, applicationDefinitionKindFilter, applicationTypeName, excludeApplicationParameters, continuationToken, maxResults, timeout) 3961 if err != nil { 3962 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationInfoList", nil, "Failure preparing request") 3963 return 3964 } 3965 3966 resp, err := client.GetApplicationInfoListSender(req) 3967 if err != nil { 3968 result.Response = autorest.Response{Response: resp} 3969 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationInfoList", resp, "Failure sending request") 3970 return 3971 } 3972 3973 result, err = client.GetApplicationInfoListResponder(resp) 3974 if err != nil { 3975 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationInfoList", resp, "Failure responding to request") 3976 return 3977 } 3978 3979 return 3980} 3981 3982// GetApplicationInfoListPreparer prepares the GetApplicationInfoList request. 3983func (client BaseClient) GetApplicationInfoListPreparer(ctx context.Context, applicationDefinitionKindFilter *int32, applicationTypeName string, excludeApplicationParameters *bool, continuationToken string, maxResults *int64, timeout *int64) (*http.Request, error) { 3984 const APIVersion = "6.1" 3985 queryParameters := map[string]interface{}{ 3986 "api-version": APIVersion, 3987 } 3988 if applicationDefinitionKindFilter != nil { 3989 queryParameters["ApplicationDefinitionKindFilter"] = autorest.Encode("query", *applicationDefinitionKindFilter) 3990 } else { 3991 queryParameters["ApplicationDefinitionKindFilter"] = autorest.Encode("query", 0) 3992 } 3993 if len(applicationTypeName) > 0 { 3994 queryParameters["ApplicationTypeName"] = autorest.Encode("query", applicationTypeName) 3995 } 3996 if excludeApplicationParameters != nil { 3997 queryParameters["ExcludeApplicationParameters"] = autorest.Encode("query", *excludeApplicationParameters) 3998 } else { 3999 queryParameters["ExcludeApplicationParameters"] = autorest.Encode("query", false) 4000 } 4001 if len(continuationToken) > 0 { 4002 queryParameters["ContinuationToken"] = continuationToken 4003 } 4004 if maxResults != nil { 4005 queryParameters["MaxResults"] = autorest.Encode("query", *maxResults) 4006 } else { 4007 queryParameters["MaxResults"] = autorest.Encode("query", 0) 4008 } 4009 if timeout != nil { 4010 queryParameters["timeout"] = autorest.Encode("query", *timeout) 4011 } else { 4012 queryParameters["timeout"] = autorest.Encode("query", 60) 4013 } 4014 4015 preparer := autorest.CreatePreparer( 4016 autorest.AsGet(), 4017 autorest.WithBaseURL(client.BaseURI), 4018 autorest.WithPath("/Applications"), 4019 autorest.WithQueryParameters(queryParameters)) 4020 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 4021} 4022 4023// GetApplicationInfoListSender sends the GetApplicationInfoList request. The method will close the 4024// http.Response Body if it receives an error. 4025func (client BaseClient) GetApplicationInfoListSender(req *http.Request) (*http.Response, error) { 4026 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 4027} 4028 4029// GetApplicationInfoListResponder handles the response to the GetApplicationInfoList request. The method always 4030// closes the http.Response Body. 4031func (client BaseClient) GetApplicationInfoListResponder(resp *http.Response) (result PagedApplicationInfoList, err error) { 4032 err = autorest.Respond( 4033 resp, 4034 azure.WithErrorUnlessStatusCode(http.StatusOK), 4035 autorest.ByUnmarshallingJSON(&result), 4036 autorest.ByClosing()) 4037 result.Response = autorest.Response{Response: resp} 4038 return 4039} 4040 4041// GetApplicationLoadInfo returns the load information about the application that was created or in the process of 4042// being created in the Service Fabric cluster and whose name matches the one specified as the parameter. The response 4043// includes the name, minimum nodes, maximum nodes, the number of nodes the application is occupying currently, and 4044// application load metric information about the application. 4045// Parameters: 4046// applicationID - the identity of the application. This is typically the full name of the application without 4047// the 'fabric:' URI scheme. 4048// Starting from version 6.0, hierarchical names are delimited with the "~" character. 4049// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" 4050// in 6.0+ and "myapp/app1" in previous versions. 4051// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 4052// duration that the client is willing to wait for the requested operation to complete. The default value for 4053// this parameter is 60 seconds. 4054func (client BaseClient) GetApplicationLoadInfo(ctx context.Context, applicationID string, timeout *int64) (result ApplicationLoadInfo, err error) { 4055 if tracing.IsEnabled() { 4056 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetApplicationLoadInfo") 4057 defer func() { 4058 sc := -1 4059 if result.Response.Response != nil { 4060 sc = result.Response.Response.StatusCode 4061 } 4062 tracing.EndSpan(ctx, sc, err) 4063 }() 4064 } 4065 if err := validation.Validate([]validation.Validation{ 4066 {TargetValue: timeout, 4067 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 4068 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 4069 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 4070 }}}}}); err != nil { 4071 return result, validation.NewError("servicefabric.BaseClient", "GetApplicationLoadInfo", err.Error()) 4072 } 4073 4074 req, err := client.GetApplicationLoadInfoPreparer(ctx, applicationID, timeout) 4075 if err != nil { 4076 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationLoadInfo", nil, "Failure preparing request") 4077 return 4078 } 4079 4080 resp, err := client.GetApplicationLoadInfoSender(req) 4081 if err != nil { 4082 result.Response = autorest.Response{Response: resp} 4083 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationLoadInfo", resp, "Failure sending request") 4084 return 4085 } 4086 4087 result, err = client.GetApplicationLoadInfoResponder(resp) 4088 if err != nil { 4089 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationLoadInfo", resp, "Failure responding to request") 4090 return 4091 } 4092 4093 return 4094} 4095 4096// GetApplicationLoadInfoPreparer prepares the GetApplicationLoadInfo request. 4097func (client BaseClient) GetApplicationLoadInfoPreparer(ctx context.Context, applicationID string, timeout *int64) (*http.Request, error) { 4098 pathParameters := map[string]interface{}{ 4099 "applicationId": applicationID, 4100 } 4101 4102 const APIVersion = "6.0" 4103 queryParameters := map[string]interface{}{ 4104 "api-version": APIVersion, 4105 } 4106 if timeout != nil { 4107 queryParameters["timeout"] = autorest.Encode("query", *timeout) 4108 } else { 4109 queryParameters["timeout"] = autorest.Encode("query", 60) 4110 } 4111 4112 preparer := autorest.CreatePreparer( 4113 autorest.AsGet(), 4114 autorest.WithBaseURL(client.BaseURI), 4115 autorest.WithPathParameters("/Applications/{applicationId}/$/GetLoadInformation", pathParameters), 4116 autorest.WithQueryParameters(queryParameters)) 4117 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 4118} 4119 4120// GetApplicationLoadInfoSender sends the GetApplicationLoadInfo request. The method will close the 4121// http.Response Body if it receives an error. 4122func (client BaseClient) GetApplicationLoadInfoSender(req *http.Request) (*http.Response, error) { 4123 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 4124} 4125 4126// GetApplicationLoadInfoResponder handles the response to the GetApplicationLoadInfo request. The method always 4127// closes the http.Response Body. 4128func (client BaseClient) GetApplicationLoadInfoResponder(resp *http.Response) (result ApplicationLoadInfo, err error) { 4129 err = autorest.Respond( 4130 resp, 4131 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), 4132 autorest.ByUnmarshallingJSON(&result), 4133 autorest.ByClosing()) 4134 result.Response = autorest.Response{Response: resp} 4135 return 4136} 4137 4138// GetApplicationManifest the response contains the application manifest XML as a string. 4139// Parameters: 4140// applicationTypeName - the name of the application type. 4141// applicationTypeVersion - the version of the application type. 4142// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 4143// duration that the client is willing to wait for the requested operation to complete. The default value for 4144// this parameter is 60 seconds. 4145func (client BaseClient) GetApplicationManifest(ctx context.Context, applicationTypeName string, applicationTypeVersion string, timeout *int64) (result ApplicationTypeManifest, err error) { 4146 if tracing.IsEnabled() { 4147 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetApplicationManifest") 4148 defer func() { 4149 sc := -1 4150 if result.Response.Response != nil { 4151 sc = result.Response.Response.StatusCode 4152 } 4153 tracing.EndSpan(ctx, sc, err) 4154 }() 4155 } 4156 if err := validation.Validate([]validation.Validation{ 4157 {TargetValue: timeout, 4158 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 4159 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 4160 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 4161 }}}}}); err != nil { 4162 return result, validation.NewError("servicefabric.BaseClient", "GetApplicationManifest", err.Error()) 4163 } 4164 4165 req, err := client.GetApplicationManifestPreparer(ctx, applicationTypeName, applicationTypeVersion, timeout) 4166 if err != nil { 4167 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationManifest", nil, "Failure preparing request") 4168 return 4169 } 4170 4171 resp, err := client.GetApplicationManifestSender(req) 4172 if err != nil { 4173 result.Response = autorest.Response{Response: resp} 4174 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationManifest", resp, "Failure sending request") 4175 return 4176 } 4177 4178 result, err = client.GetApplicationManifestResponder(resp) 4179 if err != nil { 4180 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationManifest", resp, "Failure responding to request") 4181 return 4182 } 4183 4184 return 4185} 4186 4187// GetApplicationManifestPreparer prepares the GetApplicationManifest request. 4188func (client BaseClient) GetApplicationManifestPreparer(ctx context.Context, applicationTypeName string, applicationTypeVersion string, timeout *int64) (*http.Request, error) { 4189 pathParameters := map[string]interface{}{ 4190 "applicationTypeName": autorest.Encode("path", applicationTypeName), 4191 } 4192 4193 const APIVersion = "6.0" 4194 queryParameters := map[string]interface{}{ 4195 "api-version": APIVersion, 4196 "ApplicationTypeVersion": autorest.Encode("query", applicationTypeVersion), 4197 } 4198 if timeout != nil { 4199 queryParameters["timeout"] = autorest.Encode("query", *timeout) 4200 } else { 4201 queryParameters["timeout"] = autorest.Encode("query", 60) 4202 } 4203 4204 preparer := autorest.CreatePreparer( 4205 autorest.AsGet(), 4206 autorest.WithBaseURL(client.BaseURI), 4207 autorest.WithPathParameters("/ApplicationTypes/{applicationTypeName}/$/GetApplicationManifest", pathParameters), 4208 autorest.WithQueryParameters(queryParameters)) 4209 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 4210} 4211 4212// GetApplicationManifestSender sends the GetApplicationManifest request. The method will close the 4213// http.Response Body if it receives an error. 4214func (client BaseClient) GetApplicationManifestSender(req *http.Request) (*http.Response, error) { 4215 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 4216} 4217 4218// GetApplicationManifestResponder handles the response to the GetApplicationManifest request. The method always 4219// closes the http.Response Body. 4220func (client BaseClient) GetApplicationManifestResponder(resp *http.Response) (result ApplicationTypeManifest, err error) { 4221 err = autorest.Respond( 4222 resp, 4223 azure.WithErrorUnlessStatusCode(http.StatusOK), 4224 autorest.ByUnmarshallingJSON(&result), 4225 autorest.ByClosing()) 4226 result.Response = autorest.Response{Response: resp} 4227 return 4228} 4229 4230// GetApplicationNameInfo gets the name of the application for the specified service. A 404 4231// FABRIC_E_SERVICE_DOES_NOT_EXIST error is returned if a service with the provided service ID does not exist. 4232// Parameters: 4233// serviceID - the identity of the service. This ID is typically the full name of the service without the 4234// 'fabric:' URI scheme. 4235// Starting from version 6.0, hierarchical names are delimited with the "~" character. 4236// For example, if the service name is "fabric:/myapp/app1/svc1", the service identity would be 4237// "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in previous versions. 4238// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 4239// duration that the client is willing to wait for the requested operation to complete. The default value for 4240// this parameter is 60 seconds. 4241func (client BaseClient) GetApplicationNameInfo(ctx context.Context, serviceID string, timeout *int64) (result ApplicationNameInfo, err error) { 4242 if tracing.IsEnabled() { 4243 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetApplicationNameInfo") 4244 defer func() { 4245 sc := -1 4246 if result.Response.Response != nil { 4247 sc = result.Response.Response.StatusCode 4248 } 4249 tracing.EndSpan(ctx, sc, err) 4250 }() 4251 } 4252 if err := validation.Validate([]validation.Validation{ 4253 {TargetValue: timeout, 4254 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 4255 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 4256 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 4257 }}}}}); err != nil { 4258 return result, validation.NewError("servicefabric.BaseClient", "GetApplicationNameInfo", err.Error()) 4259 } 4260 4261 req, err := client.GetApplicationNameInfoPreparer(ctx, serviceID, timeout) 4262 if err != nil { 4263 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationNameInfo", nil, "Failure preparing request") 4264 return 4265 } 4266 4267 resp, err := client.GetApplicationNameInfoSender(req) 4268 if err != nil { 4269 result.Response = autorest.Response{Response: resp} 4270 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationNameInfo", resp, "Failure sending request") 4271 return 4272 } 4273 4274 result, err = client.GetApplicationNameInfoResponder(resp) 4275 if err != nil { 4276 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationNameInfo", resp, "Failure responding to request") 4277 return 4278 } 4279 4280 return 4281} 4282 4283// GetApplicationNameInfoPreparer prepares the GetApplicationNameInfo request. 4284func (client BaseClient) GetApplicationNameInfoPreparer(ctx context.Context, serviceID string, timeout *int64) (*http.Request, error) { 4285 pathParameters := map[string]interface{}{ 4286 "serviceId": serviceID, 4287 } 4288 4289 const APIVersion = "6.0" 4290 queryParameters := map[string]interface{}{ 4291 "api-version": APIVersion, 4292 } 4293 if timeout != nil { 4294 queryParameters["timeout"] = autorest.Encode("query", *timeout) 4295 } else { 4296 queryParameters["timeout"] = autorest.Encode("query", 60) 4297 } 4298 4299 preparer := autorest.CreatePreparer( 4300 autorest.AsGet(), 4301 autorest.WithBaseURL(client.BaseURI), 4302 autorest.WithPathParameters("/Services/{serviceId}/$/GetApplicationName", pathParameters), 4303 autorest.WithQueryParameters(queryParameters)) 4304 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 4305} 4306 4307// GetApplicationNameInfoSender sends the GetApplicationNameInfo request. The method will close the 4308// http.Response Body if it receives an error. 4309func (client BaseClient) GetApplicationNameInfoSender(req *http.Request) (*http.Response, error) { 4310 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 4311} 4312 4313// GetApplicationNameInfoResponder handles the response to the GetApplicationNameInfo request. The method always 4314// closes the http.Response Body. 4315func (client BaseClient) GetApplicationNameInfoResponder(resp *http.Response) (result ApplicationNameInfo, err error) { 4316 err = autorest.Respond( 4317 resp, 4318 azure.WithErrorUnlessStatusCode(http.StatusOK), 4319 autorest.ByUnmarshallingJSON(&result), 4320 autorest.ByClosing()) 4321 result.Response = autorest.Response{Response: resp} 4322 return 4323} 4324 4325// GetApplicationsEventList the response is list of ApplicationEvent objects. 4326// Parameters: 4327// startTimeUtc - the start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. 4328// endTimeUtc - the end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. 4329// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 4330// duration that the client is willing to wait for the requested operation to complete. The default value for 4331// this parameter is 60 seconds. 4332// eventsTypesFilter - this is a comma separated string specifying the types of FabricEvents that should only 4333// be included in the response. 4334// excludeAnalysisEvents - this param disables the retrieval of AnalysisEvents if true is passed. 4335// skipCorrelationLookup - this param disables the search of CorrelatedEvents information if true is passed. 4336// otherwise the CorrelationEvents get processed and HasCorrelatedEvents field in every FabricEvent gets 4337// populated. 4338func (client BaseClient) GetApplicationsEventList(ctx context.Context, startTimeUtc string, endTimeUtc string, timeout *int64, eventsTypesFilter string, excludeAnalysisEvents *bool, skipCorrelationLookup *bool) (result ListApplicationEvent, err error) { 4339 if tracing.IsEnabled() { 4340 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetApplicationsEventList") 4341 defer func() { 4342 sc := -1 4343 if result.Response.Response != nil { 4344 sc = result.Response.Response.StatusCode 4345 } 4346 tracing.EndSpan(ctx, sc, err) 4347 }() 4348 } 4349 if err := validation.Validate([]validation.Validation{ 4350 {TargetValue: timeout, 4351 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 4352 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 4353 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 4354 }}}}}); err != nil { 4355 return result, validation.NewError("servicefabric.BaseClient", "GetApplicationsEventList", err.Error()) 4356 } 4357 4358 req, err := client.GetApplicationsEventListPreparer(ctx, startTimeUtc, endTimeUtc, timeout, eventsTypesFilter, excludeAnalysisEvents, skipCorrelationLookup) 4359 if err != nil { 4360 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationsEventList", nil, "Failure preparing request") 4361 return 4362 } 4363 4364 resp, err := client.GetApplicationsEventListSender(req) 4365 if err != nil { 4366 result.Response = autorest.Response{Response: resp} 4367 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationsEventList", resp, "Failure sending request") 4368 return 4369 } 4370 4371 result, err = client.GetApplicationsEventListResponder(resp) 4372 if err != nil { 4373 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationsEventList", resp, "Failure responding to request") 4374 return 4375 } 4376 4377 return 4378} 4379 4380// GetApplicationsEventListPreparer prepares the GetApplicationsEventList request. 4381func (client BaseClient) GetApplicationsEventListPreparer(ctx context.Context, startTimeUtc string, endTimeUtc string, timeout *int64, eventsTypesFilter string, excludeAnalysisEvents *bool, skipCorrelationLookup *bool) (*http.Request, error) { 4382 const APIVersion = "6.4" 4383 queryParameters := map[string]interface{}{ 4384 "api-version": APIVersion, 4385 "EndTimeUtc": autorest.Encode("query", endTimeUtc), 4386 "StartTimeUtc": autorest.Encode("query", startTimeUtc), 4387 } 4388 if timeout != nil { 4389 queryParameters["timeout"] = autorest.Encode("query", *timeout) 4390 } else { 4391 queryParameters["timeout"] = autorest.Encode("query", 60) 4392 } 4393 if len(eventsTypesFilter) > 0 { 4394 queryParameters["EventsTypesFilter"] = autorest.Encode("query", eventsTypesFilter) 4395 } 4396 if excludeAnalysisEvents != nil { 4397 queryParameters["ExcludeAnalysisEvents"] = autorest.Encode("query", *excludeAnalysisEvents) 4398 } 4399 if skipCorrelationLookup != nil { 4400 queryParameters["SkipCorrelationLookup"] = autorest.Encode("query", *skipCorrelationLookup) 4401 } 4402 4403 preparer := autorest.CreatePreparer( 4404 autorest.AsGet(), 4405 autorest.WithBaseURL(client.BaseURI), 4406 autorest.WithPath("/EventsStore/Applications/Events"), 4407 autorest.WithQueryParameters(queryParameters)) 4408 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 4409} 4410 4411// GetApplicationsEventListSender sends the GetApplicationsEventList request. The method will close the 4412// http.Response Body if it receives an error. 4413func (client BaseClient) GetApplicationsEventListSender(req *http.Request) (*http.Response, error) { 4414 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 4415} 4416 4417// GetApplicationsEventListResponder handles the response to the GetApplicationsEventList request. The method always 4418// closes the http.Response Body. 4419func (client BaseClient) GetApplicationsEventListResponder(resp *http.Response) (result ListApplicationEvent, err error) { 4420 err = autorest.Respond( 4421 resp, 4422 azure.WithErrorUnlessStatusCode(http.StatusOK), 4423 autorest.ByUnmarshallingJSON(&result), 4424 autorest.ByClosing()) 4425 result.Response = autorest.Response{Response: resp} 4426 return 4427} 4428 4429// GetApplicationTypeInfoList returns the information about the application types that are provisioned or in the 4430// process of being provisioned in the Service Fabric cluster. Each version of an application type is returned as one 4431// application type. The response includes the name, version, status, and other details about the application type. 4432// This is a paged query, meaning that if not all of the application types fit in a page, one page of results is 4433// returned as well as a continuation token, which can be used to get the next page. For example, if there are 10 4434// application types but a page only fits the first three application types, or if max results is set to 3, then three 4435// is returned. To access the rest of the results, retrieve subsequent pages by using the returned continuation token 4436// in the next query. An empty continuation token is returned if there are no subsequent pages. 4437// Parameters: 4438// applicationTypeDefinitionKindFilter - used to filter on ApplicationTypeDefinitionKind which is the mechanism 4439// used to define a Service Fabric application type. 4440// - Default - Default value, which performs the same function as selecting "All". The value is 0. 4441// - All - Filter that matches input with any ApplicationTypeDefinitionKind value. The value is 65535. 4442// - ServiceFabricApplicationPackage - Filter that matches input with ApplicationTypeDefinitionKind value 4443// ServiceFabricApplicationPackage. The value is 1. 4444// - Compose - Filter that matches input with ApplicationTypeDefinitionKind value Compose. The value is 2. 4445// excludeApplicationParameters - the flag that specifies whether application parameters will be excluded from 4446// the result. 4447// continuationToken - the continuation token parameter is used to obtain next set of results. A continuation 4448// token with a non-empty value is included in the response of the API when the results from the system do not 4449// fit in a single response. When this value is passed to the next API call, the API returns next set of 4450// results. If there are no further results, then the continuation token does not contain a value. The value of 4451// this parameter should not be URL encoded. 4452// maxResults - the maximum number of results to be returned as part of the paged queries. This parameter 4453// defines the upper bound on the number of results returned. The results returned can be less than the 4454// specified maximum results if they do not fit in the message as per the max message size restrictions defined 4455// in the configuration. If this parameter is zero or not specified, the paged query includes as many results 4456// as possible that fit in the return message. 4457// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 4458// duration that the client is willing to wait for the requested operation to complete. The default value for 4459// this parameter is 60 seconds. 4460func (client BaseClient) GetApplicationTypeInfoList(ctx context.Context, applicationTypeDefinitionKindFilter *int32, excludeApplicationParameters *bool, continuationToken string, maxResults *int64, timeout *int64) (result PagedApplicationTypeInfoList, err error) { 4461 if tracing.IsEnabled() { 4462 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetApplicationTypeInfoList") 4463 defer func() { 4464 sc := -1 4465 if result.Response.Response != nil { 4466 sc = result.Response.Response.StatusCode 4467 } 4468 tracing.EndSpan(ctx, sc, err) 4469 }() 4470 } 4471 if err := validation.Validate([]validation.Validation{ 4472 {TargetValue: maxResults, 4473 Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false, 4474 Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}}}}}, 4475 {TargetValue: timeout, 4476 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 4477 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 4478 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 4479 }}}}}); err != nil { 4480 return result, validation.NewError("servicefabric.BaseClient", "GetApplicationTypeInfoList", err.Error()) 4481 } 4482 4483 req, err := client.GetApplicationTypeInfoListPreparer(ctx, applicationTypeDefinitionKindFilter, excludeApplicationParameters, continuationToken, maxResults, timeout) 4484 if err != nil { 4485 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationTypeInfoList", nil, "Failure preparing request") 4486 return 4487 } 4488 4489 resp, err := client.GetApplicationTypeInfoListSender(req) 4490 if err != nil { 4491 result.Response = autorest.Response{Response: resp} 4492 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationTypeInfoList", resp, "Failure sending request") 4493 return 4494 } 4495 4496 result, err = client.GetApplicationTypeInfoListResponder(resp) 4497 if err != nil { 4498 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationTypeInfoList", resp, "Failure responding to request") 4499 return 4500 } 4501 4502 return 4503} 4504 4505// GetApplicationTypeInfoListPreparer prepares the GetApplicationTypeInfoList request. 4506func (client BaseClient) GetApplicationTypeInfoListPreparer(ctx context.Context, applicationTypeDefinitionKindFilter *int32, excludeApplicationParameters *bool, continuationToken string, maxResults *int64, timeout *int64) (*http.Request, error) { 4507 const APIVersion = "6.0" 4508 queryParameters := map[string]interface{}{ 4509 "api-version": APIVersion, 4510 } 4511 if applicationTypeDefinitionKindFilter != nil { 4512 queryParameters["ApplicationTypeDefinitionKindFilter"] = autorest.Encode("query", *applicationTypeDefinitionKindFilter) 4513 } else { 4514 queryParameters["ApplicationTypeDefinitionKindFilter"] = autorest.Encode("query", 0) 4515 } 4516 if excludeApplicationParameters != nil { 4517 queryParameters["ExcludeApplicationParameters"] = autorest.Encode("query", *excludeApplicationParameters) 4518 } else { 4519 queryParameters["ExcludeApplicationParameters"] = autorest.Encode("query", false) 4520 } 4521 if len(continuationToken) > 0 { 4522 queryParameters["ContinuationToken"] = continuationToken 4523 } 4524 if maxResults != nil { 4525 queryParameters["MaxResults"] = autorest.Encode("query", *maxResults) 4526 } else { 4527 queryParameters["MaxResults"] = autorest.Encode("query", 0) 4528 } 4529 if timeout != nil { 4530 queryParameters["timeout"] = autorest.Encode("query", *timeout) 4531 } else { 4532 queryParameters["timeout"] = autorest.Encode("query", 60) 4533 } 4534 4535 preparer := autorest.CreatePreparer( 4536 autorest.AsGet(), 4537 autorest.WithBaseURL(client.BaseURI), 4538 autorest.WithPath("/ApplicationTypes"), 4539 autorest.WithQueryParameters(queryParameters)) 4540 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 4541} 4542 4543// GetApplicationTypeInfoListSender sends the GetApplicationTypeInfoList request. The method will close the 4544// http.Response Body if it receives an error. 4545func (client BaseClient) GetApplicationTypeInfoListSender(req *http.Request) (*http.Response, error) { 4546 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 4547} 4548 4549// GetApplicationTypeInfoListResponder handles the response to the GetApplicationTypeInfoList request. The method always 4550// closes the http.Response Body. 4551func (client BaseClient) GetApplicationTypeInfoListResponder(resp *http.Response) (result PagedApplicationTypeInfoList, err error) { 4552 err = autorest.Respond( 4553 resp, 4554 azure.WithErrorUnlessStatusCode(http.StatusOK), 4555 autorest.ByUnmarshallingJSON(&result), 4556 autorest.ByClosing()) 4557 result.Response = autorest.Response{Response: resp} 4558 return 4559} 4560 4561// GetApplicationTypeInfoListByName returns the information about the application types that are provisioned or in the 4562// process of being provisioned in the Service Fabric cluster. These results are of application types whose name match 4563// exactly the one specified as the parameter, and which comply with the given query parameters. All versions of the 4564// application type matching the application type name are returned, with each version returned as one application 4565// type. The response includes the name, version, status, and other details about the application type. This is a paged 4566// query, meaning that if not all of the application types fit in a page, one page of results is returned as well as a 4567// continuation token, which can be used to get the next page. For example, if there are 10 application types but a 4568// page only fits the first three application types, or if max results is set to 3, then three is returned. To access 4569// the rest of the results, retrieve subsequent pages by using the returned continuation token in the next query. An 4570// empty continuation token is returned if there are no subsequent pages. 4571// Parameters: 4572// applicationTypeName - the name of the application type. 4573// applicationTypeVersion - the version of the application type. 4574// excludeApplicationParameters - the flag that specifies whether application parameters will be excluded from 4575// the result. 4576// continuationToken - the continuation token parameter is used to obtain next set of results. A continuation 4577// token with a non-empty value is included in the response of the API when the results from the system do not 4578// fit in a single response. When this value is passed to the next API call, the API returns next set of 4579// results. If there are no further results, then the continuation token does not contain a value. The value of 4580// this parameter should not be URL encoded. 4581// maxResults - the maximum number of results to be returned as part of the paged queries. This parameter 4582// defines the upper bound on the number of results returned. The results returned can be less than the 4583// specified maximum results if they do not fit in the message as per the max message size restrictions defined 4584// in the configuration. If this parameter is zero or not specified, the paged query includes as many results 4585// as possible that fit in the return message. 4586// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 4587// duration that the client is willing to wait for the requested operation to complete. The default value for 4588// this parameter is 60 seconds. 4589func (client BaseClient) GetApplicationTypeInfoListByName(ctx context.Context, applicationTypeName string, applicationTypeVersion string, excludeApplicationParameters *bool, continuationToken string, maxResults *int64, timeout *int64) (result PagedApplicationTypeInfoList, err error) { 4590 if tracing.IsEnabled() { 4591 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetApplicationTypeInfoListByName") 4592 defer func() { 4593 sc := -1 4594 if result.Response.Response != nil { 4595 sc = result.Response.Response.StatusCode 4596 } 4597 tracing.EndSpan(ctx, sc, err) 4598 }() 4599 } 4600 if err := validation.Validate([]validation.Validation{ 4601 {TargetValue: maxResults, 4602 Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false, 4603 Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}}}}}, 4604 {TargetValue: timeout, 4605 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 4606 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 4607 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 4608 }}}}}); err != nil { 4609 return result, validation.NewError("servicefabric.BaseClient", "GetApplicationTypeInfoListByName", err.Error()) 4610 } 4611 4612 req, err := client.GetApplicationTypeInfoListByNamePreparer(ctx, applicationTypeName, applicationTypeVersion, excludeApplicationParameters, continuationToken, maxResults, timeout) 4613 if err != nil { 4614 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationTypeInfoListByName", nil, "Failure preparing request") 4615 return 4616 } 4617 4618 resp, err := client.GetApplicationTypeInfoListByNameSender(req) 4619 if err != nil { 4620 result.Response = autorest.Response{Response: resp} 4621 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationTypeInfoListByName", resp, "Failure sending request") 4622 return 4623 } 4624 4625 result, err = client.GetApplicationTypeInfoListByNameResponder(resp) 4626 if err != nil { 4627 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationTypeInfoListByName", resp, "Failure responding to request") 4628 return 4629 } 4630 4631 return 4632} 4633 4634// GetApplicationTypeInfoListByNamePreparer prepares the GetApplicationTypeInfoListByName request. 4635func (client BaseClient) GetApplicationTypeInfoListByNamePreparer(ctx context.Context, applicationTypeName string, applicationTypeVersion string, excludeApplicationParameters *bool, continuationToken string, maxResults *int64, timeout *int64) (*http.Request, error) { 4636 pathParameters := map[string]interface{}{ 4637 "applicationTypeName": autorest.Encode("path", applicationTypeName), 4638 } 4639 4640 const APIVersion = "6.0" 4641 queryParameters := map[string]interface{}{ 4642 "api-version": APIVersion, 4643 } 4644 if len(applicationTypeVersion) > 0 { 4645 queryParameters["ApplicationTypeVersion"] = autorest.Encode("query", applicationTypeVersion) 4646 } 4647 if excludeApplicationParameters != nil { 4648 queryParameters["ExcludeApplicationParameters"] = autorest.Encode("query", *excludeApplicationParameters) 4649 } else { 4650 queryParameters["ExcludeApplicationParameters"] = autorest.Encode("query", false) 4651 } 4652 if len(continuationToken) > 0 { 4653 queryParameters["ContinuationToken"] = continuationToken 4654 } 4655 if maxResults != nil { 4656 queryParameters["MaxResults"] = autorest.Encode("query", *maxResults) 4657 } else { 4658 queryParameters["MaxResults"] = autorest.Encode("query", 0) 4659 } 4660 if timeout != nil { 4661 queryParameters["timeout"] = autorest.Encode("query", *timeout) 4662 } else { 4663 queryParameters["timeout"] = autorest.Encode("query", 60) 4664 } 4665 4666 preparer := autorest.CreatePreparer( 4667 autorest.AsGet(), 4668 autorest.WithBaseURL(client.BaseURI), 4669 autorest.WithPathParameters("/ApplicationTypes/{applicationTypeName}", pathParameters), 4670 autorest.WithQueryParameters(queryParameters)) 4671 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 4672} 4673 4674// GetApplicationTypeInfoListByNameSender sends the GetApplicationTypeInfoListByName request. The method will close the 4675// http.Response Body if it receives an error. 4676func (client BaseClient) GetApplicationTypeInfoListByNameSender(req *http.Request) (*http.Response, error) { 4677 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 4678} 4679 4680// GetApplicationTypeInfoListByNameResponder handles the response to the GetApplicationTypeInfoListByName request. The method always 4681// closes the http.Response Body. 4682func (client BaseClient) GetApplicationTypeInfoListByNameResponder(resp *http.Response) (result PagedApplicationTypeInfoList, err error) { 4683 err = autorest.Respond( 4684 resp, 4685 azure.WithErrorUnlessStatusCode(http.StatusOK), 4686 autorest.ByUnmarshallingJSON(&result), 4687 autorest.ByClosing()) 4688 result.Response = autorest.Response{Response: resp} 4689 return 4690} 4691 4692// GetApplicationUpgrade returns information about the state of the latest application upgrade along with details to 4693// aid debugging application health issues. 4694// Parameters: 4695// applicationID - the identity of the application. This is typically the full name of the application without 4696// the 'fabric:' URI scheme. 4697// Starting from version 6.0, hierarchical names are delimited with the "~" character. 4698// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" 4699// in 6.0+ and "myapp/app1" in previous versions. 4700// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 4701// duration that the client is willing to wait for the requested operation to complete. The default value for 4702// this parameter is 60 seconds. 4703func (client BaseClient) GetApplicationUpgrade(ctx context.Context, applicationID string, timeout *int64) (result ApplicationUpgradeProgressInfo, err error) { 4704 if tracing.IsEnabled() { 4705 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetApplicationUpgrade") 4706 defer func() { 4707 sc := -1 4708 if result.Response.Response != nil { 4709 sc = result.Response.Response.StatusCode 4710 } 4711 tracing.EndSpan(ctx, sc, err) 4712 }() 4713 } 4714 if err := validation.Validate([]validation.Validation{ 4715 {TargetValue: timeout, 4716 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 4717 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 4718 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 4719 }}}}}); err != nil { 4720 return result, validation.NewError("servicefabric.BaseClient", "GetApplicationUpgrade", err.Error()) 4721 } 4722 4723 req, err := client.GetApplicationUpgradePreparer(ctx, applicationID, timeout) 4724 if err != nil { 4725 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationUpgrade", nil, "Failure preparing request") 4726 return 4727 } 4728 4729 resp, err := client.GetApplicationUpgradeSender(req) 4730 if err != nil { 4731 result.Response = autorest.Response{Response: resp} 4732 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationUpgrade", resp, "Failure sending request") 4733 return 4734 } 4735 4736 result, err = client.GetApplicationUpgradeResponder(resp) 4737 if err != nil { 4738 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetApplicationUpgrade", resp, "Failure responding to request") 4739 return 4740 } 4741 4742 return 4743} 4744 4745// GetApplicationUpgradePreparer prepares the GetApplicationUpgrade request. 4746func (client BaseClient) GetApplicationUpgradePreparer(ctx context.Context, applicationID string, timeout *int64) (*http.Request, error) { 4747 pathParameters := map[string]interface{}{ 4748 "applicationId": applicationID, 4749 } 4750 4751 const APIVersion = "6.0" 4752 queryParameters := map[string]interface{}{ 4753 "api-version": APIVersion, 4754 } 4755 if timeout != nil { 4756 queryParameters["timeout"] = autorest.Encode("query", *timeout) 4757 } else { 4758 queryParameters["timeout"] = autorest.Encode("query", 60) 4759 } 4760 4761 preparer := autorest.CreatePreparer( 4762 autorest.AsGet(), 4763 autorest.WithBaseURL(client.BaseURI), 4764 autorest.WithPathParameters("/Applications/{applicationId}/$/GetUpgradeProgress", pathParameters), 4765 autorest.WithQueryParameters(queryParameters)) 4766 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 4767} 4768 4769// GetApplicationUpgradeSender sends the GetApplicationUpgrade request. The method will close the 4770// http.Response Body if it receives an error. 4771func (client BaseClient) GetApplicationUpgradeSender(req *http.Request) (*http.Response, error) { 4772 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 4773} 4774 4775// GetApplicationUpgradeResponder handles the response to the GetApplicationUpgrade request. The method always 4776// closes the http.Response Body. 4777func (client BaseClient) GetApplicationUpgradeResponder(resp *http.Response) (result ApplicationUpgradeProgressInfo, err error) { 4778 err = autorest.Respond( 4779 resp, 4780 azure.WithErrorUnlessStatusCode(http.StatusOK), 4781 autorest.ByUnmarshallingJSON(&result), 4782 autorest.ByClosing()) 4783 result.Response = autorest.Response{Response: resp} 4784 return 4785} 4786 4787// GetBackupPolicyByName gets a particular backup policy identified by {backupPolicyName} 4788// Parameters: 4789// backupPolicyName - the name of the backup policy. 4790// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 4791// duration that the client is willing to wait for the requested operation to complete. The default value for 4792// this parameter is 60 seconds. 4793func (client BaseClient) GetBackupPolicyByName(ctx context.Context, backupPolicyName string, timeout *int64) (result BackupPolicyDescription, err error) { 4794 if tracing.IsEnabled() { 4795 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetBackupPolicyByName") 4796 defer func() { 4797 sc := -1 4798 if result.Response.Response != nil { 4799 sc = result.Response.Response.StatusCode 4800 } 4801 tracing.EndSpan(ctx, sc, err) 4802 }() 4803 } 4804 if err := validation.Validate([]validation.Validation{ 4805 {TargetValue: timeout, 4806 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 4807 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 4808 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 4809 }}}}}); err != nil { 4810 return result, validation.NewError("servicefabric.BaseClient", "GetBackupPolicyByName", err.Error()) 4811 } 4812 4813 req, err := client.GetBackupPolicyByNamePreparer(ctx, backupPolicyName, timeout) 4814 if err != nil { 4815 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetBackupPolicyByName", nil, "Failure preparing request") 4816 return 4817 } 4818 4819 resp, err := client.GetBackupPolicyByNameSender(req) 4820 if err != nil { 4821 result.Response = autorest.Response{Response: resp} 4822 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetBackupPolicyByName", resp, "Failure sending request") 4823 return 4824 } 4825 4826 result, err = client.GetBackupPolicyByNameResponder(resp) 4827 if err != nil { 4828 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetBackupPolicyByName", resp, "Failure responding to request") 4829 return 4830 } 4831 4832 return 4833} 4834 4835// GetBackupPolicyByNamePreparer prepares the GetBackupPolicyByName request. 4836func (client BaseClient) GetBackupPolicyByNamePreparer(ctx context.Context, backupPolicyName string, timeout *int64) (*http.Request, error) { 4837 pathParameters := map[string]interface{}{ 4838 "backupPolicyName": autorest.Encode("path", backupPolicyName), 4839 } 4840 4841 const APIVersion = "6.4" 4842 queryParameters := map[string]interface{}{ 4843 "api-version": APIVersion, 4844 } 4845 if timeout != nil { 4846 queryParameters["timeout"] = autorest.Encode("query", *timeout) 4847 } else { 4848 queryParameters["timeout"] = autorest.Encode("query", 60) 4849 } 4850 4851 preparer := autorest.CreatePreparer( 4852 autorest.AsGet(), 4853 autorest.WithBaseURL(client.BaseURI), 4854 autorest.WithPathParameters("/BackupRestore/BackupPolicies/{backupPolicyName}", pathParameters), 4855 autorest.WithQueryParameters(queryParameters)) 4856 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 4857} 4858 4859// GetBackupPolicyByNameSender sends the GetBackupPolicyByName request. The method will close the 4860// http.Response Body if it receives an error. 4861func (client BaseClient) GetBackupPolicyByNameSender(req *http.Request) (*http.Response, error) { 4862 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 4863} 4864 4865// GetBackupPolicyByNameResponder handles the response to the GetBackupPolicyByName request. The method always 4866// closes the http.Response Body. 4867func (client BaseClient) GetBackupPolicyByNameResponder(resp *http.Response) (result BackupPolicyDescription, err error) { 4868 err = autorest.Respond( 4869 resp, 4870 azure.WithErrorUnlessStatusCode(http.StatusOK), 4871 autorest.ByUnmarshallingJSON(&result), 4872 autorest.ByClosing()) 4873 result.Response = autorest.Response{Response: resp} 4874 return 4875} 4876 4877// GetBackupPolicyList get a list of all the backup policies configured. 4878// Parameters: 4879// continuationToken - the continuation token parameter is used to obtain next set of results. A continuation 4880// token with a non-empty value is included in the response of the API when the results from the system do not 4881// fit in a single response. When this value is passed to the next API call, the API returns next set of 4882// results. If there are no further results, then the continuation token does not contain a value. The value of 4883// this parameter should not be URL encoded. 4884// maxResults - the maximum number of results to be returned as part of the paged queries. This parameter 4885// defines the upper bound on the number of results returned. The results returned can be less than the 4886// specified maximum results if they do not fit in the message as per the max message size restrictions defined 4887// in the configuration. If this parameter is zero or not specified, the paged query includes as many results 4888// as possible that fit in the return message. 4889// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 4890// duration that the client is willing to wait for the requested operation to complete. The default value for 4891// this parameter is 60 seconds. 4892func (client BaseClient) GetBackupPolicyList(ctx context.Context, continuationToken string, maxResults *int64, timeout *int64) (result PagedBackupPolicyDescriptionList, err error) { 4893 if tracing.IsEnabled() { 4894 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetBackupPolicyList") 4895 defer func() { 4896 sc := -1 4897 if result.Response.Response != nil { 4898 sc = result.Response.Response.StatusCode 4899 } 4900 tracing.EndSpan(ctx, sc, err) 4901 }() 4902 } 4903 if err := validation.Validate([]validation.Validation{ 4904 {TargetValue: maxResults, 4905 Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false, 4906 Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}}}}}, 4907 {TargetValue: timeout, 4908 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 4909 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 4910 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 4911 }}}}}); err != nil { 4912 return result, validation.NewError("servicefabric.BaseClient", "GetBackupPolicyList", err.Error()) 4913 } 4914 4915 req, err := client.GetBackupPolicyListPreparer(ctx, continuationToken, maxResults, timeout) 4916 if err != nil { 4917 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetBackupPolicyList", nil, "Failure preparing request") 4918 return 4919 } 4920 4921 resp, err := client.GetBackupPolicyListSender(req) 4922 if err != nil { 4923 result.Response = autorest.Response{Response: resp} 4924 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetBackupPolicyList", resp, "Failure sending request") 4925 return 4926 } 4927 4928 result, err = client.GetBackupPolicyListResponder(resp) 4929 if err != nil { 4930 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetBackupPolicyList", resp, "Failure responding to request") 4931 return 4932 } 4933 4934 return 4935} 4936 4937// GetBackupPolicyListPreparer prepares the GetBackupPolicyList request. 4938func (client BaseClient) GetBackupPolicyListPreparer(ctx context.Context, continuationToken string, maxResults *int64, timeout *int64) (*http.Request, error) { 4939 const APIVersion = "6.4" 4940 queryParameters := map[string]interface{}{ 4941 "api-version": APIVersion, 4942 } 4943 if len(continuationToken) > 0 { 4944 queryParameters["ContinuationToken"] = continuationToken 4945 } 4946 if maxResults != nil { 4947 queryParameters["MaxResults"] = autorest.Encode("query", *maxResults) 4948 } else { 4949 queryParameters["MaxResults"] = autorest.Encode("query", 0) 4950 } 4951 if timeout != nil { 4952 queryParameters["timeout"] = autorest.Encode("query", *timeout) 4953 } else { 4954 queryParameters["timeout"] = autorest.Encode("query", 60) 4955 } 4956 4957 preparer := autorest.CreatePreparer( 4958 autorest.AsGet(), 4959 autorest.WithBaseURL(client.BaseURI), 4960 autorest.WithPath("/BackupRestore/BackupPolicies"), 4961 autorest.WithQueryParameters(queryParameters)) 4962 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 4963} 4964 4965// GetBackupPolicyListSender sends the GetBackupPolicyList request. The method will close the 4966// http.Response Body if it receives an error. 4967func (client BaseClient) GetBackupPolicyListSender(req *http.Request) (*http.Response, error) { 4968 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 4969} 4970 4971// GetBackupPolicyListResponder handles the response to the GetBackupPolicyList request. The method always 4972// closes the http.Response Body. 4973func (client BaseClient) GetBackupPolicyListResponder(resp *http.Response) (result PagedBackupPolicyDescriptionList, err error) { 4974 err = autorest.Respond( 4975 resp, 4976 azure.WithErrorUnlessStatusCode(http.StatusOK), 4977 autorest.ByUnmarshallingJSON(&result), 4978 autorest.ByClosing()) 4979 result.Response = autorest.Response{Response: resp} 4980 return 4981} 4982 4983// GetBackupsFromBackupLocation gets the list of backups available for the specified backed up entity (Application, 4984// Service or Partition) at the specified backup location (FileShare or Azure Blob Storage). 4985// Parameters: 4986// getBackupByStorageQueryDescription - describes the filters and backup storage details to be used for 4987// enumerating backups. 4988// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 4989// duration that the client is willing to wait for the requested operation to complete. The default value for 4990// this parameter is 60 seconds. 4991// continuationToken - the continuation token parameter is used to obtain next set of results. A continuation 4992// token with a non-empty value is included in the response of the API when the results from the system do not 4993// fit in a single response. When this value is passed to the next API call, the API returns next set of 4994// results. If there are no further results, then the continuation token does not contain a value. The value of 4995// this parameter should not be URL encoded. 4996// maxResults - the maximum number of results to be returned as part of the paged queries. This parameter 4997// defines the upper bound on the number of results returned. The results returned can be less than the 4998// specified maximum results if they do not fit in the message as per the max message size restrictions defined 4999// in the configuration. If this parameter is zero or not specified, the paged query includes as many results 5000// as possible that fit in the return message. 5001func (client BaseClient) GetBackupsFromBackupLocation(ctx context.Context, getBackupByStorageQueryDescription GetBackupByStorageQueryDescription, timeout *int64, continuationToken string, maxResults *int64) (result PagedBackupInfoList, err error) { 5002 if tracing.IsEnabled() { 5003 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetBackupsFromBackupLocation") 5004 defer func() { 5005 sc := -1 5006 if result.Response.Response != nil { 5007 sc = result.Response.Response.StatusCode 5008 } 5009 tracing.EndSpan(ctx, sc, err) 5010 }() 5011 } 5012 if err := validation.Validate([]validation.Validation{ 5013 {TargetValue: timeout, 5014 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 5015 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 5016 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 5017 }}}}, 5018 {TargetValue: maxResults, 5019 Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false, 5020 Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}}}}}}); err != nil { 5021 return result, validation.NewError("servicefabric.BaseClient", "GetBackupsFromBackupLocation", err.Error()) 5022 } 5023 5024 req, err := client.GetBackupsFromBackupLocationPreparer(ctx, getBackupByStorageQueryDescription, timeout, continuationToken, maxResults) 5025 if err != nil { 5026 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetBackupsFromBackupLocation", nil, "Failure preparing request") 5027 return 5028 } 5029 5030 resp, err := client.GetBackupsFromBackupLocationSender(req) 5031 if err != nil { 5032 result.Response = autorest.Response{Response: resp} 5033 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetBackupsFromBackupLocation", resp, "Failure sending request") 5034 return 5035 } 5036 5037 result, err = client.GetBackupsFromBackupLocationResponder(resp) 5038 if err != nil { 5039 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetBackupsFromBackupLocation", resp, "Failure responding to request") 5040 return 5041 } 5042 5043 return 5044} 5045 5046// GetBackupsFromBackupLocationPreparer prepares the GetBackupsFromBackupLocation request. 5047func (client BaseClient) GetBackupsFromBackupLocationPreparer(ctx context.Context, getBackupByStorageQueryDescription GetBackupByStorageQueryDescription, timeout *int64, continuationToken string, maxResults *int64) (*http.Request, error) { 5048 const APIVersion = "6.4" 5049 queryParameters := map[string]interface{}{ 5050 "api-version": APIVersion, 5051 } 5052 if timeout != nil { 5053 queryParameters["timeout"] = autorest.Encode("query", *timeout) 5054 } else { 5055 queryParameters["timeout"] = autorest.Encode("query", 60) 5056 } 5057 if len(continuationToken) > 0 { 5058 queryParameters["ContinuationToken"] = continuationToken 5059 } 5060 if maxResults != nil { 5061 queryParameters["MaxResults"] = autorest.Encode("query", *maxResults) 5062 } else { 5063 queryParameters["MaxResults"] = autorest.Encode("query", 0) 5064 } 5065 5066 preparer := autorest.CreatePreparer( 5067 autorest.AsContentType("application/json; charset=utf-8"), 5068 autorest.AsPost(), 5069 autorest.WithBaseURL(client.BaseURI), 5070 autorest.WithPath("/BackupRestore/$/GetBackups"), 5071 autorest.WithJSON(getBackupByStorageQueryDescription), 5072 autorest.WithQueryParameters(queryParameters)) 5073 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 5074} 5075 5076// GetBackupsFromBackupLocationSender sends the GetBackupsFromBackupLocation request. The method will close the 5077// http.Response Body if it receives an error. 5078func (client BaseClient) GetBackupsFromBackupLocationSender(req *http.Request) (*http.Response, error) { 5079 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 5080} 5081 5082// GetBackupsFromBackupLocationResponder handles the response to the GetBackupsFromBackupLocation request. The method always 5083// closes the http.Response Body. 5084func (client BaseClient) GetBackupsFromBackupLocationResponder(resp *http.Response) (result PagedBackupInfoList, err error) { 5085 err = autorest.Respond( 5086 resp, 5087 azure.WithErrorUnlessStatusCode(http.StatusOK), 5088 autorest.ByUnmarshallingJSON(&result), 5089 autorest.ByClosing()) 5090 result.Response = autorest.Response{Response: resp} 5091 return 5092} 5093 5094// GetChaos get the status of Chaos indicating whether or not Chaos is running, the Chaos parameters used for running 5095// Chaos and the status of the Chaos Schedule. 5096// Parameters: 5097// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 5098// duration that the client is willing to wait for the requested operation to complete. The default value for 5099// this parameter is 60 seconds. 5100func (client BaseClient) GetChaos(ctx context.Context, timeout *int64) (result Chaos, err error) { 5101 if tracing.IsEnabled() { 5102 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetChaos") 5103 defer func() { 5104 sc := -1 5105 if result.Response.Response != nil { 5106 sc = result.Response.Response.StatusCode 5107 } 5108 tracing.EndSpan(ctx, sc, err) 5109 }() 5110 } 5111 if err := validation.Validate([]validation.Validation{ 5112 {TargetValue: timeout, 5113 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 5114 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 5115 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 5116 }}}}}); err != nil { 5117 return result, validation.NewError("servicefabric.BaseClient", "GetChaos", err.Error()) 5118 } 5119 5120 req, err := client.GetChaosPreparer(ctx, timeout) 5121 if err != nil { 5122 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetChaos", nil, "Failure preparing request") 5123 return 5124 } 5125 5126 resp, err := client.GetChaosSender(req) 5127 if err != nil { 5128 result.Response = autorest.Response{Response: resp} 5129 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetChaos", resp, "Failure sending request") 5130 return 5131 } 5132 5133 result, err = client.GetChaosResponder(resp) 5134 if err != nil { 5135 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetChaos", resp, "Failure responding to request") 5136 return 5137 } 5138 5139 return 5140} 5141 5142// GetChaosPreparer prepares the GetChaos request. 5143func (client BaseClient) GetChaosPreparer(ctx context.Context, timeout *int64) (*http.Request, error) { 5144 const APIVersion = "6.2" 5145 queryParameters := map[string]interface{}{ 5146 "api-version": APIVersion, 5147 } 5148 if timeout != nil { 5149 queryParameters["timeout"] = autorest.Encode("query", *timeout) 5150 } else { 5151 queryParameters["timeout"] = autorest.Encode("query", 60) 5152 } 5153 5154 preparer := autorest.CreatePreparer( 5155 autorest.AsGet(), 5156 autorest.WithBaseURL(client.BaseURI), 5157 autorest.WithPath("/Tools/Chaos"), 5158 autorest.WithQueryParameters(queryParameters)) 5159 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 5160} 5161 5162// GetChaosSender sends the GetChaos request. The method will close the 5163// http.Response Body if it receives an error. 5164func (client BaseClient) GetChaosSender(req *http.Request) (*http.Response, error) { 5165 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 5166} 5167 5168// GetChaosResponder handles the response to the GetChaos request. The method always 5169// closes the http.Response Body. 5170func (client BaseClient) GetChaosResponder(resp *http.Response) (result Chaos, err error) { 5171 err = autorest.Respond( 5172 resp, 5173 azure.WithErrorUnlessStatusCode(http.StatusOK), 5174 autorest.ByUnmarshallingJSON(&result), 5175 autorest.ByClosing()) 5176 result.Response = autorest.Response{Response: resp} 5177 return 5178} 5179 5180// GetChaosEvents to get the next segment of the Chaos events, you can specify the ContinuationToken. To get the start 5181// of a new segment of Chaos events, you can specify the time range 5182// through StartTimeUtc and EndTimeUtc. You cannot specify both the ContinuationToken and the time range in the same 5183// call. 5184// When there are more than 100 Chaos events, the Chaos events are returned in multiple segments where a segment 5185// contains no more than 100 Chaos events and to get the next segment you make a call to this API with the continuation 5186// token. 5187// Parameters: 5188// continuationToken - the continuation token parameter is used to obtain next set of results. A continuation 5189// token with a non-empty value is included in the response of the API when the results from the system do not 5190// fit in a single response. When this value is passed to the next API call, the API returns next set of 5191// results. If there are no further results, then the continuation token does not contain a value. The value of 5192// this parameter should not be URL encoded. 5193// startTimeUtc - the Windows file time representing the start time of the time range for which a Chaos report 5194// is to be generated. Consult [DateTime.ToFileTimeUtc 5195// Method](https://msdn.microsoft.com/library/system.datetime.tofiletimeutc(v=vs.110).aspx) for details. 5196// endTimeUtc - the Windows file time representing the end time of the time range for which a Chaos report is 5197// to be generated. Consult [DateTime.ToFileTimeUtc 5198// Method](https://msdn.microsoft.com/library/system.datetime.tofiletimeutc(v=vs.110).aspx) for details. 5199// maxResults - the maximum number of results to be returned as part of the paged queries. This parameter 5200// defines the upper bound on the number of results returned. The results returned can be less than the 5201// specified maximum results if they do not fit in the message as per the max message size restrictions defined 5202// in the configuration. If this parameter is zero or not specified, the paged query includes as many results 5203// as possible that fit in the return message. 5204// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 5205// duration that the client is willing to wait for the requested operation to complete. The default value for 5206// this parameter is 60 seconds. 5207func (client BaseClient) GetChaosEvents(ctx context.Context, continuationToken string, startTimeUtc string, endTimeUtc string, maxResults *int64, timeout *int64) (result ChaosEventsSegment, err error) { 5208 if tracing.IsEnabled() { 5209 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetChaosEvents") 5210 defer func() { 5211 sc := -1 5212 if result.Response.Response != nil { 5213 sc = result.Response.Response.StatusCode 5214 } 5215 tracing.EndSpan(ctx, sc, err) 5216 }() 5217 } 5218 if err := validation.Validate([]validation.Validation{ 5219 {TargetValue: maxResults, 5220 Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false, 5221 Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}}}}}, 5222 {TargetValue: timeout, 5223 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 5224 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 5225 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 5226 }}}}}); err != nil { 5227 return result, validation.NewError("servicefabric.BaseClient", "GetChaosEvents", err.Error()) 5228 } 5229 5230 req, err := client.GetChaosEventsPreparer(ctx, continuationToken, startTimeUtc, endTimeUtc, maxResults, timeout) 5231 if err != nil { 5232 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetChaosEvents", nil, "Failure preparing request") 5233 return 5234 } 5235 5236 resp, err := client.GetChaosEventsSender(req) 5237 if err != nil { 5238 result.Response = autorest.Response{Response: resp} 5239 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetChaosEvents", resp, "Failure sending request") 5240 return 5241 } 5242 5243 result, err = client.GetChaosEventsResponder(resp) 5244 if err != nil { 5245 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetChaosEvents", resp, "Failure responding to request") 5246 return 5247 } 5248 5249 return 5250} 5251 5252// GetChaosEventsPreparer prepares the GetChaosEvents request. 5253func (client BaseClient) GetChaosEventsPreparer(ctx context.Context, continuationToken string, startTimeUtc string, endTimeUtc string, maxResults *int64, timeout *int64) (*http.Request, error) { 5254 const APIVersion = "6.2" 5255 queryParameters := map[string]interface{}{ 5256 "api-version": APIVersion, 5257 } 5258 if len(continuationToken) > 0 { 5259 queryParameters["ContinuationToken"] = continuationToken 5260 } 5261 if len(startTimeUtc) > 0 { 5262 queryParameters["StartTimeUtc"] = autorest.Encode("query", startTimeUtc) 5263 } 5264 if len(endTimeUtc) > 0 { 5265 queryParameters["EndTimeUtc"] = autorest.Encode("query", endTimeUtc) 5266 } 5267 if maxResults != nil { 5268 queryParameters["MaxResults"] = autorest.Encode("query", *maxResults) 5269 } else { 5270 queryParameters["MaxResults"] = autorest.Encode("query", 0) 5271 } 5272 if timeout != nil { 5273 queryParameters["timeout"] = autorest.Encode("query", *timeout) 5274 } else { 5275 queryParameters["timeout"] = autorest.Encode("query", 60) 5276 } 5277 5278 preparer := autorest.CreatePreparer( 5279 autorest.AsGet(), 5280 autorest.WithBaseURL(client.BaseURI), 5281 autorest.WithPath("/Tools/Chaos/Events"), 5282 autorest.WithQueryParameters(queryParameters)) 5283 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 5284} 5285 5286// GetChaosEventsSender sends the GetChaosEvents request. The method will close the 5287// http.Response Body if it receives an error. 5288func (client BaseClient) GetChaosEventsSender(req *http.Request) (*http.Response, error) { 5289 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 5290} 5291 5292// GetChaosEventsResponder handles the response to the GetChaosEvents request. The method always 5293// closes the http.Response Body. 5294func (client BaseClient) GetChaosEventsResponder(resp *http.Response) (result ChaosEventsSegment, err error) { 5295 err = autorest.Respond( 5296 resp, 5297 azure.WithErrorUnlessStatusCode(http.StatusOK), 5298 autorest.ByUnmarshallingJSON(&result), 5299 autorest.ByClosing()) 5300 result.Response = autorest.Response{Response: resp} 5301 return 5302} 5303 5304// GetChaosSchedule gets the version of the Chaos Schedule in use and the Chaos Schedule that defines when and how to 5305// run Chaos. 5306// Parameters: 5307// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 5308// duration that the client is willing to wait for the requested operation to complete. The default value for 5309// this parameter is 60 seconds. 5310func (client BaseClient) GetChaosSchedule(ctx context.Context, timeout *int64) (result ChaosScheduleDescription, err error) { 5311 if tracing.IsEnabled() { 5312 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetChaosSchedule") 5313 defer func() { 5314 sc := -1 5315 if result.Response.Response != nil { 5316 sc = result.Response.Response.StatusCode 5317 } 5318 tracing.EndSpan(ctx, sc, err) 5319 }() 5320 } 5321 if err := validation.Validate([]validation.Validation{ 5322 {TargetValue: timeout, 5323 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 5324 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 5325 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 5326 }}}}}); err != nil { 5327 return result, validation.NewError("servicefabric.BaseClient", "GetChaosSchedule", err.Error()) 5328 } 5329 5330 req, err := client.GetChaosSchedulePreparer(ctx, timeout) 5331 if err != nil { 5332 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetChaosSchedule", nil, "Failure preparing request") 5333 return 5334 } 5335 5336 resp, err := client.GetChaosScheduleSender(req) 5337 if err != nil { 5338 result.Response = autorest.Response{Response: resp} 5339 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetChaosSchedule", resp, "Failure sending request") 5340 return 5341 } 5342 5343 result, err = client.GetChaosScheduleResponder(resp) 5344 if err != nil { 5345 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetChaosSchedule", resp, "Failure responding to request") 5346 return 5347 } 5348 5349 return 5350} 5351 5352// GetChaosSchedulePreparer prepares the GetChaosSchedule request. 5353func (client BaseClient) GetChaosSchedulePreparer(ctx context.Context, timeout *int64) (*http.Request, error) { 5354 const APIVersion = "6.2" 5355 queryParameters := map[string]interface{}{ 5356 "api-version": APIVersion, 5357 } 5358 if timeout != nil { 5359 queryParameters["timeout"] = autorest.Encode("query", *timeout) 5360 } else { 5361 queryParameters["timeout"] = autorest.Encode("query", 60) 5362 } 5363 5364 preparer := autorest.CreatePreparer( 5365 autorest.AsGet(), 5366 autorest.WithBaseURL(client.BaseURI), 5367 autorest.WithPath("/Tools/Chaos/Schedule"), 5368 autorest.WithQueryParameters(queryParameters)) 5369 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 5370} 5371 5372// GetChaosScheduleSender sends the GetChaosSchedule request. The method will close the 5373// http.Response Body if it receives an error. 5374func (client BaseClient) GetChaosScheduleSender(req *http.Request) (*http.Response, error) { 5375 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 5376} 5377 5378// GetChaosScheduleResponder handles the response to the GetChaosSchedule request. The method always 5379// closes the http.Response Body. 5380func (client BaseClient) GetChaosScheduleResponder(resp *http.Response) (result ChaosScheduleDescription, err error) { 5381 err = autorest.Respond( 5382 resp, 5383 azure.WithErrorUnlessStatusCode(http.StatusOK), 5384 autorest.ByUnmarshallingJSON(&result), 5385 autorest.ByClosing()) 5386 result.Response = autorest.Response{Response: resp} 5387 return 5388} 5389 5390// GetClusterConfiguration the cluster configuration contains properties of the cluster that include different node 5391// types on the cluster, 5392// security configurations, fault, and upgrade domain topologies, etc. 5393// Parameters: 5394// configurationAPIVersion - the API version of the Standalone cluster json configuration. 5395// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 5396// duration that the client is willing to wait for the requested operation to complete. The default value for 5397// this parameter is 60 seconds. 5398func (client BaseClient) GetClusterConfiguration(ctx context.Context, configurationAPIVersion string, timeout *int64) (result ClusterConfiguration, err error) { 5399 if tracing.IsEnabled() { 5400 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetClusterConfiguration") 5401 defer func() { 5402 sc := -1 5403 if result.Response.Response != nil { 5404 sc = result.Response.Response.StatusCode 5405 } 5406 tracing.EndSpan(ctx, sc, err) 5407 }() 5408 } 5409 if err := validation.Validate([]validation.Validation{ 5410 {TargetValue: timeout, 5411 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 5412 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 5413 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 5414 }}}}}); err != nil { 5415 return result, validation.NewError("servicefabric.BaseClient", "GetClusterConfiguration", err.Error()) 5416 } 5417 5418 req, err := client.GetClusterConfigurationPreparer(ctx, configurationAPIVersion, timeout) 5419 if err != nil { 5420 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterConfiguration", nil, "Failure preparing request") 5421 return 5422 } 5423 5424 resp, err := client.GetClusterConfigurationSender(req) 5425 if err != nil { 5426 result.Response = autorest.Response{Response: resp} 5427 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterConfiguration", resp, "Failure sending request") 5428 return 5429 } 5430 5431 result, err = client.GetClusterConfigurationResponder(resp) 5432 if err != nil { 5433 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterConfiguration", resp, "Failure responding to request") 5434 return 5435 } 5436 5437 return 5438} 5439 5440// GetClusterConfigurationPreparer prepares the GetClusterConfiguration request. 5441func (client BaseClient) GetClusterConfigurationPreparer(ctx context.Context, configurationAPIVersion string, timeout *int64) (*http.Request, error) { 5442 const APIVersion = "6.0" 5443 queryParameters := map[string]interface{}{ 5444 "api-version": APIVersion, 5445 "ConfigurationApiVersion": autorest.Encode("query", configurationAPIVersion), 5446 } 5447 if timeout != nil { 5448 queryParameters["timeout"] = autorest.Encode("query", *timeout) 5449 } else { 5450 queryParameters["timeout"] = autorest.Encode("query", 60) 5451 } 5452 5453 preparer := autorest.CreatePreparer( 5454 autorest.AsGet(), 5455 autorest.WithBaseURL(client.BaseURI), 5456 autorest.WithPath("/$/GetClusterConfiguration"), 5457 autorest.WithQueryParameters(queryParameters)) 5458 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 5459} 5460 5461// GetClusterConfigurationSender sends the GetClusterConfiguration request. The method will close the 5462// http.Response Body if it receives an error. 5463func (client BaseClient) GetClusterConfigurationSender(req *http.Request) (*http.Response, error) { 5464 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 5465} 5466 5467// GetClusterConfigurationResponder handles the response to the GetClusterConfiguration request. The method always 5468// closes the http.Response Body. 5469func (client BaseClient) GetClusterConfigurationResponder(resp *http.Response) (result ClusterConfiguration, err error) { 5470 err = autorest.Respond( 5471 resp, 5472 azure.WithErrorUnlessStatusCode(http.StatusOK), 5473 autorest.ByUnmarshallingJSON(&result), 5474 autorest.ByClosing()) 5475 result.Response = autorest.Response{Response: resp} 5476 return 5477} 5478 5479// GetClusterConfigurationUpgradeStatus get the cluster configuration upgrade status details of a Service Fabric 5480// standalone cluster. 5481// Parameters: 5482// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 5483// duration that the client is willing to wait for the requested operation to complete. The default value for 5484// this parameter is 60 seconds. 5485func (client BaseClient) GetClusterConfigurationUpgradeStatus(ctx context.Context, timeout *int64) (result ClusterConfigurationUpgradeStatusInfo, err error) { 5486 if tracing.IsEnabled() { 5487 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetClusterConfigurationUpgradeStatus") 5488 defer func() { 5489 sc := -1 5490 if result.Response.Response != nil { 5491 sc = result.Response.Response.StatusCode 5492 } 5493 tracing.EndSpan(ctx, sc, err) 5494 }() 5495 } 5496 if err := validation.Validate([]validation.Validation{ 5497 {TargetValue: timeout, 5498 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 5499 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 5500 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 5501 }}}}}); err != nil { 5502 return result, validation.NewError("servicefabric.BaseClient", "GetClusterConfigurationUpgradeStatus", err.Error()) 5503 } 5504 5505 req, err := client.GetClusterConfigurationUpgradeStatusPreparer(ctx, timeout) 5506 if err != nil { 5507 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterConfigurationUpgradeStatus", nil, "Failure preparing request") 5508 return 5509 } 5510 5511 resp, err := client.GetClusterConfigurationUpgradeStatusSender(req) 5512 if err != nil { 5513 result.Response = autorest.Response{Response: resp} 5514 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterConfigurationUpgradeStatus", resp, "Failure sending request") 5515 return 5516 } 5517 5518 result, err = client.GetClusterConfigurationUpgradeStatusResponder(resp) 5519 if err != nil { 5520 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterConfigurationUpgradeStatus", resp, "Failure responding to request") 5521 return 5522 } 5523 5524 return 5525} 5526 5527// GetClusterConfigurationUpgradeStatusPreparer prepares the GetClusterConfigurationUpgradeStatus request. 5528func (client BaseClient) GetClusterConfigurationUpgradeStatusPreparer(ctx context.Context, timeout *int64) (*http.Request, error) { 5529 const APIVersion = "6.0" 5530 queryParameters := map[string]interface{}{ 5531 "api-version": APIVersion, 5532 } 5533 if timeout != nil { 5534 queryParameters["timeout"] = autorest.Encode("query", *timeout) 5535 } else { 5536 queryParameters["timeout"] = autorest.Encode("query", 60) 5537 } 5538 5539 preparer := autorest.CreatePreparer( 5540 autorest.AsGet(), 5541 autorest.WithBaseURL(client.BaseURI), 5542 autorest.WithPath("/$/GetClusterConfigurationUpgradeStatus"), 5543 autorest.WithQueryParameters(queryParameters)) 5544 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 5545} 5546 5547// GetClusterConfigurationUpgradeStatusSender sends the GetClusterConfigurationUpgradeStatus request. The method will close the 5548// http.Response Body if it receives an error. 5549func (client BaseClient) GetClusterConfigurationUpgradeStatusSender(req *http.Request) (*http.Response, error) { 5550 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 5551} 5552 5553// GetClusterConfigurationUpgradeStatusResponder handles the response to the GetClusterConfigurationUpgradeStatus request. The method always 5554// closes the http.Response Body. 5555func (client BaseClient) GetClusterConfigurationUpgradeStatusResponder(resp *http.Response) (result ClusterConfigurationUpgradeStatusInfo, err error) { 5556 err = autorest.Respond( 5557 resp, 5558 azure.WithErrorUnlessStatusCode(http.StatusOK), 5559 autorest.ByUnmarshallingJSON(&result), 5560 autorest.ByClosing()) 5561 result.Response = autorest.Response{Response: resp} 5562 return 5563} 5564 5565// GetClusterEventList the response is list of ClusterEvent objects. 5566// Parameters: 5567// startTimeUtc - the start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. 5568// endTimeUtc - the end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. 5569// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 5570// duration that the client is willing to wait for the requested operation to complete. The default value for 5571// this parameter is 60 seconds. 5572// eventsTypesFilter - this is a comma separated string specifying the types of FabricEvents that should only 5573// be included in the response. 5574// excludeAnalysisEvents - this param disables the retrieval of AnalysisEvents if true is passed. 5575// skipCorrelationLookup - this param disables the search of CorrelatedEvents information if true is passed. 5576// otherwise the CorrelationEvents get processed and HasCorrelatedEvents field in every FabricEvent gets 5577// populated. 5578func (client BaseClient) GetClusterEventList(ctx context.Context, startTimeUtc string, endTimeUtc string, timeout *int64, eventsTypesFilter string, excludeAnalysisEvents *bool, skipCorrelationLookup *bool) (result ListClusterEvent, err error) { 5579 if tracing.IsEnabled() { 5580 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetClusterEventList") 5581 defer func() { 5582 sc := -1 5583 if result.Response.Response != nil { 5584 sc = result.Response.Response.StatusCode 5585 } 5586 tracing.EndSpan(ctx, sc, err) 5587 }() 5588 } 5589 if err := validation.Validate([]validation.Validation{ 5590 {TargetValue: timeout, 5591 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 5592 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 5593 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 5594 }}}}}); err != nil { 5595 return result, validation.NewError("servicefabric.BaseClient", "GetClusterEventList", err.Error()) 5596 } 5597 5598 req, err := client.GetClusterEventListPreparer(ctx, startTimeUtc, endTimeUtc, timeout, eventsTypesFilter, excludeAnalysisEvents, skipCorrelationLookup) 5599 if err != nil { 5600 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterEventList", nil, "Failure preparing request") 5601 return 5602 } 5603 5604 resp, err := client.GetClusterEventListSender(req) 5605 if err != nil { 5606 result.Response = autorest.Response{Response: resp} 5607 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterEventList", resp, "Failure sending request") 5608 return 5609 } 5610 5611 result, err = client.GetClusterEventListResponder(resp) 5612 if err != nil { 5613 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterEventList", resp, "Failure responding to request") 5614 return 5615 } 5616 5617 return 5618} 5619 5620// GetClusterEventListPreparer prepares the GetClusterEventList request. 5621func (client BaseClient) GetClusterEventListPreparer(ctx context.Context, startTimeUtc string, endTimeUtc string, timeout *int64, eventsTypesFilter string, excludeAnalysisEvents *bool, skipCorrelationLookup *bool) (*http.Request, error) { 5622 const APIVersion = "6.4" 5623 queryParameters := map[string]interface{}{ 5624 "api-version": APIVersion, 5625 "EndTimeUtc": autorest.Encode("query", endTimeUtc), 5626 "StartTimeUtc": autorest.Encode("query", startTimeUtc), 5627 } 5628 if timeout != nil { 5629 queryParameters["timeout"] = autorest.Encode("query", *timeout) 5630 } else { 5631 queryParameters["timeout"] = autorest.Encode("query", 60) 5632 } 5633 if len(eventsTypesFilter) > 0 { 5634 queryParameters["EventsTypesFilter"] = autorest.Encode("query", eventsTypesFilter) 5635 } 5636 if excludeAnalysisEvents != nil { 5637 queryParameters["ExcludeAnalysisEvents"] = autorest.Encode("query", *excludeAnalysisEvents) 5638 } 5639 if skipCorrelationLookup != nil { 5640 queryParameters["SkipCorrelationLookup"] = autorest.Encode("query", *skipCorrelationLookup) 5641 } 5642 5643 preparer := autorest.CreatePreparer( 5644 autorest.AsGet(), 5645 autorest.WithBaseURL(client.BaseURI), 5646 autorest.WithPath("/EventsStore/Cluster/Events"), 5647 autorest.WithQueryParameters(queryParameters)) 5648 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 5649} 5650 5651// GetClusterEventListSender sends the GetClusterEventList request. The method will close the 5652// http.Response Body if it receives an error. 5653func (client BaseClient) GetClusterEventListSender(req *http.Request) (*http.Response, error) { 5654 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 5655} 5656 5657// GetClusterEventListResponder handles the response to the GetClusterEventList request. The method always 5658// closes the http.Response Body. 5659func (client BaseClient) GetClusterEventListResponder(resp *http.Response) (result ListClusterEvent, err error) { 5660 err = autorest.Respond( 5661 resp, 5662 azure.WithErrorUnlessStatusCode(http.StatusOK), 5663 autorest.ByUnmarshallingJSON(&result), 5664 autorest.ByClosing()) 5665 result.Response = autorest.Response{Response: resp} 5666 return 5667} 5668 5669// GetClusterHealth use EventsHealthStateFilter to filter the collection of health events reported on the cluster based 5670// on the health state. 5671// Similarly, use NodesHealthStateFilter and ApplicationsHealthStateFilter to filter the collection of nodes and 5672// applications returned based on their aggregated health state. 5673// Parameters: 5674// nodesHealthStateFilter - allows filtering of the node health state objects returned in the result of cluster 5675// health query 5676// based on their health state. The possible values for this parameter include integer value of one of the 5677// following health states. Only nodes that match the filter are returned. All nodes are used to evaluate the 5678// aggregated health state. 5679// If not specified, all entries are returned. 5680// The state values are flag-based enumeration, so the value could be a combination of these values obtained 5681// using bitwise 'OR' operator. 5682// For example, if the provided value is 6 then health state of nodes with HealthState value of OK (2) and 5683// Warning (4) are returned. 5684// 5685// - Default - Default value. Matches any HealthState. The value is zero. 5686// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given 5687// collection of states. The value is 1. 5688// - Ok - Filter that matches input with HealthState value Ok. The value is 2. 5689// - Warning - Filter that matches input with HealthState value Warning. The value is 4. 5690// - Error - Filter that matches input with HealthState value Error. The value is 8. 5691// - All - Filter that matches input with any HealthState value. The value is 65535. 5692// applicationsHealthStateFilter - allows filtering of the application health state objects returned in the 5693// result of cluster health 5694// query based on their health state. 5695// The possible values for this parameter include integer value obtained from members or bitwise operations 5696// on members of HealthStateFilter enumeration. Only applications that match the filter are returned. 5697// All applications are used to evaluate the aggregated health state. If not specified, all entries are 5698// returned. 5699// The state values are flag-based enumeration, so the value could be a combination of these values obtained 5700// using bitwise 'OR' operator. 5701// For example, if the provided value is 6 then health state of applications with HealthState value of OK (2) 5702// and Warning (4) are returned. 5703// 5704// - Default - Default value. Matches any HealthState. The value is zero. 5705// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given 5706// collection of states. The value is 1. 5707// - Ok - Filter that matches input with HealthState value Ok. The value is 2. 5708// - Warning - Filter that matches input with HealthState value Warning. The value is 4. 5709// - Error - Filter that matches input with HealthState value Error. The value is 8. 5710// - All - Filter that matches input with any HealthState value. The value is 65535. 5711// eventsHealthStateFilter - allows filtering the collection of HealthEvent objects returned based on health 5712// state. 5713// The possible values for this parameter include integer value of one of the following health states. 5714// Only events that match the filter are returned. All events are used to evaluate the aggregated health state. 5715// If not specified, all entries are returned. The state values are flag-based enumeration, so the value could 5716// be a combination of these values, obtained using the bitwise 'OR' operator. For example, If the provided 5717// value is 6 then all of the events with HealthState value of OK (2) and 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// excludeHealthStatistics - indicates whether the health statistics should be returned as part of the query 5727// result. False by default. 5728// The statistics show the number of children entities in health state Ok, Warning, and Error. 5729// includeSystemApplicationHealthStatistics - indicates whether the health statistics should include the 5730// fabric:/System application health statistics. False by default. 5731// If IncludeSystemApplicationHealthStatistics is set to true, the health statistics include the entities that 5732// belong to the fabric:/System application. 5733// Otherwise, the query result includes health statistics only for user applications. 5734// The health statistics must be included in the query result for this parameter to be applied. 5735// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 5736// duration that the client is willing to wait for the requested operation to complete. The default value for 5737// this parameter is 60 seconds. 5738func (client BaseClient) GetClusterHealth(ctx context.Context, nodesHealthStateFilter *int32, applicationsHealthStateFilter *int32, eventsHealthStateFilter *int32, excludeHealthStatistics *bool, includeSystemApplicationHealthStatistics *bool, timeout *int64) (result ClusterHealth, err error) { 5739 if tracing.IsEnabled() { 5740 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetClusterHealth") 5741 defer func() { 5742 sc := -1 5743 if result.Response.Response != nil { 5744 sc = result.Response.Response.StatusCode 5745 } 5746 tracing.EndSpan(ctx, sc, err) 5747 }() 5748 } 5749 if err := validation.Validate([]validation.Validation{ 5750 {TargetValue: timeout, 5751 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 5752 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 5753 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 5754 }}}}}); err != nil { 5755 return result, validation.NewError("servicefabric.BaseClient", "GetClusterHealth", err.Error()) 5756 } 5757 5758 req, err := client.GetClusterHealthPreparer(ctx, nodesHealthStateFilter, applicationsHealthStateFilter, eventsHealthStateFilter, excludeHealthStatistics, includeSystemApplicationHealthStatistics, timeout) 5759 if err != nil { 5760 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterHealth", nil, "Failure preparing request") 5761 return 5762 } 5763 5764 resp, err := client.GetClusterHealthSender(req) 5765 if err != nil { 5766 result.Response = autorest.Response{Response: resp} 5767 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterHealth", resp, "Failure sending request") 5768 return 5769 } 5770 5771 result, err = client.GetClusterHealthResponder(resp) 5772 if err != nil { 5773 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterHealth", resp, "Failure responding to request") 5774 return 5775 } 5776 5777 return 5778} 5779 5780// GetClusterHealthPreparer prepares the GetClusterHealth request. 5781func (client BaseClient) GetClusterHealthPreparer(ctx context.Context, nodesHealthStateFilter *int32, applicationsHealthStateFilter *int32, eventsHealthStateFilter *int32, excludeHealthStatistics *bool, includeSystemApplicationHealthStatistics *bool, timeout *int64) (*http.Request, error) { 5782 const APIVersion = "6.0" 5783 queryParameters := map[string]interface{}{ 5784 "api-version": APIVersion, 5785 } 5786 if nodesHealthStateFilter != nil { 5787 queryParameters["NodesHealthStateFilter"] = autorest.Encode("query", *nodesHealthStateFilter) 5788 } else { 5789 queryParameters["NodesHealthStateFilter"] = autorest.Encode("query", 0) 5790 } 5791 if applicationsHealthStateFilter != nil { 5792 queryParameters["ApplicationsHealthStateFilter"] = autorest.Encode("query", *applicationsHealthStateFilter) 5793 } else { 5794 queryParameters["ApplicationsHealthStateFilter"] = autorest.Encode("query", 0) 5795 } 5796 if eventsHealthStateFilter != nil { 5797 queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", *eventsHealthStateFilter) 5798 } else { 5799 queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", 0) 5800 } 5801 if excludeHealthStatistics != nil { 5802 queryParameters["ExcludeHealthStatistics"] = autorest.Encode("query", *excludeHealthStatistics) 5803 } else { 5804 queryParameters["ExcludeHealthStatistics"] = autorest.Encode("query", false) 5805 } 5806 if includeSystemApplicationHealthStatistics != nil { 5807 queryParameters["IncludeSystemApplicationHealthStatistics"] = autorest.Encode("query", *includeSystemApplicationHealthStatistics) 5808 } else { 5809 queryParameters["IncludeSystemApplicationHealthStatistics"] = autorest.Encode("query", false) 5810 } 5811 if timeout != nil { 5812 queryParameters["timeout"] = autorest.Encode("query", *timeout) 5813 } else { 5814 queryParameters["timeout"] = autorest.Encode("query", 60) 5815 } 5816 5817 preparer := autorest.CreatePreparer( 5818 autorest.AsGet(), 5819 autorest.WithBaseURL(client.BaseURI), 5820 autorest.WithPath("/$/GetClusterHealth"), 5821 autorest.WithQueryParameters(queryParameters)) 5822 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 5823} 5824 5825// GetClusterHealthSender sends the GetClusterHealth request. The method will close the 5826// http.Response Body if it receives an error. 5827func (client BaseClient) GetClusterHealthSender(req *http.Request) (*http.Response, error) { 5828 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 5829} 5830 5831// GetClusterHealthResponder handles the response to the GetClusterHealth request. The method always 5832// closes the http.Response Body. 5833func (client BaseClient) GetClusterHealthResponder(resp *http.Response) (result ClusterHealth, err error) { 5834 err = autorest.Respond( 5835 resp, 5836 azure.WithErrorUnlessStatusCode(http.StatusOK), 5837 autorest.ByUnmarshallingJSON(&result), 5838 autorest.ByClosing()) 5839 result.Response = autorest.Response{Response: resp} 5840 return 5841} 5842 5843// GetClusterHealthChunk gets the health of a Service Fabric cluster using health chunks. Includes the aggregated 5844// health state of the cluster, but none of the cluster entities. 5845// To expand the cluster health and get the health state of all or some of the entities, use the POST URI and specify 5846// the cluster health chunk query description. 5847// Parameters: 5848// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 5849// duration that the client is willing to wait for the requested operation to complete. The default value for 5850// this parameter is 60 seconds. 5851func (client BaseClient) GetClusterHealthChunk(ctx context.Context, timeout *int64) (result ClusterHealthChunk, err error) { 5852 if tracing.IsEnabled() { 5853 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetClusterHealthChunk") 5854 defer func() { 5855 sc := -1 5856 if result.Response.Response != nil { 5857 sc = result.Response.Response.StatusCode 5858 } 5859 tracing.EndSpan(ctx, sc, err) 5860 }() 5861 } 5862 if err := validation.Validate([]validation.Validation{ 5863 {TargetValue: timeout, 5864 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 5865 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 5866 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 5867 }}}}}); err != nil { 5868 return result, validation.NewError("servicefabric.BaseClient", "GetClusterHealthChunk", err.Error()) 5869 } 5870 5871 req, err := client.GetClusterHealthChunkPreparer(ctx, timeout) 5872 if err != nil { 5873 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterHealthChunk", nil, "Failure preparing request") 5874 return 5875 } 5876 5877 resp, err := client.GetClusterHealthChunkSender(req) 5878 if err != nil { 5879 result.Response = autorest.Response{Response: resp} 5880 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterHealthChunk", resp, "Failure sending request") 5881 return 5882 } 5883 5884 result, err = client.GetClusterHealthChunkResponder(resp) 5885 if err != nil { 5886 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterHealthChunk", resp, "Failure responding to request") 5887 return 5888 } 5889 5890 return 5891} 5892 5893// GetClusterHealthChunkPreparer prepares the GetClusterHealthChunk request. 5894func (client BaseClient) GetClusterHealthChunkPreparer(ctx context.Context, timeout *int64) (*http.Request, error) { 5895 const APIVersion = "6.0" 5896 queryParameters := map[string]interface{}{ 5897 "api-version": APIVersion, 5898 } 5899 if timeout != nil { 5900 queryParameters["timeout"] = autorest.Encode("query", *timeout) 5901 } else { 5902 queryParameters["timeout"] = autorest.Encode("query", 60) 5903 } 5904 5905 preparer := autorest.CreatePreparer( 5906 autorest.AsGet(), 5907 autorest.WithBaseURL(client.BaseURI), 5908 autorest.WithPath("/$/GetClusterHealthChunk"), 5909 autorest.WithQueryParameters(queryParameters)) 5910 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 5911} 5912 5913// GetClusterHealthChunkSender sends the GetClusterHealthChunk request. The method will close the 5914// http.Response Body if it receives an error. 5915func (client BaseClient) GetClusterHealthChunkSender(req *http.Request) (*http.Response, error) { 5916 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 5917} 5918 5919// GetClusterHealthChunkResponder handles the response to the GetClusterHealthChunk request. The method always 5920// closes the http.Response Body. 5921func (client BaseClient) GetClusterHealthChunkResponder(resp *http.Response) (result ClusterHealthChunk, err error) { 5922 err = autorest.Respond( 5923 resp, 5924 azure.WithErrorUnlessStatusCode(http.StatusOK), 5925 autorest.ByUnmarshallingJSON(&result), 5926 autorest.ByClosing()) 5927 result.Response = autorest.Response{Response: resp} 5928 return 5929} 5930 5931// GetClusterHealthChunkUsingPolicyAndAdvancedFilters gets the health of a Service Fabric cluster using health chunks. 5932// The health evaluation is done based on the input cluster health chunk query description. 5933// The query description allows users to specify health policies for evaluating the cluster and its children. 5934// Users can specify very flexible filters to select which cluster entities to return. The selection can be done based 5935// on the entities health state and based on the hierarchy. 5936// The query can return multi-level children of the entities based on the specified filters. For example, it can return 5937// one application with a specified name, and for this application, return 5938// only services that are in Error or Warning, and all partitions and replicas for one of these services. 5939// Parameters: 5940// clusterHealthChunkQueryDescription - describes the cluster and application health policies used to evaluate 5941// the cluster health and the filters to select which cluster entities to be returned. 5942// If the cluster health policy is present, it is used to evaluate the cluster events and the cluster nodes. If 5943// not present, the health evaluation uses the cluster health policy defined in the cluster manifest or the 5944// default cluster health policy. 5945// By default, each application is evaluated using its specific application health policy, defined in the 5946// application manifest, or the default health policy, if no policy is defined in manifest. 5947// If the application health policy map is specified, and it has an entry for an application, the specified 5948// application health policy 5949// is used to evaluate the application health. 5950// Users can specify very flexible filters to select which cluster entities to include in response. The 5951// selection can be done based on the entities health state and based on the hierarchy. 5952// The query can return multi-level children of the entities based on the specified filters. For example, it 5953// can return one application with a specified name, and for this application, return 5954// only services that are in Error or Warning, and all partitions and replicas for one of these services. 5955// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 5956// duration that the client is willing to wait for the requested operation to complete. The default value for 5957// this parameter is 60 seconds. 5958func (client BaseClient) GetClusterHealthChunkUsingPolicyAndAdvancedFilters(ctx context.Context, clusterHealthChunkQueryDescription *ClusterHealthChunkQueryDescription, timeout *int64) (result ClusterHealthChunk, err error) { 5959 if tracing.IsEnabled() { 5960 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetClusterHealthChunkUsingPolicyAndAdvancedFilters") 5961 defer func() { 5962 sc := -1 5963 if result.Response.Response != nil { 5964 sc = result.Response.Response.StatusCode 5965 } 5966 tracing.EndSpan(ctx, sc, err) 5967 }() 5968 } 5969 if err := validation.Validate([]validation.Validation{ 5970 {TargetValue: timeout, 5971 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 5972 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 5973 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 5974 }}}}}); err != nil { 5975 return result, validation.NewError("servicefabric.BaseClient", "GetClusterHealthChunkUsingPolicyAndAdvancedFilters", err.Error()) 5976 } 5977 5978 req, err := client.GetClusterHealthChunkUsingPolicyAndAdvancedFiltersPreparer(ctx, clusterHealthChunkQueryDescription, timeout) 5979 if err != nil { 5980 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterHealthChunkUsingPolicyAndAdvancedFilters", nil, "Failure preparing request") 5981 return 5982 } 5983 5984 resp, err := client.GetClusterHealthChunkUsingPolicyAndAdvancedFiltersSender(req) 5985 if err != nil { 5986 result.Response = autorest.Response{Response: resp} 5987 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterHealthChunkUsingPolicyAndAdvancedFilters", resp, "Failure sending request") 5988 return 5989 } 5990 5991 result, err = client.GetClusterHealthChunkUsingPolicyAndAdvancedFiltersResponder(resp) 5992 if err != nil { 5993 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterHealthChunkUsingPolicyAndAdvancedFilters", resp, "Failure responding to request") 5994 return 5995 } 5996 5997 return 5998} 5999 6000// GetClusterHealthChunkUsingPolicyAndAdvancedFiltersPreparer prepares the GetClusterHealthChunkUsingPolicyAndAdvancedFilters request. 6001func (client BaseClient) GetClusterHealthChunkUsingPolicyAndAdvancedFiltersPreparer(ctx context.Context, clusterHealthChunkQueryDescription *ClusterHealthChunkQueryDescription, timeout *int64) (*http.Request, error) { 6002 const APIVersion = "6.0" 6003 queryParameters := map[string]interface{}{ 6004 "api-version": APIVersion, 6005 } 6006 if timeout != nil { 6007 queryParameters["timeout"] = autorest.Encode("query", *timeout) 6008 } else { 6009 queryParameters["timeout"] = autorest.Encode("query", 60) 6010 } 6011 6012 preparer := autorest.CreatePreparer( 6013 autorest.AsContentType("application/json; charset=utf-8"), 6014 autorest.AsPost(), 6015 autorest.WithBaseURL(client.BaseURI), 6016 autorest.WithPath("/$/GetClusterHealthChunk"), 6017 autorest.WithQueryParameters(queryParameters)) 6018 if clusterHealthChunkQueryDescription != nil { 6019 preparer = autorest.DecoratePreparer(preparer, 6020 autorest.WithJSON(clusterHealthChunkQueryDescription)) 6021 } 6022 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 6023} 6024 6025// GetClusterHealthChunkUsingPolicyAndAdvancedFiltersSender sends the GetClusterHealthChunkUsingPolicyAndAdvancedFilters request. The method will close the 6026// http.Response Body if it receives an error. 6027func (client BaseClient) GetClusterHealthChunkUsingPolicyAndAdvancedFiltersSender(req *http.Request) (*http.Response, error) { 6028 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 6029} 6030 6031// GetClusterHealthChunkUsingPolicyAndAdvancedFiltersResponder handles the response to the GetClusterHealthChunkUsingPolicyAndAdvancedFilters request. The method always 6032// closes the http.Response Body. 6033func (client BaseClient) GetClusterHealthChunkUsingPolicyAndAdvancedFiltersResponder(resp *http.Response) (result ClusterHealthChunk, err error) { 6034 err = autorest.Respond( 6035 resp, 6036 azure.WithErrorUnlessStatusCode(http.StatusOK), 6037 autorest.ByUnmarshallingJSON(&result), 6038 autorest.ByClosing()) 6039 result.Response = autorest.Response{Response: resp} 6040 return 6041} 6042 6043// GetClusterHealthUsingPolicy use EventsHealthStateFilter to filter the collection of health events reported on the 6044// cluster based on the health state. 6045// Similarly, use NodesHealthStateFilter and ApplicationsHealthStateFilter to filter the collection of nodes and 6046// applications returned based on their aggregated health state. 6047// Use ClusterHealthPolicies to override the health policies used to evaluate the health. 6048// Parameters: 6049// nodesHealthStateFilter - allows filtering of the node health state objects returned in the result of cluster 6050// health query 6051// based on their health state. The possible values for this parameter include integer value of one of the 6052// following health states. Only nodes that match the filter are returned. All nodes are used to evaluate the 6053// aggregated health state. 6054// If not specified, all entries are returned. 6055// The state values are flag-based enumeration, so the value could be a combination of these values obtained 6056// using bitwise 'OR' operator. 6057// For example, if the provided value is 6 then health state of nodes with HealthState value of OK (2) and 6058// Warning (4) are returned. 6059// 6060// - Default - Default value. Matches any HealthState. The value is zero. 6061// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given 6062// collection of states. The value is 1. 6063// - Ok - Filter that matches input with HealthState value Ok. The value is 2. 6064// - Warning - Filter that matches input with HealthState value Warning. The value is 4. 6065// - Error - Filter that matches input with HealthState value Error. The value is 8. 6066// - All - Filter that matches input with any HealthState value. The value is 65535. 6067// applicationsHealthStateFilter - allows filtering of the application health state objects returned in the 6068// result of cluster health 6069// query based on their health state. 6070// The possible values for this parameter include integer value obtained from members or bitwise operations 6071// on members of HealthStateFilter enumeration. Only applications that match the filter are returned. 6072// All applications are used to evaluate the aggregated health state. If not specified, all entries are 6073// returned. 6074// The state values are flag-based enumeration, so the value could be a combination of these values obtained 6075// using bitwise 'OR' operator. 6076// For example, if the provided value is 6 then health state of applications with HealthState value of OK (2) 6077// and Warning (4) are returned. 6078// 6079// - Default - Default value. Matches any HealthState. The value is zero. 6080// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given 6081// collection of states. The value is 1. 6082// - Ok - Filter that matches input with HealthState value Ok. The value is 2. 6083// - Warning - Filter that matches input with HealthState value Warning. The value is 4. 6084// - Error - Filter that matches input with HealthState value Error. The value is 8. 6085// - All - Filter that matches input with any HealthState value. The value is 65535. 6086// eventsHealthStateFilter - allows filtering the collection of HealthEvent objects returned based on health 6087// state. 6088// The possible values for this parameter include integer value of one of the following health states. 6089// Only events that match the filter are returned. All events are used to evaluate the aggregated health state. 6090// If not specified, all entries are returned. The state values are flag-based enumeration, so the value could 6091// be a combination of these values, obtained using the bitwise 'OR' operator. For example, If the provided 6092// value is 6 then all of the events with HealthState value of OK (2) and Warning (4) are returned. 6093// 6094// - Default - Default value. Matches any HealthState. The value is zero. 6095// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given 6096// collection of states. The value is 1. 6097// - Ok - Filter that matches input with HealthState value Ok. The value is 2. 6098// - Warning - Filter that matches input with HealthState value Warning. The value is 4. 6099// - Error - Filter that matches input with HealthState value Error. The value is 8. 6100// - All - Filter that matches input with any HealthState value. The value is 65535. 6101// excludeHealthStatistics - indicates whether the health statistics should be returned as part of the query 6102// result. False by default. 6103// The statistics show the number of children entities in health state Ok, Warning, and Error. 6104// includeSystemApplicationHealthStatistics - indicates whether the health statistics should include the 6105// fabric:/System application health statistics. False by default. 6106// If IncludeSystemApplicationHealthStatistics is set to true, the health statistics include the entities that 6107// belong to the fabric:/System application. 6108// Otherwise, the query result includes health statistics only for user applications. 6109// The health statistics must be included in the query result for this parameter to be applied. 6110// clusterHealthPolicies - describes the health policies used to evaluate the cluster health. 6111// If not present, the health evaluation uses the cluster health policy defined in the cluster manifest or the 6112// default cluster health policy. 6113// By default, each application is evaluated using its specific application health policy, defined in the 6114// application manifest, or the default health policy, if no policy is defined in manifest. 6115// If the application health policy map is specified, and it has an entry for an application, the specified 6116// application health policy 6117// is used to evaluate the application health. 6118// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 6119// duration that the client is willing to wait for the requested operation to complete. The default value for 6120// this parameter is 60 seconds. 6121func (client BaseClient) GetClusterHealthUsingPolicy(ctx context.Context, nodesHealthStateFilter *int32, applicationsHealthStateFilter *int32, eventsHealthStateFilter *int32, excludeHealthStatistics *bool, includeSystemApplicationHealthStatistics *bool, clusterHealthPolicies *ClusterHealthPolicies, timeout *int64) (result ClusterHealth, err error) { 6122 if tracing.IsEnabled() { 6123 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetClusterHealthUsingPolicy") 6124 defer func() { 6125 sc := -1 6126 if result.Response.Response != nil { 6127 sc = result.Response.Response.StatusCode 6128 } 6129 tracing.EndSpan(ctx, sc, err) 6130 }() 6131 } 6132 if err := validation.Validate([]validation.Validation{ 6133 {TargetValue: timeout, 6134 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 6135 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 6136 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 6137 }}}}}); err != nil { 6138 return result, validation.NewError("servicefabric.BaseClient", "GetClusterHealthUsingPolicy", err.Error()) 6139 } 6140 6141 req, err := client.GetClusterHealthUsingPolicyPreparer(ctx, nodesHealthStateFilter, applicationsHealthStateFilter, eventsHealthStateFilter, excludeHealthStatistics, includeSystemApplicationHealthStatistics, clusterHealthPolicies, timeout) 6142 if err != nil { 6143 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterHealthUsingPolicy", nil, "Failure preparing request") 6144 return 6145 } 6146 6147 resp, err := client.GetClusterHealthUsingPolicySender(req) 6148 if err != nil { 6149 result.Response = autorest.Response{Response: resp} 6150 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterHealthUsingPolicy", resp, "Failure sending request") 6151 return 6152 } 6153 6154 result, err = client.GetClusterHealthUsingPolicyResponder(resp) 6155 if err != nil { 6156 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterHealthUsingPolicy", resp, "Failure responding to request") 6157 return 6158 } 6159 6160 return 6161} 6162 6163// GetClusterHealthUsingPolicyPreparer prepares the GetClusterHealthUsingPolicy request. 6164func (client BaseClient) GetClusterHealthUsingPolicyPreparer(ctx context.Context, nodesHealthStateFilter *int32, applicationsHealthStateFilter *int32, eventsHealthStateFilter *int32, excludeHealthStatistics *bool, includeSystemApplicationHealthStatistics *bool, clusterHealthPolicies *ClusterHealthPolicies, timeout *int64) (*http.Request, error) { 6165 const APIVersion = "6.0" 6166 queryParameters := map[string]interface{}{ 6167 "api-version": APIVersion, 6168 } 6169 if nodesHealthStateFilter != nil { 6170 queryParameters["NodesHealthStateFilter"] = autorest.Encode("query", *nodesHealthStateFilter) 6171 } else { 6172 queryParameters["NodesHealthStateFilter"] = autorest.Encode("query", 0) 6173 } 6174 if applicationsHealthStateFilter != nil { 6175 queryParameters["ApplicationsHealthStateFilter"] = autorest.Encode("query", *applicationsHealthStateFilter) 6176 } else { 6177 queryParameters["ApplicationsHealthStateFilter"] = autorest.Encode("query", 0) 6178 } 6179 if eventsHealthStateFilter != nil { 6180 queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", *eventsHealthStateFilter) 6181 } else { 6182 queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", 0) 6183 } 6184 if excludeHealthStatistics != nil { 6185 queryParameters["ExcludeHealthStatistics"] = autorest.Encode("query", *excludeHealthStatistics) 6186 } else { 6187 queryParameters["ExcludeHealthStatistics"] = autorest.Encode("query", false) 6188 } 6189 if includeSystemApplicationHealthStatistics != nil { 6190 queryParameters["IncludeSystemApplicationHealthStatistics"] = autorest.Encode("query", *includeSystemApplicationHealthStatistics) 6191 } else { 6192 queryParameters["IncludeSystemApplicationHealthStatistics"] = autorest.Encode("query", false) 6193 } 6194 if timeout != nil { 6195 queryParameters["timeout"] = autorest.Encode("query", *timeout) 6196 } else { 6197 queryParameters["timeout"] = autorest.Encode("query", 60) 6198 } 6199 6200 preparer := autorest.CreatePreparer( 6201 autorest.AsContentType("application/json; charset=utf-8"), 6202 autorest.AsPost(), 6203 autorest.WithBaseURL(client.BaseURI), 6204 autorest.WithPath("/$/GetClusterHealth"), 6205 autorest.WithQueryParameters(queryParameters)) 6206 if clusterHealthPolicies != nil { 6207 preparer = autorest.DecoratePreparer(preparer, 6208 autorest.WithJSON(clusterHealthPolicies)) 6209 } 6210 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 6211} 6212 6213// GetClusterHealthUsingPolicySender sends the GetClusterHealthUsingPolicy request. The method will close the 6214// http.Response Body if it receives an error. 6215func (client BaseClient) GetClusterHealthUsingPolicySender(req *http.Request) (*http.Response, error) { 6216 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 6217} 6218 6219// GetClusterHealthUsingPolicyResponder handles the response to the GetClusterHealthUsingPolicy request. The method always 6220// closes the http.Response Body. 6221func (client BaseClient) GetClusterHealthUsingPolicyResponder(resp *http.Response) (result ClusterHealth, err error) { 6222 err = autorest.Respond( 6223 resp, 6224 azure.WithErrorUnlessStatusCode(http.StatusOK), 6225 autorest.ByUnmarshallingJSON(&result), 6226 autorest.ByClosing()) 6227 result.Response = autorest.Response{Response: resp} 6228 return 6229} 6230 6231// GetClusterManifest get the Service Fabric cluster manifest. The cluster manifest contains properties of the cluster 6232// that include different node types on the cluster, 6233// security configurations, fault, and upgrade domain topologies, etc. 6234// 6235// These properties are specified as part of the ClusterConfig.JSON file while deploying a stand-alone cluster. 6236// However, most of the information in the cluster manifest 6237// is generated internally by service fabric during cluster deployment in other deployment scenarios (e.g. when using 6238// Azure portal). 6239// 6240// The contents of the cluster manifest are for informational purposes only and users are not expected to take a 6241// dependency on the format of the file contents or its interpretation. 6242// Parameters: 6243// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 6244// duration that the client is willing to wait for the requested operation to complete. The default value for 6245// this parameter is 60 seconds. 6246func (client BaseClient) GetClusterManifest(ctx context.Context, timeout *int64) (result ClusterManifest, err error) { 6247 if tracing.IsEnabled() { 6248 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetClusterManifest") 6249 defer func() { 6250 sc := -1 6251 if result.Response.Response != nil { 6252 sc = result.Response.Response.StatusCode 6253 } 6254 tracing.EndSpan(ctx, sc, err) 6255 }() 6256 } 6257 if err := validation.Validate([]validation.Validation{ 6258 {TargetValue: timeout, 6259 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 6260 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 6261 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 6262 }}}}}); err != nil { 6263 return result, validation.NewError("servicefabric.BaseClient", "GetClusterManifest", err.Error()) 6264 } 6265 6266 req, err := client.GetClusterManifestPreparer(ctx, timeout) 6267 if err != nil { 6268 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterManifest", nil, "Failure preparing request") 6269 return 6270 } 6271 6272 resp, err := client.GetClusterManifestSender(req) 6273 if err != nil { 6274 result.Response = autorest.Response{Response: resp} 6275 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterManifest", resp, "Failure sending request") 6276 return 6277 } 6278 6279 result, err = client.GetClusterManifestResponder(resp) 6280 if err != nil { 6281 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterManifest", resp, "Failure responding to request") 6282 return 6283 } 6284 6285 return 6286} 6287 6288// GetClusterManifestPreparer prepares the GetClusterManifest request. 6289func (client BaseClient) GetClusterManifestPreparer(ctx context.Context, timeout *int64) (*http.Request, error) { 6290 const APIVersion = "6.0" 6291 queryParameters := map[string]interface{}{ 6292 "api-version": APIVersion, 6293 } 6294 if timeout != nil { 6295 queryParameters["timeout"] = autorest.Encode("query", *timeout) 6296 } else { 6297 queryParameters["timeout"] = autorest.Encode("query", 60) 6298 } 6299 6300 preparer := autorest.CreatePreparer( 6301 autorest.AsGet(), 6302 autorest.WithBaseURL(client.BaseURI), 6303 autorest.WithPath("/$/GetClusterManifest"), 6304 autorest.WithQueryParameters(queryParameters)) 6305 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 6306} 6307 6308// GetClusterManifestSender sends the GetClusterManifest request. The method will close the 6309// http.Response Body if it receives an error. 6310func (client BaseClient) GetClusterManifestSender(req *http.Request) (*http.Response, error) { 6311 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 6312} 6313 6314// GetClusterManifestResponder handles the response to the GetClusterManifest request. The method always 6315// closes the http.Response Body. 6316func (client BaseClient) GetClusterManifestResponder(resp *http.Response) (result ClusterManifest, err error) { 6317 err = autorest.Respond( 6318 resp, 6319 azure.WithErrorUnlessStatusCode(http.StatusOK), 6320 autorest.ByUnmarshallingJSON(&result), 6321 autorest.ByClosing()) 6322 result.Response = autorest.Response{Response: resp} 6323 return 6324} 6325 6326// GetClusterUpgradeProgress gets the current progress of the ongoing cluster upgrade. If no upgrade is currently in 6327// progress, get the last state of the previous cluster upgrade. 6328// Parameters: 6329// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 6330// duration that the client is willing to wait for the requested operation to complete. The default value for 6331// this parameter is 60 seconds. 6332func (client BaseClient) GetClusterUpgradeProgress(ctx context.Context, timeout *int64) (result ClusterUpgradeProgressObject, err error) { 6333 if tracing.IsEnabled() { 6334 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetClusterUpgradeProgress") 6335 defer func() { 6336 sc := -1 6337 if result.Response.Response != nil { 6338 sc = result.Response.Response.StatusCode 6339 } 6340 tracing.EndSpan(ctx, sc, err) 6341 }() 6342 } 6343 if err := validation.Validate([]validation.Validation{ 6344 {TargetValue: timeout, 6345 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 6346 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 6347 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 6348 }}}}}); err != nil { 6349 return result, validation.NewError("servicefabric.BaseClient", "GetClusterUpgradeProgress", err.Error()) 6350 } 6351 6352 req, err := client.GetClusterUpgradeProgressPreparer(ctx, timeout) 6353 if err != nil { 6354 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterUpgradeProgress", nil, "Failure preparing request") 6355 return 6356 } 6357 6358 resp, err := client.GetClusterUpgradeProgressSender(req) 6359 if err != nil { 6360 result.Response = autorest.Response{Response: resp} 6361 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterUpgradeProgress", resp, "Failure sending request") 6362 return 6363 } 6364 6365 result, err = client.GetClusterUpgradeProgressResponder(resp) 6366 if err != nil { 6367 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterUpgradeProgress", resp, "Failure responding to request") 6368 return 6369 } 6370 6371 return 6372} 6373 6374// GetClusterUpgradeProgressPreparer prepares the GetClusterUpgradeProgress request. 6375func (client BaseClient) GetClusterUpgradeProgressPreparer(ctx context.Context, timeout *int64) (*http.Request, error) { 6376 const APIVersion = "6.0" 6377 queryParameters := map[string]interface{}{ 6378 "api-version": APIVersion, 6379 } 6380 if timeout != nil { 6381 queryParameters["timeout"] = autorest.Encode("query", *timeout) 6382 } else { 6383 queryParameters["timeout"] = autorest.Encode("query", 60) 6384 } 6385 6386 preparer := autorest.CreatePreparer( 6387 autorest.AsGet(), 6388 autorest.WithBaseURL(client.BaseURI), 6389 autorest.WithPath("/$/GetUpgradeProgress"), 6390 autorest.WithQueryParameters(queryParameters)) 6391 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 6392} 6393 6394// GetClusterUpgradeProgressSender sends the GetClusterUpgradeProgress request. The method will close the 6395// http.Response Body if it receives an error. 6396func (client BaseClient) GetClusterUpgradeProgressSender(req *http.Request) (*http.Response, error) { 6397 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 6398} 6399 6400// GetClusterUpgradeProgressResponder handles the response to the GetClusterUpgradeProgress request. The method always 6401// closes the http.Response Body. 6402func (client BaseClient) GetClusterUpgradeProgressResponder(resp *http.Response) (result ClusterUpgradeProgressObject, err error) { 6403 err = autorest.Respond( 6404 resp, 6405 azure.WithErrorUnlessStatusCode(http.StatusOK), 6406 autorest.ByUnmarshallingJSON(&result), 6407 autorest.ByClosing()) 6408 result.Response = autorest.Response{Response: resp} 6409 return 6410} 6411 6412// GetClusterVersion if a cluster upgrade is happening, then this API will return the lowest (older) version of the 6413// current and target cluster runtime versions. 6414// Parameters: 6415// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 6416// duration that the client is willing to wait for the requested operation to complete. The default value for 6417// this parameter is 60 seconds. 6418func (client BaseClient) GetClusterVersion(ctx context.Context, timeout *int64) (result ClusterVersion, err error) { 6419 if tracing.IsEnabled() { 6420 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetClusterVersion") 6421 defer func() { 6422 sc := -1 6423 if result.Response.Response != nil { 6424 sc = result.Response.Response.StatusCode 6425 } 6426 tracing.EndSpan(ctx, sc, err) 6427 }() 6428 } 6429 if err := validation.Validate([]validation.Validation{ 6430 {TargetValue: timeout, 6431 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 6432 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 6433 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 6434 }}}}}); err != nil { 6435 return result, validation.NewError("servicefabric.BaseClient", "GetClusterVersion", err.Error()) 6436 } 6437 6438 req, err := client.GetClusterVersionPreparer(ctx, timeout) 6439 if err != nil { 6440 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterVersion", nil, "Failure preparing request") 6441 return 6442 } 6443 6444 resp, err := client.GetClusterVersionSender(req) 6445 if err != nil { 6446 result.Response = autorest.Response{Response: resp} 6447 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterVersion", resp, "Failure sending request") 6448 return 6449 } 6450 6451 result, err = client.GetClusterVersionResponder(resp) 6452 if err != nil { 6453 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetClusterVersion", resp, "Failure responding to request") 6454 return 6455 } 6456 6457 return 6458} 6459 6460// GetClusterVersionPreparer prepares the GetClusterVersion request. 6461func (client BaseClient) GetClusterVersionPreparer(ctx context.Context, timeout *int64) (*http.Request, error) { 6462 const APIVersion = "6.4" 6463 queryParameters := map[string]interface{}{ 6464 "api-version": APIVersion, 6465 } 6466 if timeout != nil { 6467 queryParameters["timeout"] = autorest.Encode("query", *timeout) 6468 } else { 6469 queryParameters["timeout"] = autorest.Encode("query", 60) 6470 } 6471 6472 preparer := autorest.CreatePreparer( 6473 autorest.AsGet(), 6474 autorest.WithBaseURL(client.BaseURI), 6475 autorest.WithPath("/$/GetClusterVersion"), 6476 autorest.WithQueryParameters(queryParameters)) 6477 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 6478} 6479 6480// GetClusterVersionSender sends the GetClusterVersion request. The method will close the 6481// http.Response Body if it receives an error. 6482func (client BaseClient) GetClusterVersionSender(req *http.Request) (*http.Response, error) { 6483 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 6484} 6485 6486// GetClusterVersionResponder handles the response to the GetClusterVersion request. The method always 6487// closes the http.Response Body. 6488func (client BaseClient) GetClusterVersionResponder(resp *http.Response) (result ClusterVersion, err error) { 6489 err = autorest.Respond( 6490 resp, 6491 azure.WithErrorUnlessStatusCode(http.StatusOK), 6492 autorest.ByUnmarshallingJSON(&result), 6493 autorest.ByClosing()) 6494 result.Response = autorest.Response{Response: resp} 6495 return 6496} 6497 6498// GetComposeDeploymentStatus returns the status of the compose deployment that was created or in the process of being 6499// created in the Service Fabric cluster and whose name matches the one specified as the parameter. The response 6500// includes the name, status, and other details about the deployment. 6501// Parameters: 6502// deploymentName - the identity of the deployment. 6503// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 6504// duration that the client is willing to wait for the requested operation to complete. The default value for 6505// this parameter is 60 seconds. 6506func (client BaseClient) GetComposeDeploymentStatus(ctx context.Context, deploymentName string, timeout *int64) (result ComposeDeploymentStatusInfo, err error) { 6507 if tracing.IsEnabled() { 6508 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetComposeDeploymentStatus") 6509 defer func() { 6510 sc := -1 6511 if result.Response.Response != nil { 6512 sc = result.Response.Response.StatusCode 6513 } 6514 tracing.EndSpan(ctx, sc, err) 6515 }() 6516 } 6517 if err := validation.Validate([]validation.Validation{ 6518 {TargetValue: timeout, 6519 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 6520 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 6521 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 6522 }}}}}); err != nil { 6523 return result, validation.NewError("servicefabric.BaseClient", "GetComposeDeploymentStatus", err.Error()) 6524 } 6525 6526 req, err := client.GetComposeDeploymentStatusPreparer(ctx, deploymentName, timeout) 6527 if err != nil { 6528 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetComposeDeploymentStatus", nil, "Failure preparing request") 6529 return 6530 } 6531 6532 resp, err := client.GetComposeDeploymentStatusSender(req) 6533 if err != nil { 6534 result.Response = autorest.Response{Response: resp} 6535 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetComposeDeploymentStatus", resp, "Failure sending request") 6536 return 6537 } 6538 6539 result, err = client.GetComposeDeploymentStatusResponder(resp) 6540 if err != nil { 6541 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetComposeDeploymentStatus", resp, "Failure responding to request") 6542 return 6543 } 6544 6545 return 6546} 6547 6548// GetComposeDeploymentStatusPreparer prepares the GetComposeDeploymentStatus request. 6549func (client BaseClient) GetComposeDeploymentStatusPreparer(ctx context.Context, deploymentName string, timeout *int64) (*http.Request, error) { 6550 pathParameters := map[string]interface{}{ 6551 "deploymentName": deploymentName, 6552 } 6553 6554 const APIVersion = "6.0-preview" 6555 queryParameters := map[string]interface{}{ 6556 "api-version": APIVersion, 6557 } 6558 if timeout != nil { 6559 queryParameters["timeout"] = autorest.Encode("query", *timeout) 6560 } else { 6561 queryParameters["timeout"] = autorest.Encode("query", 60) 6562 } 6563 6564 preparer := autorest.CreatePreparer( 6565 autorest.AsGet(), 6566 autorest.WithBaseURL(client.BaseURI), 6567 autorest.WithPathParameters("/ComposeDeployments/{deploymentName}", pathParameters), 6568 autorest.WithQueryParameters(queryParameters)) 6569 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 6570} 6571 6572// GetComposeDeploymentStatusSender sends the GetComposeDeploymentStatus request. The method will close the 6573// http.Response Body if it receives an error. 6574func (client BaseClient) GetComposeDeploymentStatusSender(req *http.Request) (*http.Response, error) { 6575 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 6576} 6577 6578// GetComposeDeploymentStatusResponder handles the response to the GetComposeDeploymentStatus request. The method always 6579// closes the http.Response Body. 6580func (client BaseClient) GetComposeDeploymentStatusResponder(resp *http.Response) (result ComposeDeploymentStatusInfo, err error) { 6581 err = autorest.Respond( 6582 resp, 6583 azure.WithErrorUnlessStatusCode(http.StatusOK), 6584 autorest.ByUnmarshallingJSON(&result), 6585 autorest.ByClosing()) 6586 result.Response = autorest.Response{Response: resp} 6587 return 6588} 6589 6590// GetComposeDeploymentStatusList gets the status about the compose deployments that were created or in the process of 6591// being created in the Service Fabric cluster. The response includes the name, status, and other details about the 6592// compose deployments. If the list of deployments do not fit in a page, one page of results is returned as well as a 6593// continuation token, which can be used to get the next page. 6594// Parameters: 6595// continuationToken - the continuation token parameter is used to obtain next set of results. A continuation 6596// token with a non-empty value is included in the response of the API when the results from the system do not 6597// fit in a single response. When this value is passed to the next API call, the API returns next set of 6598// results. If there are no further results, then the continuation token does not contain a value. The value of 6599// this parameter should not be URL encoded. 6600// maxResults - the maximum number of results to be returned as part of the paged queries. This parameter 6601// defines the upper bound on the number of results returned. The results returned can be less than the 6602// specified maximum results if they do not fit in the message as per the max message size restrictions defined 6603// in the configuration. If this parameter is zero or not specified, the paged query includes as many results 6604// as possible that fit in the return message. 6605// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 6606// duration that the client is willing to wait for the requested operation to complete. The default value for 6607// this parameter is 60 seconds. 6608func (client BaseClient) GetComposeDeploymentStatusList(ctx context.Context, continuationToken string, maxResults *int64, timeout *int64) (result PagedComposeDeploymentStatusInfoList, err error) { 6609 if tracing.IsEnabled() { 6610 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetComposeDeploymentStatusList") 6611 defer func() { 6612 sc := -1 6613 if result.Response.Response != nil { 6614 sc = result.Response.Response.StatusCode 6615 } 6616 tracing.EndSpan(ctx, sc, err) 6617 }() 6618 } 6619 if err := validation.Validate([]validation.Validation{ 6620 {TargetValue: maxResults, 6621 Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false, 6622 Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}}}}}, 6623 {TargetValue: timeout, 6624 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 6625 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 6626 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 6627 }}}}}); err != nil { 6628 return result, validation.NewError("servicefabric.BaseClient", "GetComposeDeploymentStatusList", err.Error()) 6629 } 6630 6631 req, err := client.GetComposeDeploymentStatusListPreparer(ctx, continuationToken, maxResults, timeout) 6632 if err != nil { 6633 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetComposeDeploymentStatusList", nil, "Failure preparing request") 6634 return 6635 } 6636 6637 resp, err := client.GetComposeDeploymentStatusListSender(req) 6638 if err != nil { 6639 result.Response = autorest.Response{Response: resp} 6640 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetComposeDeploymentStatusList", resp, "Failure sending request") 6641 return 6642 } 6643 6644 result, err = client.GetComposeDeploymentStatusListResponder(resp) 6645 if err != nil { 6646 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetComposeDeploymentStatusList", resp, "Failure responding to request") 6647 return 6648 } 6649 6650 return 6651} 6652 6653// GetComposeDeploymentStatusListPreparer prepares the GetComposeDeploymentStatusList request. 6654func (client BaseClient) GetComposeDeploymentStatusListPreparer(ctx context.Context, continuationToken string, maxResults *int64, timeout *int64) (*http.Request, error) { 6655 const APIVersion = "6.0-preview" 6656 queryParameters := map[string]interface{}{ 6657 "api-version": APIVersion, 6658 } 6659 if len(continuationToken) > 0 { 6660 queryParameters["ContinuationToken"] = continuationToken 6661 } 6662 if maxResults != nil { 6663 queryParameters["MaxResults"] = autorest.Encode("query", *maxResults) 6664 } else { 6665 queryParameters["MaxResults"] = autorest.Encode("query", 0) 6666 } 6667 if timeout != nil { 6668 queryParameters["timeout"] = autorest.Encode("query", *timeout) 6669 } else { 6670 queryParameters["timeout"] = autorest.Encode("query", 60) 6671 } 6672 6673 preparer := autorest.CreatePreparer( 6674 autorest.AsGet(), 6675 autorest.WithBaseURL(client.BaseURI), 6676 autorest.WithPath("/ComposeDeployments"), 6677 autorest.WithQueryParameters(queryParameters)) 6678 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 6679} 6680 6681// GetComposeDeploymentStatusListSender sends the GetComposeDeploymentStatusList request. The method will close the 6682// http.Response Body if it receives an error. 6683func (client BaseClient) GetComposeDeploymentStatusListSender(req *http.Request) (*http.Response, error) { 6684 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 6685} 6686 6687// GetComposeDeploymentStatusListResponder handles the response to the GetComposeDeploymentStatusList request. The method always 6688// closes the http.Response Body. 6689func (client BaseClient) GetComposeDeploymentStatusListResponder(resp *http.Response) (result PagedComposeDeploymentStatusInfoList, err error) { 6690 err = autorest.Respond( 6691 resp, 6692 azure.WithErrorUnlessStatusCode(http.StatusOK), 6693 autorest.ByUnmarshallingJSON(&result), 6694 autorest.ByClosing()) 6695 result.Response = autorest.Response{Response: resp} 6696 return 6697} 6698 6699// GetComposeDeploymentUpgradeProgress returns the information about the state of the compose deployment upgrade along 6700// with details to aid debugging application health issues. 6701// Parameters: 6702// deploymentName - the identity of the deployment. 6703// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 6704// duration that the client is willing to wait for the requested operation to complete. The default value for 6705// this parameter is 60 seconds. 6706func (client BaseClient) GetComposeDeploymentUpgradeProgress(ctx context.Context, deploymentName string, timeout *int64) (result ComposeDeploymentUpgradeProgressInfo, err error) { 6707 if tracing.IsEnabled() { 6708 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetComposeDeploymentUpgradeProgress") 6709 defer func() { 6710 sc := -1 6711 if result.Response.Response != nil { 6712 sc = result.Response.Response.StatusCode 6713 } 6714 tracing.EndSpan(ctx, sc, err) 6715 }() 6716 } 6717 if err := validation.Validate([]validation.Validation{ 6718 {TargetValue: timeout, 6719 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 6720 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 6721 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 6722 }}}}}); err != nil { 6723 return result, validation.NewError("servicefabric.BaseClient", "GetComposeDeploymentUpgradeProgress", err.Error()) 6724 } 6725 6726 req, err := client.GetComposeDeploymentUpgradeProgressPreparer(ctx, deploymentName, timeout) 6727 if err != nil { 6728 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetComposeDeploymentUpgradeProgress", nil, "Failure preparing request") 6729 return 6730 } 6731 6732 resp, err := client.GetComposeDeploymentUpgradeProgressSender(req) 6733 if err != nil { 6734 result.Response = autorest.Response{Response: resp} 6735 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetComposeDeploymentUpgradeProgress", resp, "Failure sending request") 6736 return 6737 } 6738 6739 result, err = client.GetComposeDeploymentUpgradeProgressResponder(resp) 6740 if err != nil { 6741 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetComposeDeploymentUpgradeProgress", resp, "Failure responding to request") 6742 return 6743 } 6744 6745 return 6746} 6747 6748// GetComposeDeploymentUpgradeProgressPreparer prepares the GetComposeDeploymentUpgradeProgress request. 6749func (client BaseClient) GetComposeDeploymentUpgradeProgressPreparer(ctx context.Context, deploymentName string, timeout *int64) (*http.Request, error) { 6750 pathParameters := map[string]interface{}{ 6751 "deploymentName": deploymentName, 6752 } 6753 6754 const APIVersion = "6.0-preview" 6755 queryParameters := map[string]interface{}{ 6756 "api-version": APIVersion, 6757 } 6758 if timeout != nil { 6759 queryParameters["timeout"] = autorest.Encode("query", *timeout) 6760 } else { 6761 queryParameters["timeout"] = autorest.Encode("query", 60) 6762 } 6763 6764 preparer := autorest.CreatePreparer( 6765 autorest.AsGet(), 6766 autorest.WithBaseURL(client.BaseURI), 6767 autorest.WithPathParameters("/ComposeDeployments/{deploymentName}/$/GetUpgradeProgress", pathParameters), 6768 autorest.WithQueryParameters(queryParameters)) 6769 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 6770} 6771 6772// GetComposeDeploymentUpgradeProgressSender sends the GetComposeDeploymentUpgradeProgress request. The method will close the 6773// http.Response Body if it receives an error. 6774func (client BaseClient) GetComposeDeploymentUpgradeProgressSender(req *http.Request) (*http.Response, error) { 6775 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 6776} 6777 6778// GetComposeDeploymentUpgradeProgressResponder handles the response to the GetComposeDeploymentUpgradeProgress request. The method always 6779// closes the http.Response Body. 6780func (client BaseClient) GetComposeDeploymentUpgradeProgressResponder(resp *http.Response) (result ComposeDeploymentUpgradeProgressInfo, err error) { 6781 err = autorest.Respond( 6782 resp, 6783 azure.WithErrorUnlessStatusCode(http.StatusOK), 6784 autorest.ByUnmarshallingJSON(&result), 6785 autorest.ByClosing()) 6786 result.Response = autorest.Response{Response: resp} 6787 return 6788} 6789 6790// GetContainerLogsDeployedOnNode gets the container logs for container deployed on a Service Fabric node for the given 6791// code package. 6792// Parameters: 6793// nodeName - the name of the node. 6794// applicationID - the identity of the application. This is typically the full name of the application without 6795// the 'fabric:' URI scheme. 6796// Starting from version 6.0, hierarchical names are delimited with the "~" character. 6797// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" 6798// in 6.0+ and "myapp/app1" in previous versions. 6799// serviceManifestName - the name of a service manifest registered as part of an application type in a Service 6800// Fabric cluster. 6801// codePackageName - the name of code package specified in service manifest registered as part of an 6802// application type in a Service Fabric cluster. 6803// tail - number of lines to show from the end of the logs. Default is 100. 'all' to show the complete logs. 6804// previous - specifies whether to get container logs from exited/dead containers of the code package instance. 6805// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 6806// duration that the client is willing to wait for the requested operation to complete. The default value for 6807// this parameter is 60 seconds. 6808func (client BaseClient) GetContainerLogsDeployedOnNode(ctx context.Context, nodeName string, applicationID string, serviceManifestName string, codePackageName string, tail string, previous *bool, timeout *int64) (result ContainerLogs, err error) { 6809 if tracing.IsEnabled() { 6810 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetContainerLogsDeployedOnNode") 6811 defer func() { 6812 sc := -1 6813 if result.Response.Response != nil { 6814 sc = result.Response.Response.StatusCode 6815 } 6816 tracing.EndSpan(ctx, sc, err) 6817 }() 6818 } 6819 if err := validation.Validate([]validation.Validation{ 6820 {TargetValue: timeout, 6821 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 6822 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 6823 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 6824 }}}}}); err != nil { 6825 return result, validation.NewError("servicefabric.BaseClient", "GetContainerLogsDeployedOnNode", err.Error()) 6826 } 6827 6828 req, err := client.GetContainerLogsDeployedOnNodePreparer(ctx, nodeName, applicationID, serviceManifestName, codePackageName, tail, previous, timeout) 6829 if err != nil { 6830 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetContainerLogsDeployedOnNode", nil, "Failure preparing request") 6831 return 6832 } 6833 6834 resp, err := client.GetContainerLogsDeployedOnNodeSender(req) 6835 if err != nil { 6836 result.Response = autorest.Response{Response: resp} 6837 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetContainerLogsDeployedOnNode", resp, "Failure sending request") 6838 return 6839 } 6840 6841 result, err = client.GetContainerLogsDeployedOnNodeResponder(resp) 6842 if err != nil { 6843 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetContainerLogsDeployedOnNode", resp, "Failure responding to request") 6844 return 6845 } 6846 6847 return 6848} 6849 6850// GetContainerLogsDeployedOnNodePreparer prepares the GetContainerLogsDeployedOnNode request. 6851func (client BaseClient) GetContainerLogsDeployedOnNodePreparer(ctx context.Context, nodeName string, applicationID string, serviceManifestName string, codePackageName string, tail string, previous *bool, timeout *int64) (*http.Request, error) { 6852 pathParameters := map[string]interface{}{ 6853 "applicationId": applicationID, 6854 "nodeName": autorest.Encode("path", nodeName), 6855 } 6856 6857 const APIVersion = "6.2" 6858 queryParameters := map[string]interface{}{ 6859 "api-version": APIVersion, 6860 "CodePackageName": autorest.Encode("query", codePackageName), 6861 "ServiceManifestName": autorest.Encode("query", serviceManifestName), 6862 } 6863 if len(tail) > 0 { 6864 queryParameters["Tail"] = autorest.Encode("query", tail) 6865 } 6866 if previous != nil { 6867 queryParameters["Previous"] = autorest.Encode("query", *previous) 6868 } else { 6869 queryParameters["Previous"] = autorest.Encode("query", false) 6870 } 6871 if timeout != nil { 6872 queryParameters["timeout"] = autorest.Encode("query", *timeout) 6873 } else { 6874 queryParameters["timeout"] = autorest.Encode("query", 60) 6875 } 6876 6877 preparer := autorest.CreatePreparer( 6878 autorest.AsGet(), 6879 autorest.WithBaseURL(client.BaseURI), 6880 autorest.WithPathParameters("/Nodes/{nodeName}/$/GetApplications/{applicationId}/$/GetCodePackages/$/ContainerLogs", pathParameters), 6881 autorest.WithQueryParameters(queryParameters)) 6882 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 6883} 6884 6885// GetContainerLogsDeployedOnNodeSender sends the GetContainerLogsDeployedOnNode request. The method will close the 6886// http.Response Body if it receives an error. 6887func (client BaseClient) GetContainerLogsDeployedOnNodeSender(req *http.Request) (*http.Response, error) { 6888 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 6889} 6890 6891// GetContainerLogsDeployedOnNodeResponder handles the response to the GetContainerLogsDeployedOnNode request. The method always 6892// closes the http.Response Body. 6893func (client BaseClient) GetContainerLogsDeployedOnNodeResponder(resp *http.Response) (result ContainerLogs, err error) { 6894 err = autorest.Respond( 6895 resp, 6896 azure.WithErrorUnlessStatusCode(http.StatusOK), 6897 autorest.ByUnmarshallingJSON(&result), 6898 autorest.ByClosing()) 6899 result.Response = autorest.Response{Response: resp} 6900 return 6901} 6902 6903// GetContainersEventList the response is list of ContainerInstanceEvent objects. 6904// Parameters: 6905// startTimeUtc - the start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. 6906// endTimeUtc - the end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. 6907// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 6908// duration that the client is willing to wait for the requested operation to complete. The default value for 6909// this parameter is 60 seconds. 6910// eventsTypesFilter - this is a comma separated string specifying the types of FabricEvents that should only 6911// be included in the response. 6912// excludeAnalysisEvents - this param disables the retrieval of AnalysisEvents if true is passed. 6913// skipCorrelationLookup - this param disables the search of CorrelatedEvents information if true is passed. 6914// otherwise the CorrelationEvents get processed and HasCorrelatedEvents field in every FabricEvent gets 6915// populated. 6916func (client BaseClient) GetContainersEventList(ctx context.Context, startTimeUtc string, endTimeUtc string, timeout *int64, eventsTypesFilter string, excludeAnalysisEvents *bool, skipCorrelationLookup *bool) (result ListContainerInstanceEvent, err error) { 6917 if tracing.IsEnabled() { 6918 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetContainersEventList") 6919 defer func() { 6920 sc := -1 6921 if result.Response.Response != nil { 6922 sc = result.Response.Response.StatusCode 6923 } 6924 tracing.EndSpan(ctx, sc, err) 6925 }() 6926 } 6927 if err := validation.Validate([]validation.Validation{ 6928 {TargetValue: timeout, 6929 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 6930 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 6931 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 6932 }}}}}); err != nil { 6933 return result, validation.NewError("servicefabric.BaseClient", "GetContainersEventList", err.Error()) 6934 } 6935 6936 req, err := client.GetContainersEventListPreparer(ctx, startTimeUtc, endTimeUtc, timeout, eventsTypesFilter, excludeAnalysisEvents, skipCorrelationLookup) 6937 if err != nil { 6938 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetContainersEventList", nil, "Failure preparing request") 6939 return 6940 } 6941 6942 resp, err := client.GetContainersEventListSender(req) 6943 if err != nil { 6944 result.Response = autorest.Response{Response: resp} 6945 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetContainersEventList", resp, "Failure sending request") 6946 return 6947 } 6948 6949 result, err = client.GetContainersEventListResponder(resp) 6950 if err != nil { 6951 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetContainersEventList", resp, "Failure responding to request") 6952 return 6953 } 6954 6955 return 6956} 6957 6958// GetContainersEventListPreparer prepares the GetContainersEventList request. 6959func (client BaseClient) GetContainersEventListPreparer(ctx context.Context, startTimeUtc string, endTimeUtc string, timeout *int64, eventsTypesFilter string, excludeAnalysisEvents *bool, skipCorrelationLookup *bool) (*http.Request, error) { 6960 const APIVersion = "6.2-preview" 6961 queryParameters := map[string]interface{}{ 6962 "api-version": APIVersion, 6963 "EndTimeUtc": autorest.Encode("query", endTimeUtc), 6964 "StartTimeUtc": autorest.Encode("query", startTimeUtc), 6965 } 6966 if timeout != nil { 6967 queryParameters["timeout"] = autorest.Encode("query", *timeout) 6968 } else { 6969 queryParameters["timeout"] = autorest.Encode("query", 60) 6970 } 6971 if len(eventsTypesFilter) > 0 { 6972 queryParameters["EventsTypesFilter"] = autorest.Encode("query", eventsTypesFilter) 6973 } 6974 if excludeAnalysisEvents != nil { 6975 queryParameters["ExcludeAnalysisEvents"] = autorest.Encode("query", *excludeAnalysisEvents) 6976 } 6977 if skipCorrelationLookup != nil { 6978 queryParameters["SkipCorrelationLookup"] = autorest.Encode("query", *skipCorrelationLookup) 6979 } 6980 6981 preparer := autorest.CreatePreparer( 6982 autorest.AsGet(), 6983 autorest.WithBaseURL(client.BaseURI), 6984 autorest.WithPath("/EventsStore/Containers/Events"), 6985 autorest.WithQueryParameters(queryParameters)) 6986 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 6987} 6988 6989// GetContainersEventListSender sends the GetContainersEventList request. The method will close the 6990// http.Response Body if it receives an error. 6991func (client BaseClient) GetContainersEventListSender(req *http.Request) (*http.Response, error) { 6992 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 6993} 6994 6995// GetContainersEventListResponder handles the response to the GetContainersEventList request. The method always 6996// closes the http.Response Body. 6997func (client BaseClient) GetContainersEventListResponder(resp *http.Response) (result ListContainerInstanceEvent, err error) { 6998 err = autorest.Respond( 6999 resp, 7000 azure.WithErrorUnlessStatusCode(http.StatusOK), 7001 autorest.ByUnmarshallingJSON(&result.Value), 7002 autorest.ByClosing()) 7003 result.Response = autorest.Response{Response: resp} 7004 return 7005} 7006 7007// GetCorrelatedEventList the response is list of FabricEvents. 7008// Parameters: 7009// eventInstanceID - the EventInstanceId. 7010// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 7011// duration that the client is willing to wait for the requested operation to complete. The default value for 7012// this parameter is 60 seconds. 7013func (client BaseClient) GetCorrelatedEventList(ctx context.Context, eventInstanceID string, timeout *int64) (result ListFabricEvent, err error) { 7014 if tracing.IsEnabled() { 7015 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetCorrelatedEventList") 7016 defer func() { 7017 sc := -1 7018 if result.Response.Response != nil { 7019 sc = result.Response.Response.StatusCode 7020 } 7021 tracing.EndSpan(ctx, sc, err) 7022 }() 7023 } 7024 if err := validation.Validate([]validation.Validation{ 7025 {TargetValue: timeout, 7026 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 7027 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 7028 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 7029 }}}}}); err != nil { 7030 return result, validation.NewError("servicefabric.BaseClient", "GetCorrelatedEventList", err.Error()) 7031 } 7032 7033 req, err := client.GetCorrelatedEventListPreparer(ctx, eventInstanceID, timeout) 7034 if err != nil { 7035 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetCorrelatedEventList", nil, "Failure preparing request") 7036 return 7037 } 7038 7039 resp, err := client.GetCorrelatedEventListSender(req) 7040 if err != nil { 7041 result.Response = autorest.Response{Response: resp} 7042 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetCorrelatedEventList", resp, "Failure sending request") 7043 return 7044 } 7045 7046 result, err = client.GetCorrelatedEventListResponder(resp) 7047 if err != nil { 7048 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetCorrelatedEventList", resp, "Failure responding to request") 7049 return 7050 } 7051 7052 return 7053} 7054 7055// GetCorrelatedEventListPreparer prepares the GetCorrelatedEventList request. 7056func (client BaseClient) GetCorrelatedEventListPreparer(ctx context.Context, eventInstanceID string, timeout *int64) (*http.Request, error) { 7057 pathParameters := map[string]interface{}{ 7058 "eventInstanceId": autorest.Encode("path", eventInstanceID), 7059 } 7060 7061 const APIVersion = "6.4" 7062 queryParameters := map[string]interface{}{ 7063 "api-version": APIVersion, 7064 } 7065 if timeout != nil { 7066 queryParameters["timeout"] = autorest.Encode("query", *timeout) 7067 } else { 7068 queryParameters["timeout"] = autorest.Encode("query", 60) 7069 } 7070 7071 preparer := autorest.CreatePreparer( 7072 autorest.AsGet(), 7073 autorest.WithBaseURL(client.BaseURI), 7074 autorest.WithPathParameters("/EventsStore/CorrelatedEvents/{eventInstanceId}/$/Events", pathParameters), 7075 autorest.WithQueryParameters(queryParameters)) 7076 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 7077} 7078 7079// GetCorrelatedEventListSender sends the GetCorrelatedEventList request. The method will close the 7080// http.Response Body if it receives an error. 7081func (client BaseClient) GetCorrelatedEventListSender(req *http.Request) (*http.Response, error) { 7082 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 7083} 7084 7085// GetCorrelatedEventListResponder handles the response to the GetCorrelatedEventList request. The method always 7086// closes the http.Response Body. 7087func (client BaseClient) GetCorrelatedEventListResponder(resp *http.Response) (result ListFabricEvent, err error) { 7088 err = autorest.Respond( 7089 resp, 7090 azure.WithErrorUnlessStatusCode(http.StatusOK), 7091 autorest.ByUnmarshallingJSON(&result), 7092 autorest.ByClosing()) 7093 result.Response = autorest.Response{Response: resp} 7094 return 7095} 7096 7097// GetDataLossProgress gets the progress of a data loss operation started with StartDataLoss, using the OperationId. 7098// Parameters: 7099// serviceID - the identity of the service. This ID is typically the full name of the service without the 7100// 'fabric:' URI scheme. 7101// Starting from version 6.0, hierarchical names are delimited with the "~" character. 7102// For example, if the service name is "fabric:/myapp/app1/svc1", the service identity would be 7103// "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in previous versions. 7104// partitionID - the identity of the partition. 7105// operationID - a GUID that identifies a call of this API. This is passed into the corresponding GetProgress 7106// API 7107// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 7108// duration that the client is willing to wait for the requested operation to complete. The default value for 7109// this parameter is 60 seconds. 7110func (client BaseClient) GetDataLossProgress(ctx context.Context, serviceID string, partitionID uuid.UUID, operationID uuid.UUID, timeout *int64) (result PartitionDataLossProgress, err error) { 7111 if tracing.IsEnabled() { 7112 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetDataLossProgress") 7113 defer func() { 7114 sc := -1 7115 if result.Response.Response != nil { 7116 sc = result.Response.Response.StatusCode 7117 } 7118 tracing.EndSpan(ctx, sc, err) 7119 }() 7120 } 7121 if err := validation.Validate([]validation.Validation{ 7122 {TargetValue: timeout, 7123 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 7124 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 7125 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 7126 }}}}}); err != nil { 7127 return result, validation.NewError("servicefabric.BaseClient", "GetDataLossProgress", err.Error()) 7128 } 7129 7130 req, err := client.GetDataLossProgressPreparer(ctx, serviceID, partitionID, operationID, timeout) 7131 if err != nil { 7132 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDataLossProgress", nil, "Failure preparing request") 7133 return 7134 } 7135 7136 resp, err := client.GetDataLossProgressSender(req) 7137 if err != nil { 7138 result.Response = autorest.Response{Response: resp} 7139 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDataLossProgress", resp, "Failure sending request") 7140 return 7141 } 7142 7143 result, err = client.GetDataLossProgressResponder(resp) 7144 if err != nil { 7145 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDataLossProgress", resp, "Failure responding to request") 7146 return 7147 } 7148 7149 return 7150} 7151 7152// GetDataLossProgressPreparer prepares the GetDataLossProgress request. 7153func (client BaseClient) GetDataLossProgressPreparer(ctx context.Context, serviceID string, partitionID uuid.UUID, operationID uuid.UUID, timeout *int64) (*http.Request, error) { 7154 pathParameters := map[string]interface{}{ 7155 "partitionId": partitionID, 7156 "serviceId": serviceID, 7157 } 7158 7159 const APIVersion = "6.0" 7160 queryParameters := map[string]interface{}{ 7161 "api-version": APIVersion, 7162 "OperationId": autorest.Encode("query", operationID), 7163 } 7164 if timeout != nil { 7165 queryParameters["timeout"] = autorest.Encode("query", *timeout) 7166 } else { 7167 queryParameters["timeout"] = autorest.Encode("query", 60) 7168 } 7169 7170 preparer := autorest.CreatePreparer( 7171 autorest.AsGet(), 7172 autorest.WithBaseURL(client.BaseURI), 7173 autorest.WithPathParameters("/Faults/Services/{serviceId}/$/GetPartitions/{partitionId}/$/GetDataLossProgress", pathParameters), 7174 autorest.WithQueryParameters(queryParameters)) 7175 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 7176} 7177 7178// GetDataLossProgressSender sends the GetDataLossProgress request. The method will close the 7179// http.Response Body if it receives an error. 7180func (client BaseClient) GetDataLossProgressSender(req *http.Request) (*http.Response, error) { 7181 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 7182} 7183 7184// GetDataLossProgressResponder handles the response to the GetDataLossProgress request. The method always 7185// closes the http.Response Body. 7186func (client BaseClient) GetDataLossProgressResponder(resp *http.Response) (result PartitionDataLossProgress, err error) { 7187 err = autorest.Respond( 7188 resp, 7189 azure.WithErrorUnlessStatusCode(http.StatusOK), 7190 autorest.ByUnmarshallingJSON(&result), 7191 autorest.ByClosing()) 7192 result.Response = autorest.Response{Response: resp} 7193 return 7194} 7195 7196// GetDeployedApplicationHealth gets the information about health of an application deployed on a Service Fabric node. 7197// Use EventsHealthStateFilter to optionally filter for the collection of HealthEvent objects reported on the deployed 7198// application based on health state. Use DeployedServicePackagesHealthStateFilter to optionally filter for 7199// DeployedServicePackageHealth children based on health state. 7200// Parameters: 7201// nodeName - the name of the node. 7202// applicationID - the identity of the application. This is typically the full name of the application without 7203// the 'fabric:' URI scheme. 7204// Starting from version 6.0, hierarchical names are delimited with the "~" character. 7205// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" 7206// in 6.0+ and "myapp/app1" in previous versions. 7207// eventsHealthStateFilter - allows filtering the collection of HealthEvent objects returned based on health 7208// state. 7209// The possible values for this parameter include integer value of one of the following health states. 7210// Only events that match the filter are returned. All events are used to evaluate the aggregated health state. 7211// If not specified, all entries are returned. The state values are flag-based enumeration, so the value could 7212// be a combination of these values, obtained using the bitwise 'OR' operator. For example, If the provided 7213// value is 6 then all of the events with HealthState value of OK (2) and Warning (4) are returned. 7214// 7215// - Default - Default value. Matches any HealthState. The value is zero. 7216// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given 7217// collection of states. The value is 1. 7218// - Ok - Filter that matches input with HealthState value Ok. The value is 2. 7219// - Warning - Filter that matches input with HealthState value Warning. The value is 4. 7220// - Error - Filter that matches input with HealthState value Error. The value is 8. 7221// - All - Filter that matches input with any HealthState value. The value is 65535. 7222// deployedServicePackagesHealthStateFilter - allows filtering of the deployed service package health state 7223// objects returned in the result of deployed application health query based on their health state. 7224// The possible values for this parameter include integer value of one of the following health states. 7225// Only deployed service packages that match the filter are returned. All deployed service packages are used to 7226// evaluate the aggregated health state of the deployed application. 7227// If not specified, all entries are returned. 7228// The state values are flag-based enumeration, so the value can be a combination of these values, obtained 7229// using the bitwise 'OR' operator. 7230// For example, if the provided value is 6 then health state of service packages with HealthState value of OK 7231// (2) and Warning (4) are returned. 7232// 7233// - Default - Default value. Matches any HealthState. The value is zero. 7234// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given 7235// collection of states. The value is 1. 7236// - Ok - Filter that matches input with HealthState value Ok. The value is 2. 7237// - Warning - Filter that matches input with HealthState value Warning. The value is 4. 7238// - Error - Filter that matches input with HealthState value Error. The value is 8. 7239// - All - Filter that matches input with any HealthState value. The value is 65535. 7240// excludeHealthStatistics - indicates whether the health statistics should be returned as part of the query 7241// result. False by default. 7242// The statistics show the number of children entities in health state Ok, Warning, and Error. 7243// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 7244// duration that the client is willing to wait for the requested operation to complete. The default value for 7245// this parameter is 60 seconds. 7246func (client BaseClient) GetDeployedApplicationHealth(ctx context.Context, nodeName string, applicationID string, eventsHealthStateFilter *int32, deployedServicePackagesHealthStateFilter *int32, excludeHealthStatistics *bool, timeout *int64) (result DeployedApplicationHealth, err error) { 7247 if tracing.IsEnabled() { 7248 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetDeployedApplicationHealth") 7249 defer func() { 7250 sc := -1 7251 if result.Response.Response != nil { 7252 sc = result.Response.Response.StatusCode 7253 } 7254 tracing.EndSpan(ctx, sc, err) 7255 }() 7256 } 7257 if err := validation.Validate([]validation.Validation{ 7258 {TargetValue: timeout, 7259 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 7260 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 7261 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 7262 }}}}}); err != nil { 7263 return result, validation.NewError("servicefabric.BaseClient", "GetDeployedApplicationHealth", err.Error()) 7264 } 7265 7266 req, err := client.GetDeployedApplicationHealthPreparer(ctx, nodeName, applicationID, eventsHealthStateFilter, deployedServicePackagesHealthStateFilter, excludeHealthStatistics, timeout) 7267 if err != nil { 7268 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedApplicationHealth", nil, "Failure preparing request") 7269 return 7270 } 7271 7272 resp, err := client.GetDeployedApplicationHealthSender(req) 7273 if err != nil { 7274 result.Response = autorest.Response{Response: resp} 7275 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedApplicationHealth", resp, "Failure sending request") 7276 return 7277 } 7278 7279 result, err = client.GetDeployedApplicationHealthResponder(resp) 7280 if err != nil { 7281 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedApplicationHealth", resp, "Failure responding to request") 7282 return 7283 } 7284 7285 return 7286} 7287 7288// GetDeployedApplicationHealthPreparer prepares the GetDeployedApplicationHealth request. 7289func (client BaseClient) GetDeployedApplicationHealthPreparer(ctx context.Context, nodeName string, applicationID string, eventsHealthStateFilter *int32, deployedServicePackagesHealthStateFilter *int32, excludeHealthStatistics *bool, timeout *int64) (*http.Request, error) { 7290 pathParameters := map[string]interface{}{ 7291 "applicationId": applicationID, 7292 "nodeName": autorest.Encode("path", nodeName), 7293 } 7294 7295 const APIVersion = "6.0" 7296 queryParameters := map[string]interface{}{ 7297 "api-version": APIVersion, 7298 } 7299 if eventsHealthStateFilter != nil { 7300 queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", *eventsHealthStateFilter) 7301 } else { 7302 queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", 0) 7303 } 7304 if deployedServicePackagesHealthStateFilter != nil { 7305 queryParameters["DeployedServicePackagesHealthStateFilter"] = autorest.Encode("query", *deployedServicePackagesHealthStateFilter) 7306 } else { 7307 queryParameters["DeployedServicePackagesHealthStateFilter"] = autorest.Encode("query", 0) 7308 } 7309 if excludeHealthStatistics != nil { 7310 queryParameters["ExcludeHealthStatistics"] = autorest.Encode("query", *excludeHealthStatistics) 7311 } else { 7312 queryParameters["ExcludeHealthStatistics"] = autorest.Encode("query", false) 7313 } 7314 if timeout != nil { 7315 queryParameters["timeout"] = autorest.Encode("query", *timeout) 7316 } else { 7317 queryParameters["timeout"] = autorest.Encode("query", 60) 7318 } 7319 7320 preparer := autorest.CreatePreparer( 7321 autorest.AsGet(), 7322 autorest.WithBaseURL(client.BaseURI), 7323 autorest.WithPathParameters("/Nodes/{nodeName}/$/GetApplications/{applicationId}/$/GetHealth", pathParameters), 7324 autorest.WithQueryParameters(queryParameters)) 7325 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 7326} 7327 7328// GetDeployedApplicationHealthSender sends the GetDeployedApplicationHealth request. The method will close the 7329// http.Response Body if it receives an error. 7330func (client BaseClient) GetDeployedApplicationHealthSender(req *http.Request) (*http.Response, error) { 7331 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 7332} 7333 7334// GetDeployedApplicationHealthResponder handles the response to the GetDeployedApplicationHealth request. The method always 7335// closes the http.Response Body. 7336func (client BaseClient) GetDeployedApplicationHealthResponder(resp *http.Response) (result DeployedApplicationHealth, err error) { 7337 err = autorest.Respond( 7338 resp, 7339 azure.WithErrorUnlessStatusCode(http.StatusOK), 7340 autorest.ByUnmarshallingJSON(&result), 7341 autorest.ByClosing()) 7342 result.Response = autorest.Response{Response: resp} 7343 return 7344} 7345 7346// GetDeployedApplicationHealthUsingPolicy gets the information about health of an application deployed on a Service 7347// Fabric node using the specified policy. Use EventsHealthStateFilter to optionally filter for the collection of 7348// HealthEvent objects reported on the deployed application based on health state. Use 7349// DeployedServicePackagesHealthStateFilter to optionally filter for DeployedServicePackageHealth children based on 7350// health state. Use ApplicationHealthPolicy to optionally override the health policies used to evaluate the health. 7351// This API only uses 'ConsiderWarningAsError' field of the ApplicationHealthPolicy. The rest of the fields are ignored 7352// while evaluating the health of the deployed application. 7353// Parameters: 7354// nodeName - the name of the node. 7355// applicationID - the identity of the application. This is typically the full name of the application without 7356// the 'fabric:' URI scheme. 7357// Starting from version 6.0, hierarchical names are delimited with the "~" character. 7358// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" 7359// in 6.0+ and "myapp/app1" in previous versions. 7360// eventsHealthStateFilter - allows filtering the collection of HealthEvent objects returned based on health 7361// state. 7362// The possible values for this parameter include integer value of one of the following health states. 7363// Only events that match the filter are returned. All events are used to evaluate the aggregated health state. 7364// If not specified, all entries are returned. The state values are flag-based enumeration, so the value could 7365// be a combination of these values, obtained using the bitwise 'OR' operator. For example, If the provided 7366// value is 6 then all of the events with HealthState value of OK (2) and Warning (4) are returned. 7367// 7368// - Default - Default value. Matches any HealthState. The value is zero. 7369// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given 7370// collection of states. The value is 1. 7371// - Ok - Filter that matches input with HealthState value Ok. The value is 2. 7372// - Warning - Filter that matches input with HealthState value Warning. The value is 4. 7373// - Error - Filter that matches input with HealthState value Error. The value is 8. 7374// - All - Filter that matches input with any HealthState value. The value is 65535. 7375// deployedServicePackagesHealthStateFilter - allows filtering of the deployed service package health state 7376// objects returned in the result of deployed application health query based on their health state. 7377// The possible values for this parameter include integer value of one of the following health states. 7378// Only deployed service packages that match the filter are returned. All deployed service packages are used to 7379// evaluate the aggregated health state of the deployed application. 7380// If not specified, all entries are returned. 7381// The state values are flag-based enumeration, so the value can be a combination of these values, obtained 7382// using the bitwise 'OR' operator. 7383// For example, if the provided value is 6 then health state of service packages with HealthState value of OK 7384// (2) and Warning (4) are returned. 7385// 7386// - Default - Default value. Matches any HealthState. The value is zero. 7387// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given 7388// collection of states. The value is 1. 7389// - Ok - Filter that matches input with HealthState value Ok. The value is 2. 7390// - Warning - Filter that matches input with HealthState value Warning. The value is 4. 7391// - Error - Filter that matches input with HealthState value Error. The value is 8. 7392// - All - Filter that matches input with any HealthState value. The value is 65535. 7393// applicationHealthPolicy - describes the health policies used to evaluate the health of an application or one 7394// of its children. 7395// If not present, the health evaluation uses the health policy from application manifest or the default health 7396// policy. 7397// excludeHealthStatistics - indicates whether the health statistics should be returned as part of the query 7398// result. False by default. 7399// The statistics show the number of children entities in health state Ok, Warning, and Error. 7400// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 7401// duration that the client is willing to wait for the requested operation to complete. The default value for 7402// this parameter is 60 seconds. 7403func (client BaseClient) GetDeployedApplicationHealthUsingPolicy(ctx context.Context, nodeName string, applicationID string, eventsHealthStateFilter *int32, deployedServicePackagesHealthStateFilter *int32, applicationHealthPolicy *ApplicationHealthPolicy, excludeHealthStatistics *bool, timeout *int64) (result DeployedApplicationHealth, err error) { 7404 if tracing.IsEnabled() { 7405 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetDeployedApplicationHealthUsingPolicy") 7406 defer func() { 7407 sc := -1 7408 if result.Response.Response != nil { 7409 sc = result.Response.Response.StatusCode 7410 } 7411 tracing.EndSpan(ctx, sc, err) 7412 }() 7413 } 7414 if err := validation.Validate([]validation.Validation{ 7415 {TargetValue: timeout, 7416 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 7417 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 7418 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 7419 }}}}}); err != nil { 7420 return result, validation.NewError("servicefabric.BaseClient", "GetDeployedApplicationHealthUsingPolicy", err.Error()) 7421 } 7422 7423 req, err := client.GetDeployedApplicationHealthUsingPolicyPreparer(ctx, nodeName, applicationID, eventsHealthStateFilter, deployedServicePackagesHealthStateFilter, applicationHealthPolicy, excludeHealthStatistics, timeout) 7424 if err != nil { 7425 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedApplicationHealthUsingPolicy", nil, "Failure preparing request") 7426 return 7427 } 7428 7429 resp, err := client.GetDeployedApplicationHealthUsingPolicySender(req) 7430 if err != nil { 7431 result.Response = autorest.Response{Response: resp} 7432 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedApplicationHealthUsingPolicy", resp, "Failure sending request") 7433 return 7434 } 7435 7436 result, err = client.GetDeployedApplicationHealthUsingPolicyResponder(resp) 7437 if err != nil { 7438 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedApplicationHealthUsingPolicy", resp, "Failure responding to request") 7439 return 7440 } 7441 7442 return 7443} 7444 7445// GetDeployedApplicationHealthUsingPolicyPreparer prepares the GetDeployedApplicationHealthUsingPolicy request. 7446func (client BaseClient) GetDeployedApplicationHealthUsingPolicyPreparer(ctx context.Context, nodeName string, applicationID string, eventsHealthStateFilter *int32, deployedServicePackagesHealthStateFilter *int32, applicationHealthPolicy *ApplicationHealthPolicy, excludeHealthStatistics *bool, timeout *int64) (*http.Request, error) { 7447 pathParameters := map[string]interface{}{ 7448 "applicationId": applicationID, 7449 "nodeName": autorest.Encode("path", nodeName), 7450 } 7451 7452 const APIVersion = "6.0" 7453 queryParameters := map[string]interface{}{ 7454 "api-version": APIVersion, 7455 } 7456 if eventsHealthStateFilter != nil { 7457 queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", *eventsHealthStateFilter) 7458 } else { 7459 queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", 0) 7460 } 7461 if deployedServicePackagesHealthStateFilter != nil { 7462 queryParameters["DeployedServicePackagesHealthStateFilter"] = autorest.Encode("query", *deployedServicePackagesHealthStateFilter) 7463 } else { 7464 queryParameters["DeployedServicePackagesHealthStateFilter"] = autorest.Encode("query", 0) 7465 } 7466 if excludeHealthStatistics != nil { 7467 queryParameters["ExcludeHealthStatistics"] = autorest.Encode("query", *excludeHealthStatistics) 7468 } else { 7469 queryParameters["ExcludeHealthStatistics"] = autorest.Encode("query", false) 7470 } 7471 if timeout != nil { 7472 queryParameters["timeout"] = autorest.Encode("query", *timeout) 7473 } else { 7474 queryParameters["timeout"] = autorest.Encode("query", 60) 7475 } 7476 7477 preparer := autorest.CreatePreparer( 7478 autorest.AsContentType("application/json; charset=utf-8"), 7479 autorest.AsPost(), 7480 autorest.WithBaseURL(client.BaseURI), 7481 autorest.WithPathParameters("/Nodes/{nodeName}/$/GetApplications/{applicationId}/$/GetHealth", pathParameters), 7482 autorest.WithQueryParameters(queryParameters)) 7483 if applicationHealthPolicy != nil { 7484 preparer = autorest.DecoratePreparer(preparer, 7485 autorest.WithJSON(applicationHealthPolicy)) 7486 } 7487 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 7488} 7489 7490// GetDeployedApplicationHealthUsingPolicySender sends the GetDeployedApplicationHealthUsingPolicy request. The method will close the 7491// http.Response Body if it receives an error. 7492func (client BaseClient) GetDeployedApplicationHealthUsingPolicySender(req *http.Request) (*http.Response, error) { 7493 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 7494} 7495 7496// GetDeployedApplicationHealthUsingPolicyResponder handles the response to the GetDeployedApplicationHealthUsingPolicy request. The method always 7497// closes the http.Response Body. 7498func (client BaseClient) GetDeployedApplicationHealthUsingPolicyResponder(resp *http.Response) (result DeployedApplicationHealth, err error) { 7499 err = autorest.Respond( 7500 resp, 7501 azure.WithErrorUnlessStatusCode(http.StatusOK), 7502 autorest.ByUnmarshallingJSON(&result), 7503 autorest.ByClosing()) 7504 result.Response = autorest.Response{Response: resp} 7505 return 7506} 7507 7508// GetDeployedApplicationInfo this query returns system application information if the application ID provided is for 7509// system application. Results encompass deployed applications in active, activating, and downloading states. This 7510// query requires that the node name corresponds to a node on the cluster. The query fails if the provided node name 7511// does not point to any active Service Fabric nodes on the cluster. 7512// Parameters: 7513// nodeName - the name of the node. 7514// applicationID - the identity of the application. This is typically the full name of the application without 7515// the 'fabric:' URI scheme. 7516// Starting from version 6.0, hierarchical names are delimited with the "~" character. 7517// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" 7518// in 6.0+ and "myapp/app1" in previous versions. 7519// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 7520// duration that the client is willing to wait for the requested operation to complete. The default value for 7521// this parameter is 60 seconds. 7522// includeHealthState - include the health state of an entity. 7523// If this parameter is false or not specified, then the health state returned is "Unknown". 7524// When set to true, the query goes in parallel to the node and the health system service before the results 7525// are merged. 7526// As a result, the query is more expensive and may take a longer time. 7527func (client BaseClient) GetDeployedApplicationInfo(ctx context.Context, nodeName string, applicationID string, timeout *int64, includeHealthState *bool) (result DeployedApplicationInfo, err error) { 7528 if tracing.IsEnabled() { 7529 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetDeployedApplicationInfo") 7530 defer func() { 7531 sc := -1 7532 if result.Response.Response != nil { 7533 sc = result.Response.Response.StatusCode 7534 } 7535 tracing.EndSpan(ctx, sc, err) 7536 }() 7537 } 7538 if err := validation.Validate([]validation.Validation{ 7539 {TargetValue: timeout, 7540 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 7541 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 7542 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 7543 }}}}}); err != nil { 7544 return result, validation.NewError("servicefabric.BaseClient", "GetDeployedApplicationInfo", err.Error()) 7545 } 7546 7547 req, err := client.GetDeployedApplicationInfoPreparer(ctx, nodeName, applicationID, timeout, includeHealthState) 7548 if err != nil { 7549 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedApplicationInfo", nil, "Failure preparing request") 7550 return 7551 } 7552 7553 resp, err := client.GetDeployedApplicationInfoSender(req) 7554 if err != nil { 7555 result.Response = autorest.Response{Response: resp} 7556 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedApplicationInfo", resp, "Failure sending request") 7557 return 7558 } 7559 7560 result, err = client.GetDeployedApplicationInfoResponder(resp) 7561 if err != nil { 7562 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedApplicationInfo", resp, "Failure responding to request") 7563 return 7564 } 7565 7566 return 7567} 7568 7569// GetDeployedApplicationInfoPreparer prepares the GetDeployedApplicationInfo request. 7570func (client BaseClient) GetDeployedApplicationInfoPreparer(ctx context.Context, nodeName string, applicationID string, timeout *int64, includeHealthState *bool) (*http.Request, error) { 7571 pathParameters := map[string]interface{}{ 7572 "applicationId": applicationID, 7573 "nodeName": autorest.Encode("path", nodeName), 7574 } 7575 7576 const APIVersion = "6.1" 7577 queryParameters := map[string]interface{}{ 7578 "api-version": APIVersion, 7579 } 7580 if timeout != nil { 7581 queryParameters["timeout"] = autorest.Encode("query", *timeout) 7582 } else { 7583 queryParameters["timeout"] = autorest.Encode("query", 60) 7584 } 7585 if includeHealthState != nil { 7586 queryParameters["IncludeHealthState"] = autorest.Encode("query", *includeHealthState) 7587 } else { 7588 queryParameters["IncludeHealthState"] = autorest.Encode("query", false) 7589 } 7590 7591 preparer := autorest.CreatePreparer( 7592 autorest.AsGet(), 7593 autorest.WithBaseURL(client.BaseURI), 7594 autorest.WithPathParameters("/Nodes/{nodeName}/$/GetApplications/{applicationId}", pathParameters), 7595 autorest.WithQueryParameters(queryParameters)) 7596 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 7597} 7598 7599// GetDeployedApplicationInfoSender sends the GetDeployedApplicationInfo request. The method will close the 7600// http.Response Body if it receives an error. 7601func (client BaseClient) GetDeployedApplicationInfoSender(req *http.Request) (*http.Response, error) { 7602 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 7603} 7604 7605// GetDeployedApplicationInfoResponder handles the response to the GetDeployedApplicationInfo request. The method always 7606// closes the http.Response Body. 7607func (client BaseClient) GetDeployedApplicationInfoResponder(resp *http.Response) (result DeployedApplicationInfo, err error) { 7608 err = autorest.Respond( 7609 resp, 7610 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), 7611 autorest.ByUnmarshallingJSON(&result), 7612 autorest.ByClosing()) 7613 result.Response = autorest.Response{Response: resp} 7614 return 7615} 7616 7617// GetDeployedApplicationInfoList gets the list of applications deployed on a Service Fabric node. The results do not 7618// include information about deployed system applications unless explicitly queried for by ID. Results encompass 7619// deployed applications in active, activating, and downloading states. This query requires that the node name 7620// corresponds to a node on the cluster. The query fails if the provided node name does not point to any active Service 7621// Fabric nodes on the cluster. 7622// Parameters: 7623// nodeName - the name of the node. 7624// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 7625// duration that the client is willing to wait for the requested operation to complete. The default value for 7626// this parameter is 60 seconds. 7627// includeHealthState - include the health state of an entity. 7628// If this parameter is false or not specified, then the health state returned is "Unknown". 7629// When set to true, the query goes in parallel to the node and the health system service before the results 7630// are merged. 7631// As a result, the query is more expensive and may take a longer time. 7632// continuationToken - the continuation token parameter is used to obtain next set of results. A continuation 7633// token with a non-empty value is included in the response of the API when the results from the system do not 7634// fit in a single response. When this value is passed to the next API call, the API returns next set of 7635// results. If there are no further results, then the continuation token does not contain a value. The value of 7636// this parameter should not be URL encoded. 7637// maxResults - the maximum number of results to be returned as part of the paged queries. This parameter 7638// defines the upper bound on the number of results returned. The results returned can be less than the 7639// specified maximum results if they do not fit in the message as per the max message size restrictions defined 7640// in the configuration. If this parameter is zero or not specified, the paged query includes as many results 7641// as possible that fit in the return message. 7642func (client BaseClient) GetDeployedApplicationInfoList(ctx context.Context, nodeName string, timeout *int64, includeHealthState *bool, continuationToken string, maxResults *int64) (result PagedDeployedApplicationInfoList, err error) { 7643 if tracing.IsEnabled() { 7644 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetDeployedApplicationInfoList") 7645 defer func() { 7646 sc := -1 7647 if result.Response.Response != nil { 7648 sc = result.Response.Response.StatusCode 7649 } 7650 tracing.EndSpan(ctx, sc, err) 7651 }() 7652 } 7653 if err := validation.Validate([]validation.Validation{ 7654 {TargetValue: timeout, 7655 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 7656 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 7657 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 7658 }}}}, 7659 {TargetValue: maxResults, 7660 Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false, 7661 Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}}}}}}); err != nil { 7662 return result, validation.NewError("servicefabric.BaseClient", "GetDeployedApplicationInfoList", err.Error()) 7663 } 7664 7665 req, err := client.GetDeployedApplicationInfoListPreparer(ctx, nodeName, timeout, includeHealthState, continuationToken, maxResults) 7666 if err != nil { 7667 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedApplicationInfoList", nil, "Failure preparing request") 7668 return 7669 } 7670 7671 resp, err := client.GetDeployedApplicationInfoListSender(req) 7672 if err != nil { 7673 result.Response = autorest.Response{Response: resp} 7674 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedApplicationInfoList", resp, "Failure sending request") 7675 return 7676 } 7677 7678 result, err = client.GetDeployedApplicationInfoListResponder(resp) 7679 if err != nil { 7680 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedApplicationInfoList", resp, "Failure responding to request") 7681 return 7682 } 7683 7684 return 7685} 7686 7687// GetDeployedApplicationInfoListPreparer prepares the GetDeployedApplicationInfoList request. 7688func (client BaseClient) GetDeployedApplicationInfoListPreparer(ctx context.Context, nodeName string, timeout *int64, includeHealthState *bool, continuationToken string, maxResults *int64) (*http.Request, error) { 7689 pathParameters := map[string]interface{}{ 7690 "nodeName": autorest.Encode("path", nodeName), 7691 } 7692 7693 const APIVersion = "6.1" 7694 queryParameters := map[string]interface{}{ 7695 "api-version": APIVersion, 7696 } 7697 if timeout != nil { 7698 queryParameters["timeout"] = autorest.Encode("query", *timeout) 7699 } else { 7700 queryParameters["timeout"] = autorest.Encode("query", 60) 7701 } 7702 if includeHealthState != nil { 7703 queryParameters["IncludeHealthState"] = autorest.Encode("query", *includeHealthState) 7704 } else { 7705 queryParameters["IncludeHealthState"] = autorest.Encode("query", false) 7706 } 7707 if len(continuationToken) > 0 { 7708 queryParameters["ContinuationToken"] = continuationToken 7709 } 7710 if maxResults != nil { 7711 queryParameters["MaxResults"] = autorest.Encode("query", *maxResults) 7712 } else { 7713 queryParameters["MaxResults"] = autorest.Encode("query", 0) 7714 } 7715 7716 preparer := autorest.CreatePreparer( 7717 autorest.AsGet(), 7718 autorest.WithBaseURL(client.BaseURI), 7719 autorest.WithPathParameters("/Nodes/{nodeName}/$/GetApplications", pathParameters), 7720 autorest.WithQueryParameters(queryParameters)) 7721 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 7722} 7723 7724// GetDeployedApplicationInfoListSender sends the GetDeployedApplicationInfoList request. The method will close the 7725// http.Response Body if it receives an error. 7726func (client BaseClient) GetDeployedApplicationInfoListSender(req *http.Request) (*http.Response, error) { 7727 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 7728} 7729 7730// GetDeployedApplicationInfoListResponder handles the response to the GetDeployedApplicationInfoList request. The method always 7731// closes the http.Response Body. 7732func (client BaseClient) GetDeployedApplicationInfoListResponder(resp *http.Response) (result PagedDeployedApplicationInfoList, err error) { 7733 err = autorest.Respond( 7734 resp, 7735 azure.WithErrorUnlessStatusCode(http.StatusOK), 7736 autorest.ByUnmarshallingJSON(&result), 7737 autorest.ByClosing()) 7738 result.Response = autorest.Response{Response: resp} 7739 return 7740} 7741 7742// GetDeployedCodePackageInfoList gets the list of code packages deployed on a Service Fabric node for the given 7743// application. 7744// Parameters: 7745// nodeName - the name of the node. 7746// applicationID - the identity of the application. This is typically the full name of the application without 7747// the 'fabric:' URI scheme. 7748// Starting from version 6.0, hierarchical names are delimited with the "~" character. 7749// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" 7750// in 6.0+ and "myapp/app1" in previous versions. 7751// serviceManifestName - the name of a service manifest registered as part of an application type in a Service 7752// Fabric cluster. 7753// codePackageName - the name of code package specified in service manifest registered as part of an 7754// application type in a Service Fabric cluster. 7755// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 7756// duration that the client is willing to wait for the requested operation to complete. The default value for 7757// this parameter is 60 seconds. 7758func (client BaseClient) GetDeployedCodePackageInfoList(ctx context.Context, nodeName string, applicationID string, serviceManifestName string, codePackageName string, timeout *int64) (result ListDeployedCodePackageInfo, err error) { 7759 if tracing.IsEnabled() { 7760 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetDeployedCodePackageInfoList") 7761 defer func() { 7762 sc := -1 7763 if result.Response.Response != nil { 7764 sc = result.Response.Response.StatusCode 7765 } 7766 tracing.EndSpan(ctx, sc, err) 7767 }() 7768 } 7769 if err := validation.Validate([]validation.Validation{ 7770 {TargetValue: timeout, 7771 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 7772 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 7773 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 7774 }}}}}); err != nil { 7775 return result, validation.NewError("servicefabric.BaseClient", "GetDeployedCodePackageInfoList", err.Error()) 7776 } 7777 7778 req, err := client.GetDeployedCodePackageInfoListPreparer(ctx, nodeName, applicationID, serviceManifestName, codePackageName, timeout) 7779 if err != nil { 7780 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedCodePackageInfoList", nil, "Failure preparing request") 7781 return 7782 } 7783 7784 resp, err := client.GetDeployedCodePackageInfoListSender(req) 7785 if err != nil { 7786 result.Response = autorest.Response{Response: resp} 7787 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedCodePackageInfoList", resp, "Failure sending request") 7788 return 7789 } 7790 7791 result, err = client.GetDeployedCodePackageInfoListResponder(resp) 7792 if err != nil { 7793 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedCodePackageInfoList", resp, "Failure responding to request") 7794 return 7795 } 7796 7797 return 7798} 7799 7800// GetDeployedCodePackageInfoListPreparer prepares the GetDeployedCodePackageInfoList request. 7801func (client BaseClient) GetDeployedCodePackageInfoListPreparer(ctx context.Context, nodeName string, applicationID string, serviceManifestName string, codePackageName string, timeout *int64) (*http.Request, error) { 7802 pathParameters := map[string]interface{}{ 7803 "applicationId": applicationID, 7804 "nodeName": autorest.Encode("path", nodeName), 7805 } 7806 7807 const APIVersion = "6.0" 7808 queryParameters := map[string]interface{}{ 7809 "api-version": APIVersion, 7810 } 7811 if len(serviceManifestName) > 0 { 7812 queryParameters["ServiceManifestName"] = autorest.Encode("query", serviceManifestName) 7813 } 7814 if len(codePackageName) > 0 { 7815 queryParameters["CodePackageName"] = autorest.Encode("query", codePackageName) 7816 } 7817 if timeout != nil { 7818 queryParameters["timeout"] = autorest.Encode("query", *timeout) 7819 } else { 7820 queryParameters["timeout"] = autorest.Encode("query", 60) 7821 } 7822 7823 preparer := autorest.CreatePreparer( 7824 autorest.AsGet(), 7825 autorest.WithBaseURL(client.BaseURI), 7826 autorest.WithPathParameters("/Nodes/{nodeName}/$/GetApplications/{applicationId}/$/GetCodePackages", pathParameters), 7827 autorest.WithQueryParameters(queryParameters)) 7828 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 7829} 7830 7831// GetDeployedCodePackageInfoListSender sends the GetDeployedCodePackageInfoList request. The method will close the 7832// http.Response Body if it receives an error. 7833func (client BaseClient) GetDeployedCodePackageInfoListSender(req *http.Request) (*http.Response, error) { 7834 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 7835} 7836 7837// GetDeployedCodePackageInfoListResponder handles the response to the GetDeployedCodePackageInfoList request. The method always 7838// closes the http.Response Body. 7839func (client BaseClient) GetDeployedCodePackageInfoListResponder(resp *http.Response) (result ListDeployedCodePackageInfo, err error) { 7840 err = autorest.Respond( 7841 resp, 7842 azure.WithErrorUnlessStatusCode(http.StatusOK), 7843 autorest.ByUnmarshallingJSON(&result.Value), 7844 autorest.ByClosing()) 7845 result.Response = autorest.Response{Response: resp} 7846 return 7847} 7848 7849// GetDeployedServicePackageHealth gets the information about health of a service package for a specific application 7850// deployed on a Service Fabric node. Use EventsHealthStateFilter to optionally filter for the collection of 7851// HealthEvent objects reported on the deployed service package based on health state. 7852// Parameters: 7853// nodeName - the name of the node. 7854// applicationID - the identity of the application. This is typically the full name of the application without 7855// the 'fabric:' URI scheme. 7856// Starting from version 6.0, hierarchical names are delimited with the "~" character. 7857// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" 7858// in 6.0+ and "myapp/app1" in previous versions. 7859// servicePackageName - the name of the service package. 7860// eventsHealthStateFilter - allows filtering the collection of HealthEvent objects returned based on health 7861// state. 7862// The possible values for this parameter include integer value of one of the following health states. 7863// Only events that match the filter are returned. All events are used to evaluate the aggregated health state. 7864// If not specified, all entries are returned. The state values are flag-based enumeration, so the value could 7865// be a combination of these values, obtained using the bitwise 'OR' operator. For example, If the provided 7866// value is 6 then all of the events with HealthState value of OK (2) and Warning (4) are returned. 7867// 7868// - Default - Default value. Matches any HealthState. The value is zero. 7869// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given 7870// collection of states. The value is 1. 7871// - Ok - Filter that matches input with HealthState value Ok. The value is 2. 7872// - Warning - Filter that matches input with HealthState value Warning. The value is 4. 7873// - Error - Filter that matches input with HealthState value Error. The value is 8. 7874// - All - Filter that matches input with any HealthState value. The value is 65535. 7875// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 7876// duration that the client is willing to wait for the requested operation to complete. The default value for 7877// this parameter is 60 seconds. 7878func (client BaseClient) GetDeployedServicePackageHealth(ctx context.Context, nodeName string, applicationID string, servicePackageName string, eventsHealthStateFilter *int32, timeout *int64) (result DeployedServicePackageHealth, err error) { 7879 if tracing.IsEnabled() { 7880 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetDeployedServicePackageHealth") 7881 defer func() { 7882 sc := -1 7883 if result.Response.Response != nil { 7884 sc = result.Response.Response.StatusCode 7885 } 7886 tracing.EndSpan(ctx, sc, err) 7887 }() 7888 } 7889 if err := validation.Validate([]validation.Validation{ 7890 {TargetValue: timeout, 7891 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 7892 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 7893 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 7894 }}}}}); err != nil { 7895 return result, validation.NewError("servicefabric.BaseClient", "GetDeployedServicePackageHealth", err.Error()) 7896 } 7897 7898 req, err := client.GetDeployedServicePackageHealthPreparer(ctx, nodeName, applicationID, servicePackageName, eventsHealthStateFilter, timeout) 7899 if err != nil { 7900 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServicePackageHealth", nil, "Failure preparing request") 7901 return 7902 } 7903 7904 resp, err := client.GetDeployedServicePackageHealthSender(req) 7905 if err != nil { 7906 result.Response = autorest.Response{Response: resp} 7907 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServicePackageHealth", resp, "Failure sending request") 7908 return 7909 } 7910 7911 result, err = client.GetDeployedServicePackageHealthResponder(resp) 7912 if err != nil { 7913 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServicePackageHealth", resp, "Failure responding to request") 7914 return 7915 } 7916 7917 return 7918} 7919 7920// GetDeployedServicePackageHealthPreparer prepares the GetDeployedServicePackageHealth request. 7921func (client BaseClient) GetDeployedServicePackageHealthPreparer(ctx context.Context, nodeName string, applicationID string, servicePackageName string, eventsHealthStateFilter *int32, timeout *int64) (*http.Request, error) { 7922 pathParameters := map[string]interface{}{ 7923 "applicationId": applicationID, 7924 "nodeName": autorest.Encode("path", nodeName), 7925 "servicePackageName": servicePackageName, 7926 } 7927 7928 const APIVersion = "6.0" 7929 queryParameters := map[string]interface{}{ 7930 "api-version": APIVersion, 7931 } 7932 if eventsHealthStateFilter != nil { 7933 queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", *eventsHealthStateFilter) 7934 } else { 7935 queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", 0) 7936 } 7937 if timeout != nil { 7938 queryParameters["timeout"] = autorest.Encode("query", *timeout) 7939 } else { 7940 queryParameters["timeout"] = autorest.Encode("query", 60) 7941 } 7942 7943 preparer := autorest.CreatePreparer( 7944 autorest.AsGet(), 7945 autorest.WithBaseURL(client.BaseURI), 7946 autorest.WithPathParameters("/Nodes/{nodeName}/$/GetApplications/{applicationId}/$/GetServicePackages/{servicePackageName}/$/GetHealth", pathParameters), 7947 autorest.WithQueryParameters(queryParameters)) 7948 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 7949} 7950 7951// GetDeployedServicePackageHealthSender sends the GetDeployedServicePackageHealth request. The method will close the 7952// http.Response Body if it receives an error. 7953func (client BaseClient) GetDeployedServicePackageHealthSender(req *http.Request) (*http.Response, error) { 7954 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 7955} 7956 7957// GetDeployedServicePackageHealthResponder handles the response to the GetDeployedServicePackageHealth request. The method always 7958// closes the http.Response Body. 7959func (client BaseClient) GetDeployedServicePackageHealthResponder(resp *http.Response) (result DeployedServicePackageHealth, err error) { 7960 err = autorest.Respond( 7961 resp, 7962 azure.WithErrorUnlessStatusCode(http.StatusOK), 7963 autorest.ByUnmarshallingJSON(&result), 7964 autorest.ByClosing()) 7965 result.Response = autorest.Response{Response: resp} 7966 return 7967} 7968 7969// GetDeployedServicePackageHealthUsingPolicy gets the information about health of a service package for a specific 7970// application deployed on a Service Fabric node. using the specified policy. Use EventsHealthStateFilter to optionally 7971// filter for the collection of HealthEvent objects reported on the deployed service package based on health state. Use 7972// ApplicationHealthPolicy to optionally override the health policies used to evaluate the health. This API only uses 7973// 'ConsiderWarningAsError' field of the ApplicationHealthPolicy. The rest of the fields are ignored while evaluating 7974// the health of the deployed service package. 7975// Parameters: 7976// nodeName - the name of the node. 7977// applicationID - the identity of the application. This is typically the full name of the application without 7978// the 'fabric:' URI scheme. 7979// Starting from version 6.0, hierarchical names are delimited with the "~" character. 7980// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" 7981// in 6.0+ and "myapp/app1" in previous versions. 7982// servicePackageName - the name of the service package. 7983// eventsHealthStateFilter - allows filtering the collection of HealthEvent objects returned based on health 7984// state. 7985// The possible values for this parameter include integer value of one of the following health states. 7986// Only events that match the filter are returned. All events are used to evaluate the aggregated health state. 7987// If not specified, all entries are returned. The state values are flag-based enumeration, so the value could 7988// be a combination of these values, obtained using the bitwise 'OR' operator. For example, If the provided 7989// value is 6 then all of the events with HealthState value of OK (2) and Warning (4) are returned. 7990// 7991// - Default - Default value. Matches any HealthState. The value is zero. 7992// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given 7993// collection of states. The value is 1. 7994// - Ok - Filter that matches input with HealthState value Ok. The value is 2. 7995// - Warning - Filter that matches input with HealthState value Warning. The value is 4. 7996// - Error - Filter that matches input with HealthState value Error. The value is 8. 7997// - All - Filter that matches input with any HealthState value. The value is 65535. 7998// applicationHealthPolicy - describes the health policies used to evaluate the health of an application or one 7999// of its children. 8000// If not present, the health evaluation uses the health policy from application manifest or the default health 8001// policy. 8002// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 8003// duration that the client is willing to wait for the requested operation to complete. The default value for 8004// this parameter is 60 seconds. 8005func (client BaseClient) GetDeployedServicePackageHealthUsingPolicy(ctx context.Context, nodeName string, applicationID string, servicePackageName string, eventsHealthStateFilter *int32, applicationHealthPolicy *ApplicationHealthPolicy, timeout *int64) (result DeployedServicePackageHealth, err error) { 8006 if tracing.IsEnabled() { 8007 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetDeployedServicePackageHealthUsingPolicy") 8008 defer func() { 8009 sc := -1 8010 if result.Response.Response != nil { 8011 sc = result.Response.Response.StatusCode 8012 } 8013 tracing.EndSpan(ctx, sc, err) 8014 }() 8015 } 8016 if err := validation.Validate([]validation.Validation{ 8017 {TargetValue: timeout, 8018 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 8019 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 8020 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 8021 }}}}}); err != nil { 8022 return result, validation.NewError("servicefabric.BaseClient", "GetDeployedServicePackageHealthUsingPolicy", err.Error()) 8023 } 8024 8025 req, err := client.GetDeployedServicePackageHealthUsingPolicyPreparer(ctx, nodeName, applicationID, servicePackageName, eventsHealthStateFilter, applicationHealthPolicy, timeout) 8026 if err != nil { 8027 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServicePackageHealthUsingPolicy", nil, "Failure preparing request") 8028 return 8029 } 8030 8031 resp, err := client.GetDeployedServicePackageHealthUsingPolicySender(req) 8032 if err != nil { 8033 result.Response = autorest.Response{Response: resp} 8034 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServicePackageHealthUsingPolicy", resp, "Failure sending request") 8035 return 8036 } 8037 8038 result, err = client.GetDeployedServicePackageHealthUsingPolicyResponder(resp) 8039 if err != nil { 8040 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServicePackageHealthUsingPolicy", resp, "Failure responding to request") 8041 return 8042 } 8043 8044 return 8045} 8046 8047// GetDeployedServicePackageHealthUsingPolicyPreparer prepares the GetDeployedServicePackageHealthUsingPolicy request. 8048func (client BaseClient) GetDeployedServicePackageHealthUsingPolicyPreparer(ctx context.Context, nodeName string, applicationID string, servicePackageName string, eventsHealthStateFilter *int32, applicationHealthPolicy *ApplicationHealthPolicy, timeout *int64) (*http.Request, error) { 8049 pathParameters := map[string]interface{}{ 8050 "applicationId": applicationID, 8051 "nodeName": autorest.Encode("path", nodeName), 8052 "servicePackageName": servicePackageName, 8053 } 8054 8055 const APIVersion = "6.0" 8056 queryParameters := map[string]interface{}{ 8057 "api-version": APIVersion, 8058 } 8059 if eventsHealthStateFilter != nil { 8060 queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", *eventsHealthStateFilter) 8061 } else { 8062 queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", 0) 8063 } 8064 if timeout != nil { 8065 queryParameters["timeout"] = autorest.Encode("query", *timeout) 8066 } else { 8067 queryParameters["timeout"] = autorest.Encode("query", 60) 8068 } 8069 8070 preparer := autorest.CreatePreparer( 8071 autorest.AsContentType("application/json; charset=utf-8"), 8072 autorest.AsPost(), 8073 autorest.WithBaseURL(client.BaseURI), 8074 autorest.WithPathParameters("/Nodes/{nodeName}/$/GetApplications/{applicationId}/$/GetServicePackages/{servicePackageName}/$/GetHealth", pathParameters), 8075 autorest.WithQueryParameters(queryParameters)) 8076 if applicationHealthPolicy != nil { 8077 preparer = autorest.DecoratePreparer(preparer, 8078 autorest.WithJSON(applicationHealthPolicy)) 8079 } 8080 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 8081} 8082 8083// GetDeployedServicePackageHealthUsingPolicySender sends the GetDeployedServicePackageHealthUsingPolicy request. The method will close the 8084// http.Response Body if it receives an error. 8085func (client BaseClient) GetDeployedServicePackageHealthUsingPolicySender(req *http.Request) (*http.Response, error) { 8086 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 8087} 8088 8089// GetDeployedServicePackageHealthUsingPolicyResponder handles the response to the GetDeployedServicePackageHealthUsingPolicy request. The method always 8090// closes the http.Response Body. 8091func (client BaseClient) GetDeployedServicePackageHealthUsingPolicyResponder(resp *http.Response) (result DeployedServicePackageHealth, err error) { 8092 err = autorest.Respond( 8093 resp, 8094 azure.WithErrorUnlessStatusCode(http.StatusOK), 8095 autorest.ByUnmarshallingJSON(&result), 8096 autorest.ByClosing()) 8097 result.Response = autorest.Response{Response: resp} 8098 return 8099} 8100 8101// GetDeployedServicePackageInfoList returns the information about the service packages deployed on a Service Fabric 8102// node for the given application. 8103// Parameters: 8104// nodeName - the name of the node. 8105// applicationID - the identity of the application. This is typically the full name of the application without 8106// the 'fabric:' URI scheme. 8107// Starting from version 6.0, hierarchical names are delimited with the "~" character. 8108// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" 8109// in 6.0+ and "myapp/app1" in previous versions. 8110// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 8111// duration that the client is willing to wait for the requested operation to complete. The default value for 8112// this parameter is 60 seconds. 8113func (client BaseClient) GetDeployedServicePackageInfoList(ctx context.Context, nodeName string, applicationID string, timeout *int64) (result ListDeployedServicePackageInfo, err error) { 8114 if tracing.IsEnabled() { 8115 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetDeployedServicePackageInfoList") 8116 defer func() { 8117 sc := -1 8118 if result.Response.Response != nil { 8119 sc = result.Response.Response.StatusCode 8120 } 8121 tracing.EndSpan(ctx, sc, err) 8122 }() 8123 } 8124 if err := validation.Validate([]validation.Validation{ 8125 {TargetValue: timeout, 8126 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 8127 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 8128 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 8129 }}}}}); err != nil { 8130 return result, validation.NewError("servicefabric.BaseClient", "GetDeployedServicePackageInfoList", err.Error()) 8131 } 8132 8133 req, err := client.GetDeployedServicePackageInfoListPreparer(ctx, nodeName, applicationID, timeout) 8134 if err != nil { 8135 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServicePackageInfoList", nil, "Failure preparing request") 8136 return 8137 } 8138 8139 resp, err := client.GetDeployedServicePackageInfoListSender(req) 8140 if err != nil { 8141 result.Response = autorest.Response{Response: resp} 8142 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServicePackageInfoList", resp, "Failure sending request") 8143 return 8144 } 8145 8146 result, err = client.GetDeployedServicePackageInfoListResponder(resp) 8147 if err != nil { 8148 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServicePackageInfoList", resp, "Failure responding to request") 8149 return 8150 } 8151 8152 return 8153} 8154 8155// GetDeployedServicePackageInfoListPreparer prepares the GetDeployedServicePackageInfoList request. 8156func (client BaseClient) GetDeployedServicePackageInfoListPreparer(ctx context.Context, nodeName string, applicationID string, timeout *int64) (*http.Request, error) { 8157 pathParameters := map[string]interface{}{ 8158 "applicationId": applicationID, 8159 "nodeName": autorest.Encode("path", nodeName), 8160 } 8161 8162 const APIVersion = "6.0" 8163 queryParameters := map[string]interface{}{ 8164 "api-version": APIVersion, 8165 } 8166 if timeout != nil { 8167 queryParameters["timeout"] = autorest.Encode("query", *timeout) 8168 } else { 8169 queryParameters["timeout"] = autorest.Encode("query", 60) 8170 } 8171 8172 preparer := autorest.CreatePreparer( 8173 autorest.AsGet(), 8174 autorest.WithBaseURL(client.BaseURI), 8175 autorest.WithPathParameters("/Nodes/{nodeName}/$/GetApplications/{applicationId}/$/GetServicePackages", pathParameters), 8176 autorest.WithQueryParameters(queryParameters)) 8177 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 8178} 8179 8180// GetDeployedServicePackageInfoListSender sends the GetDeployedServicePackageInfoList request. The method will close the 8181// http.Response Body if it receives an error. 8182func (client BaseClient) GetDeployedServicePackageInfoListSender(req *http.Request) (*http.Response, error) { 8183 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 8184} 8185 8186// GetDeployedServicePackageInfoListResponder handles the response to the GetDeployedServicePackageInfoList request. The method always 8187// closes the http.Response Body. 8188func (client BaseClient) GetDeployedServicePackageInfoListResponder(resp *http.Response) (result ListDeployedServicePackageInfo, err error) { 8189 err = autorest.Respond( 8190 resp, 8191 azure.WithErrorUnlessStatusCode(http.StatusOK), 8192 autorest.ByUnmarshallingJSON(&result.Value), 8193 autorest.ByClosing()) 8194 result.Response = autorest.Response{Response: resp} 8195 return 8196} 8197 8198// GetDeployedServicePackageInfoListByName returns the information about the service packages deployed on a Service 8199// Fabric node for the given application. These results are of service packages whose name match exactly the service 8200// package name specified as the parameter. 8201// Parameters: 8202// nodeName - the name of the node. 8203// applicationID - the identity of the application. This is typically the full name of the application without 8204// the 'fabric:' URI scheme. 8205// Starting from version 6.0, hierarchical names are delimited with the "~" character. 8206// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" 8207// in 6.0+ and "myapp/app1" in previous versions. 8208// servicePackageName - the name of the service package. 8209// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 8210// duration that the client is willing to wait for the requested operation to complete. The default value for 8211// this parameter is 60 seconds. 8212func (client BaseClient) GetDeployedServicePackageInfoListByName(ctx context.Context, nodeName string, applicationID string, servicePackageName string, timeout *int64) (result ListDeployedServicePackageInfo, err error) { 8213 if tracing.IsEnabled() { 8214 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetDeployedServicePackageInfoListByName") 8215 defer func() { 8216 sc := -1 8217 if result.Response.Response != nil { 8218 sc = result.Response.Response.StatusCode 8219 } 8220 tracing.EndSpan(ctx, sc, err) 8221 }() 8222 } 8223 if err := validation.Validate([]validation.Validation{ 8224 {TargetValue: timeout, 8225 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 8226 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 8227 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 8228 }}}}}); err != nil { 8229 return result, validation.NewError("servicefabric.BaseClient", "GetDeployedServicePackageInfoListByName", err.Error()) 8230 } 8231 8232 req, err := client.GetDeployedServicePackageInfoListByNamePreparer(ctx, nodeName, applicationID, servicePackageName, timeout) 8233 if err != nil { 8234 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServicePackageInfoListByName", nil, "Failure preparing request") 8235 return 8236 } 8237 8238 resp, err := client.GetDeployedServicePackageInfoListByNameSender(req) 8239 if err != nil { 8240 result.Response = autorest.Response{Response: resp} 8241 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServicePackageInfoListByName", resp, "Failure sending request") 8242 return 8243 } 8244 8245 result, err = client.GetDeployedServicePackageInfoListByNameResponder(resp) 8246 if err != nil { 8247 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServicePackageInfoListByName", resp, "Failure responding to request") 8248 return 8249 } 8250 8251 return 8252} 8253 8254// GetDeployedServicePackageInfoListByNamePreparer prepares the GetDeployedServicePackageInfoListByName request. 8255func (client BaseClient) GetDeployedServicePackageInfoListByNamePreparer(ctx context.Context, nodeName string, applicationID string, servicePackageName string, timeout *int64) (*http.Request, error) { 8256 pathParameters := map[string]interface{}{ 8257 "applicationId": applicationID, 8258 "nodeName": autorest.Encode("path", nodeName), 8259 "servicePackageName": servicePackageName, 8260 } 8261 8262 const APIVersion = "6.0" 8263 queryParameters := map[string]interface{}{ 8264 "api-version": APIVersion, 8265 } 8266 if timeout != nil { 8267 queryParameters["timeout"] = autorest.Encode("query", *timeout) 8268 } else { 8269 queryParameters["timeout"] = autorest.Encode("query", 60) 8270 } 8271 8272 preparer := autorest.CreatePreparer( 8273 autorest.AsGet(), 8274 autorest.WithBaseURL(client.BaseURI), 8275 autorest.WithPathParameters("/Nodes/{nodeName}/$/GetApplications/{applicationId}/$/GetServicePackages/{servicePackageName}", pathParameters), 8276 autorest.WithQueryParameters(queryParameters)) 8277 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 8278} 8279 8280// GetDeployedServicePackageInfoListByNameSender sends the GetDeployedServicePackageInfoListByName request. The method will close the 8281// http.Response Body if it receives an error. 8282func (client BaseClient) GetDeployedServicePackageInfoListByNameSender(req *http.Request) (*http.Response, error) { 8283 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 8284} 8285 8286// GetDeployedServicePackageInfoListByNameResponder handles the response to the GetDeployedServicePackageInfoListByName request. The method always 8287// closes the http.Response Body. 8288func (client BaseClient) GetDeployedServicePackageInfoListByNameResponder(resp *http.Response) (result ListDeployedServicePackageInfo, err error) { 8289 err = autorest.Respond( 8290 resp, 8291 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), 8292 autorest.ByUnmarshallingJSON(&result.Value), 8293 autorest.ByClosing()) 8294 result.Response = autorest.Response{Response: resp} 8295 return 8296} 8297 8298// GetDeployedServiceReplicaDetailInfo gets the details of the replica deployed on a Service Fabric node. The 8299// information includes service kind, service name, current service operation, current service operation start date 8300// time, partition ID, replica/instance ID, reported load, and other information. 8301// Parameters: 8302// nodeName - the name of the node. 8303// partitionID - the identity of the partition. 8304// replicaID - the identifier of the replica. 8305// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 8306// duration that the client is willing to wait for the requested operation to complete. The default value for 8307// this parameter is 60 seconds. 8308func (client BaseClient) GetDeployedServiceReplicaDetailInfo(ctx context.Context, nodeName string, partitionID uuid.UUID, replicaID string, timeout *int64) (result DeployedServiceReplicaDetailInfoModel, err error) { 8309 if tracing.IsEnabled() { 8310 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetDeployedServiceReplicaDetailInfo") 8311 defer func() { 8312 sc := -1 8313 if result.Response.Response != nil { 8314 sc = result.Response.Response.StatusCode 8315 } 8316 tracing.EndSpan(ctx, sc, err) 8317 }() 8318 } 8319 if err := validation.Validate([]validation.Validation{ 8320 {TargetValue: timeout, 8321 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 8322 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 8323 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 8324 }}}}}); err != nil { 8325 return result, validation.NewError("servicefabric.BaseClient", "GetDeployedServiceReplicaDetailInfo", err.Error()) 8326 } 8327 8328 req, err := client.GetDeployedServiceReplicaDetailInfoPreparer(ctx, nodeName, partitionID, replicaID, timeout) 8329 if err != nil { 8330 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServiceReplicaDetailInfo", nil, "Failure preparing request") 8331 return 8332 } 8333 8334 resp, err := client.GetDeployedServiceReplicaDetailInfoSender(req) 8335 if err != nil { 8336 result.Response = autorest.Response{Response: resp} 8337 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServiceReplicaDetailInfo", resp, "Failure sending request") 8338 return 8339 } 8340 8341 result, err = client.GetDeployedServiceReplicaDetailInfoResponder(resp) 8342 if err != nil { 8343 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServiceReplicaDetailInfo", resp, "Failure responding to request") 8344 return 8345 } 8346 8347 return 8348} 8349 8350// GetDeployedServiceReplicaDetailInfoPreparer prepares the GetDeployedServiceReplicaDetailInfo request. 8351func (client BaseClient) GetDeployedServiceReplicaDetailInfoPreparer(ctx context.Context, nodeName string, partitionID uuid.UUID, replicaID string, timeout *int64) (*http.Request, error) { 8352 pathParameters := map[string]interface{}{ 8353 "nodeName": autorest.Encode("path", nodeName), 8354 "partitionId": partitionID, 8355 "replicaId": replicaID, 8356 } 8357 8358 const APIVersion = "6.0" 8359 queryParameters := map[string]interface{}{ 8360 "api-version": APIVersion, 8361 } 8362 if timeout != nil { 8363 queryParameters["timeout"] = autorest.Encode("query", *timeout) 8364 } else { 8365 queryParameters["timeout"] = autorest.Encode("query", 60) 8366 } 8367 8368 preparer := autorest.CreatePreparer( 8369 autorest.AsGet(), 8370 autorest.WithBaseURL(client.BaseURI), 8371 autorest.WithPathParameters("/Nodes/{nodeName}/$/GetPartitions/{partitionId}/$/GetReplicas/{replicaId}/$/GetDetail", pathParameters), 8372 autorest.WithQueryParameters(queryParameters)) 8373 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 8374} 8375 8376// GetDeployedServiceReplicaDetailInfoSender sends the GetDeployedServiceReplicaDetailInfo request. The method will close the 8377// http.Response Body if it receives an error. 8378func (client BaseClient) GetDeployedServiceReplicaDetailInfoSender(req *http.Request) (*http.Response, error) { 8379 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 8380} 8381 8382// GetDeployedServiceReplicaDetailInfoResponder handles the response to the GetDeployedServiceReplicaDetailInfo request. The method always 8383// closes the http.Response Body. 8384func (client BaseClient) GetDeployedServiceReplicaDetailInfoResponder(resp *http.Response) (result DeployedServiceReplicaDetailInfoModel, err error) { 8385 err = autorest.Respond( 8386 resp, 8387 azure.WithErrorUnlessStatusCode(http.StatusOK), 8388 autorest.ByUnmarshallingJSON(&result), 8389 autorest.ByClosing()) 8390 result.Response = autorest.Response{Response: resp} 8391 return 8392} 8393 8394// GetDeployedServiceReplicaDetailInfoByPartitionID gets the details of the replica deployed on a Service Fabric node. 8395// The information includes service kind, service name, current service operation, current service operation start date 8396// time, partition ID, replica/instance ID, reported load, and other information. 8397// Parameters: 8398// nodeName - the name of the node. 8399// partitionID - the identity of the partition. 8400// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 8401// duration that the client is willing to wait for the requested operation to complete. The default value for 8402// this parameter is 60 seconds. 8403func (client BaseClient) GetDeployedServiceReplicaDetailInfoByPartitionID(ctx context.Context, nodeName string, partitionID uuid.UUID, timeout *int64) (result DeployedServiceReplicaDetailInfoModel, err error) { 8404 if tracing.IsEnabled() { 8405 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetDeployedServiceReplicaDetailInfoByPartitionID") 8406 defer func() { 8407 sc := -1 8408 if result.Response.Response != nil { 8409 sc = result.Response.Response.StatusCode 8410 } 8411 tracing.EndSpan(ctx, sc, err) 8412 }() 8413 } 8414 if err := validation.Validate([]validation.Validation{ 8415 {TargetValue: timeout, 8416 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 8417 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 8418 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 8419 }}}}}); err != nil { 8420 return result, validation.NewError("servicefabric.BaseClient", "GetDeployedServiceReplicaDetailInfoByPartitionID", err.Error()) 8421 } 8422 8423 req, err := client.GetDeployedServiceReplicaDetailInfoByPartitionIDPreparer(ctx, nodeName, partitionID, timeout) 8424 if err != nil { 8425 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServiceReplicaDetailInfoByPartitionID", nil, "Failure preparing request") 8426 return 8427 } 8428 8429 resp, err := client.GetDeployedServiceReplicaDetailInfoByPartitionIDSender(req) 8430 if err != nil { 8431 result.Response = autorest.Response{Response: resp} 8432 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServiceReplicaDetailInfoByPartitionID", resp, "Failure sending request") 8433 return 8434 } 8435 8436 result, err = client.GetDeployedServiceReplicaDetailInfoByPartitionIDResponder(resp) 8437 if err != nil { 8438 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServiceReplicaDetailInfoByPartitionID", resp, "Failure responding to request") 8439 return 8440 } 8441 8442 return 8443} 8444 8445// GetDeployedServiceReplicaDetailInfoByPartitionIDPreparer prepares the GetDeployedServiceReplicaDetailInfoByPartitionID request. 8446func (client BaseClient) GetDeployedServiceReplicaDetailInfoByPartitionIDPreparer(ctx context.Context, nodeName string, partitionID uuid.UUID, timeout *int64) (*http.Request, error) { 8447 pathParameters := map[string]interface{}{ 8448 "nodeName": autorest.Encode("path", nodeName), 8449 "partitionId": partitionID, 8450 } 8451 8452 const APIVersion = "6.0" 8453 queryParameters := map[string]interface{}{ 8454 "api-version": APIVersion, 8455 } 8456 if timeout != nil { 8457 queryParameters["timeout"] = autorest.Encode("query", *timeout) 8458 } else { 8459 queryParameters["timeout"] = autorest.Encode("query", 60) 8460 } 8461 8462 preparer := autorest.CreatePreparer( 8463 autorest.AsGet(), 8464 autorest.WithBaseURL(client.BaseURI), 8465 autorest.WithPathParameters("/Nodes/{nodeName}/$/GetPartitions/{partitionId}/$/GetReplicas", pathParameters), 8466 autorest.WithQueryParameters(queryParameters)) 8467 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 8468} 8469 8470// GetDeployedServiceReplicaDetailInfoByPartitionIDSender sends the GetDeployedServiceReplicaDetailInfoByPartitionID request. The method will close the 8471// http.Response Body if it receives an error. 8472func (client BaseClient) GetDeployedServiceReplicaDetailInfoByPartitionIDSender(req *http.Request) (*http.Response, error) { 8473 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 8474} 8475 8476// GetDeployedServiceReplicaDetailInfoByPartitionIDResponder handles the response to the GetDeployedServiceReplicaDetailInfoByPartitionID request. The method always 8477// closes the http.Response Body. 8478func (client BaseClient) GetDeployedServiceReplicaDetailInfoByPartitionIDResponder(resp *http.Response) (result DeployedServiceReplicaDetailInfoModel, err error) { 8479 err = autorest.Respond( 8480 resp, 8481 azure.WithErrorUnlessStatusCode(http.StatusOK), 8482 autorest.ByUnmarshallingJSON(&result), 8483 autorest.ByClosing()) 8484 result.Response = autorest.Response{Response: resp} 8485 return 8486} 8487 8488// GetDeployedServiceReplicaInfoList gets the list containing the information about replicas deployed on a Service 8489// Fabric node. The information include partition ID, replica ID, status of the replica, name of the service, name of 8490// the service type, and other information. Use PartitionId or ServiceManifestName query parameters to return 8491// information about the deployed replicas matching the specified values for those parameters. 8492// Parameters: 8493// nodeName - the name of the node. 8494// applicationID - the identity of the application. This is typically the full name of the application without 8495// the 'fabric:' URI scheme. 8496// Starting from version 6.0, hierarchical names are delimited with the "~" character. 8497// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" 8498// in 6.0+ and "myapp/app1" in previous versions. 8499// partitionID - the identity of the partition. 8500// serviceManifestName - the name of a service manifest registered as part of an application type in a Service 8501// Fabric cluster. 8502// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 8503// duration that the client is willing to wait for the requested operation to complete. The default value for 8504// this parameter is 60 seconds. 8505func (client BaseClient) GetDeployedServiceReplicaInfoList(ctx context.Context, nodeName string, applicationID string, partitionID *uuid.UUID, serviceManifestName string, timeout *int64) (result ListDeployedServiceReplicaInfo, err error) { 8506 if tracing.IsEnabled() { 8507 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetDeployedServiceReplicaInfoList") 8508 defer func() { 8509 sc := -1 8510 if result.Response.Response != nil { 8511 sc = result.Response.Response.StatusCode 8512 } 8513 tracing.EndSpan(ctx, sc, err) 8514 }() 8515 } 8516 if err := validation.Validate([]validation.Validation{ 8517 {TargetValue: timeout, 8518 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 8519 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 8520 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 8521 }}}}}); err != nil { 8522 return result, validation.NewError("servicefabric.BaseClient", "GetDeployedServiceReplicaInfoList", err.Error()) 8523 } 8524 8525 req, err := client.GetDeployedServiceReplicaInfoListPreparer(ctx, nodeName, applicationID, partitionID, serviceManifestName, timeout) 8526 if err != nil { 8527 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServiceReplicaInfoList", nil, "Failure preparing request") 8528 return 8529 } 8530 8531 resp, err := client.GetDeployedServiceReplicaInfoListSender(req) 8532 if err != nil { 8533 result.Response = autorest.Response{Response: resp} 8534 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServiceReplicaInfoList", resp, "Failure sending request") 8535 return 8536 } 8537 8538 result, err = client.GetDeployedServiceReplicaInfoListResponder(resp) 8539 if err != nil { 8540 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServiceReplicaInfoList", resp, "Failure responding to request") 8541 return 8542 } 8543 8544 return 8545} 8546 8547// GetDeployedServiceReplicaInfoListPreparer prepares the GetDeployedServiceReplicaInfoList request. 8548func (client BaseClient) GetDeployedServiceReplicaInfoListPreparer(ctx context.Context, nodeName string, applicationID string, partitionID *uuid.UUID, serviceManifestName string, timeout *int64) (*http.Request, error) { 8549 pathParameters := map[string]interface{}{ 8550 "applicationId": applicationID, 8551 "nodeName": autorest.Encode("path", nodeName), 8552 } 8553 8554 const APIVersion = "6.0" 8555 queryParameters := map[string]interface{}{ 8556 "api-version": APIVersion, 8557 } 8558 if partitionID != nil { 8559 queryParameters["PartitionId"] = autorest.Encode("query", *partitionID) 8560 } 8561 if len(serviceManifestName) > 0 { 8562 queryParameters["ServiceManifestName"] = autorest.Encode("query", serviceManifestName) 8563 } 8564 if timeout != nil { 8565 queryParameters["timeout"] = autorest.Encode("query", *timeout) 8566 } else { 8567 queryParameters["timeout"] = autorest.Encode("query", 60) 8568 } 8569 8570 preparer := autorest.CreatePreparer( 8571 autorest.AsGet(), 8572 autorest.WithBaseURL(client.BaseURI), 8573 autorest.WithPathParameters("/Nodes/{nodeName}/$/GetApplications/{applicationId}/$/GetReplicas", pathParameters), 8574 autorest.WithQueryParameters(queryParameters)) 8575 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 8576} 8577 8578// GetDeployedServiceReplicaInfoListSender sends the GetDeployedServiceReplicaInfoList request. The method will close the 8579// http.Response Body if it receives an error. 8580func (client BaseClient) GetDeployedServiceReplicaInfoListSender(req *http.Request) (*http.Response, error) { 8581 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 8582} 8583 8584// GetDeployedServiceReplicaInfoListResponder handles the response to the GetDeployedServiceReplicaInfoList request. The method always 8585// closes the http.Response Body. 8586func (client BaseClient) GetDeployedServiceReplicaInfoListResponder(resp *http.Response) (result ListDeployedServiceReplicaInfo, err error) { 8587 err = autorest.Respond( 8588 resp, 8589 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), 8590 autorest.ByUnmarshallingJSON(&result), 8591 autorest.ByClosing()) 8592 result.Response = autorest.Response{Response: resp} 8593 return 8594} 8595 8596// GetDeployedServiceTypeInfoByName gets the list containing the information about a specific service type from the 8597// applications deployed on a node in a Service Fabric cluster. The response includes the name of the service type, its 8598// registration status, the code package that registered it and activation ID of the service package. Each entry 8599// represents one activation of a service type, differentiated by the activation ID. 8600// Parameters: 8601// nodeName - the name of the node. 8602// applicationID - the identity of the application. This is typically the full name of the application without 8603// the 'fabric:' URI scheme. 8604// Starting from version 6.0, hierarchical names are delimited with the "~" character. 8605// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" 8606// in 6.0+ and "myapp/app1" in previous versions. 8607// serviceTypeName - specifies the name of a Service Fabric service type. 8608// serviceManifestName - the name of the service manifest to filter the list of deployed service type 8609// information. If specified, the response will only contain the information about service types that are 8610// defined in this service manifest. 8611// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 8612// duration that the client is willing to wait for the requested operation to complete. The default value for 8613// this parameter is 60 seconds. 8614func (client BaseClient) GetDeployedServiceTypeInfoByName(ctx context.Context, nodeName string, applicationID string, serviceTypeName string, serviceManifestName string, timeout *int64) (result ListDeployedServiceTypeInfo, err error) { 8615 if tracing.IsEnabled() { 8616 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetDeployedServiceTypeInfoByName") 8617 defer func() { 8618 sc := -1 8619 if result.Response.Response != nil { 8620 sc = result.Response.Response.StatusCode 8621 } 8622 tracing.EndSpan(ctx, sc, err) 8623 }() 8624 } 8625 if err := validation.Validate([]validation.Validation{ 8626 {TargetValue: timeout, 8627 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 8628 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 8629 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 8630 }}}}}); err != nil { 8631 return result, validation.NewError("servicefabric.BaseClient", "GetDeployedServiceTypeInfoByName", err.Error()) 8632 } 8633 8634 req, err := client.GetDeployedServiceTypeInfoByNamePreparer(ctx, nodeName, applicationID, serviceTypeName, serviceManifestName, timeout) 8635 if err != nil { 8636 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServiceTypeInfoByName", nil, "Failure preparing request") 8637 return 8638 } 8639 8640 resp, err := client.GetDeployedServiceTypeInfoByNameSender(req) 8641 if err != nil { 8642 result.Response = autorest.Response{Response: resp} 8643 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServiceTypeInfoByName", resp, "Failure sending request") 8644 return 8645 } 8646 8647 result, err = client.GetDeployedServiceTypeInfoByNameResponder(resp) 8648 if err != nil { 8649 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServiceTypeInfoByName", resp, "Failure responding to request") 8650 return 8651 } 8652 8653 return 8654} 8655 8656// GetDeployedServiceTypeInfoByNamePreparer prepares the GetDeployedServiceTypeInfoByName request. 8657func (client BaseClient) GetDeployedServiceTypeInfoByNamePreparer(ctx context.Context, nodeName string, applicationID string, serviceTypeName string, serviceManifestName string, timeout *int64) (*http.Request, error) { 8658 pathParameters := map[string]interface{}{ 8659 "applicationId": applicationID, 8660 "nodeName": autorest.Encode("path", nodeName), 8661 "serviceTypeName": serviceTypeName, 8662 } 8663 8664 const APIVersion = "6.0" 8665 queryParameters := map[string]interface{}{ 8666 "api-version": APIVersion, 8667 } 8668 if len(serviceManifestName) > 0 { 8669 queryParameters["ServiceManifestName"] = autorest.Encode("query", serviceManifestName) 8670 } 8671 if timeout != nil { 8672 queryParameters["timeout"] = autorest.Encode("query", *timeout) 8673 } else { 8674 queryParameters["timeout"] = autorest.Encode("query", 60) 8675 } 8676 8677 preparer := autorest.CreatePreparer( 8678 autorest.AsGet(), 8679 autorest.WithBaseURL(client.BaseURI), 8680 autorest.WithPathParameters("/Nodes/{nodeName}/$/GetApplications/{applicationId}/$/GetServiceTypes/{serviceTypeName}", pathParameters), 8681 autorest.WithQueryParameters(queryParameters)) 8682 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 8683} 8684 8685// GetDeployedServiceTypeInfoByNameSender sends the GetDeployedServiceTypeInfoByName request. The method will close the 8686// http.Response Body if it receives an error. 8687func (client BaseClient) GetDeployedServiceTypeInfoByNameSender(req *http.Request) (*http.Response, error) { 8688 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 8689} 8690 8691// GetDeployedServiceTypeInfoByNameResponder handles the response to the GetDeployedServiceTypeInfoByName request. The method always 8692// closes the http.Response Body. 8693func (client BaseClient) GetDeployedServiceTypeInfoByNameResponder(resp *http.Response) (result ListDeployedServiceTypeInfo, err error) { 8694 err = autorest.Respond( 8695 resp, 8696 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), 8697 autorest.ByUnmarshallingJSON(&result.Value), 8698 autorest.ByClosing()) 8699 result.Response = autorest.Response{Response: resp} 8700 return 8701} 8702 8703// GetDeployedServiceTypeInfoList gets the list containing the information about service types from the applications 8704// deployed on a node in a Service Fabric cluster. The response includes the name of the service type, its registration 8705// status, the code package that registered it and activation ID of the service package. 8706// Parameters: 8707// nodeName - the name of the node. 8708// applicationID - the identity of the application. This is typically the full name of the application without 8709// the 'fabric:' URI scheme. 8710// Starting from version 6.0, hierarchical names are delimited with the "~" character. 8711// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" 8712// in 6.0+ and "myapp/app1" in previous versions. 8713// serviceManifestName - the name of the service manifest to filter the list of deployed service type 8714// information. If specified, the response will only contain the information about service types that are 8715// defined in this service manifest. 8716// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 8717// duration that the client is willing to wait for the requested operation to complete. The default value for 8718// this parameter is 60 seconds. 8719func (client BaseClient) GetDeployedServiceTypeInfoList(ctx context.Context, nodeName string, applicationID string, serviceManifestName string, timeout *int64) (result ListDeployedServiceTypeInfo, err error) { 8720 if tracing.IsEnabled() { 8721 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetDeployedServiceTypeInfoList") 8722 defer func() { 8723 sc := -1 8724 if result.Response.Response != nil { 8725 sc = result.Response.Response.StatusCode 8726 } 8727 tracing.EndSpan(ctx, sc, err) 8728 }() 8729 } 8730 if err := validation.Validate([]validation.Validation{ 8731 {TargetValue: timeout, 8732 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 8733 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 8734 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 8735 }}}}}); err != nil { 8736 return result, validation.NewError("servicefabric.BaseClient", "GetDeployedServiceTypeInfoList", err.Error()) 8737 } 8738 8739 req, err := client.GetDeployedServiceTypeInfoListPreparer(ctx, nodeName, applicationID, serviceManifestName, timeout) 8740 if err != nil { 8741 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServiceTypeInfoList", nil, "Failure preparing request") 8742 return 8743 } 8744 8745 resp, err := client.GetDeployedServiceTypeInfoListSender(req) 8746 if err != nil { 8747 result.Response = autorest.Response{Response: resp} 8748 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServiceTypeInfoList", resp, "Failure sending request") 8749 return 8750 } 8751 8752 result, err = client.GetDeployedServiceTypeInfoListResponder(resp) 8753 if err != nil { 8754 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetDeployedServiceTypeInfoList", resp, "Failure responding to request") 8755 return 8756 } 8757 8758 return 8759} 8760 8761// GetDeployedServiceTypeInfoListPreparer prepares the GetDeployedServiceTypeInfoList request. 8762func (client BaseClient) GetDeployedServiceTypeInfoListPreparer(ctx context.Context, nodeName string, applicationID string, serviceManifestName string, timeout *int64) (*http.Request, error) { 8763 pathParameters := map[string]interface{}{ 8764 "applicationId": applicationID, 8765 "nodeName": autorest.Encode("path", nodeName), 8766 } 8767 8768 const APIVersion = "6.0" 8769 queryParameters := map[string]interface{}{ 8770 "api-version": APIVersion, 8771 } 8772 if len(serviceManifestName) > 0 { 8773 queryParameters["ServiceManifestName"] = autorest.Encode("query", serviceManifestName) 8774 } 8775 if timeout != nil { 8776 queryParameters["timeout"] = autorest.Encode("query", *timeout) 8777 } else { 8778 queryParameters["timeout"] = autorest.Encode("query", 60) 8779 } 8780 8781 preparer := autorest.CreatePreparer( 8782 autorest.AsGet(), 8783 autorest.WithBaseURL(client.BaseURI), 8784 autorest.WithPathParameters("/Nodes/{nodeName}/$/GetApplications/{applicationId}/$/GetServiceTypes", pathParameters), 8785 autorest.WithQueryParameters(queryParameters)) 8786 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 8787} 8788 8789// GetDeployedServiceTypeInfoListSender sends the GetDeployedServiceTypeInfoList request. The method will close the 8790// http.Response Body if it receives an error. 8791func (client BaseClient) GetDeployedServiceTypeInfoListSender(req *http.Request) (*http.Response, error) { 8792 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 8793} 8794 8795// GetDeployedServiceTypeInfoListResponder handles the response to the GetDeployedServiceTypeInfoList request. The method always 8796// closes the http.Response Body. 8797func (client BaseClient) GetDeployedServiceTypeInfoListResponder(resp *http.Response) (result ListDeployedServiceTypeInfo, err error) { 8798 err = autorest.Respond( 8799 resp, 8800 azure.WithErrorUnlessStatusCode(http.StatusOK), 8801 autorest.ByUnmarshallingJSON(&result.Value), 8802 autorest.ByClosing()) 8803 result.Response = autorest.Response{Response: resp} 8804 return 8805} 8806 8807// GetFaultOperationList gets the list of user-induced fault operations filtered by provided input. 8808// Parameters: 8809// typeFilter - used to filter on OperationType for user-induced operations. 8810// 8811// - 65535 - select all 8812// - 1 - select PartitionDataLoss. 8813// - 2 - select PartitionQuorumLoss. 8814// - 4 - select PartitionRestart. 8815// - 8 - select NodeTransition. 8816// stateFilter - used to filter on OperationState's for user-induced operations. 8817// 8818// - 65535 - select All 8819// - 1 - select Running 8820// - 2 - select RollingBack 8821// - 8 - select Completed 8822// - 16 - select Faulted 8823// - 32 - select Cancelled 8824// - 64 - select ForceCancelled 8825// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 8826// duration that the client is willing to wait for the requested operation to complete. The default value for 8827// this parameter is 60 seconds. 8828func (client BaseClient) GetFaultOperationList(ctx context.Context, typeFilter int32, stateFilter int32, timeout *int64) (result ListOperationStatus, err error) { 8829 if tracing.IsEnabled() { 8830 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetFaultOperationList") 8831 defer func() { 8832 sc := -1 8833 if result.Response.Response != nil { 8834 sc = result.Response.Response.StatusCode 8835 } 8836 tracing.EndSpan(ctx, sc, err) 8837 }() 8838 } 8839 if err := validation.Validate([]validation.Validation{ 8840 {TargetValue: timeout, 8841 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 8842 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 8843 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 8844 }}}}}); err != nil { 8845 return result, validation.NewError("servicefabric.BaseClient", "GetFaultOperationList", err.Error()) 8846 } 8847 8848 req, err := client.GetFaultOperationListPreparer(ctx, typeFilter, stateFilter, timeout) 8849 if err != nil { 8850 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetFaultOperationList", nil, "Failure preparing request") 8851 return 8852 } 8853 8854 resp, err := client.GetFaultOperationListSender(req) 8855 if err != nil { 8856 result.Response = autorest.Response{Response: resp} 8857 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetFaultOperationList", resp, "Failure sending request") 8858 return 8859 } 8860 8861 result, err = client.GetFaultOperationListResponder(resp) 8862 if err != nil { 8863 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetFaultOperationList", resp, "Failure responding to request") 8864 return 8865 } 8866 8867 return 8868} 8869 8870// GetFaultOperationListPreparer prepares the GetFaultOperationList request. 8871func (client BaseClient) GetFaultOperationListPreparer(ctx context.Context, typeFilter int32, stateFilter int32, timeout *int64) (*http.Request, error) { 8872 const APIVersion = "6.0" 8873 queryParameters := map[string]interface{}{ 8874 "api-version": APIVersion, 8875 "StateFilter": autorest.Encode("query", stateFilter), 8876 "TypeFilter": autorest.Encode("query", typeFilter), 8877 } 8878 if timeout != nil { 8879 queryParameters["timeout"] = autorest.Encode("query", *timeout) 8880 } else { 8881 queryParameters["timeout"] = autorest.Encode("query", 60) 8882 } 8883 8884 preparer := autorest.CreatePreparer( 8885 autorest.AsGet(), 8886 autorest.WithBaseURL(client.BaseURI), 8887 autorest.WithPath("/Faults/"), 8888 autorest.WithQueryParameters(queryParameters)) 8889 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 8890} 8891 8892// GetFaultOperationListSender sends the GetFaultOperationList request. The method will close the 8893// http.Response Body if it receives an error. 8894func (client BaseClient) GetFaultOperationListSender(req *http.Request) (*http.Response, error) { 8895 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 8896} 8897 8898// GetFaultOperationListResponder handles the response to the GetFaultOperationList request. The method always 8899// closes the http.Response Body. 8900func (client BaseClient) GetFaultOperationListResponder(resp *http.Response) (result ListOperationStatus, err error) { 8901 err = autorest.Respond( 8902 resp, 8903 azure.WithErrorUnlessStatusCode(http.StatusOK), 8904 autorest.ByUnmarshallingJSON(&result.Value), 8905 autorest.ByClosing()) 8906 result.Response = autorest.Response{Response: resp} 8907 return 8908} 8909 8910// GetImageStoreContent returns the information about the image store content at the specified contentPath. The 8911// contentPath is relative to the root of the image store. 8912// Parameters: 8913// contentPath - relative path to file or folder in the image store from its root. 8914// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 8915// duration that the client is willing to wait for the requested operation to complete. The default value for 8916// this parameter is 60 seconds. 8917func (client BaseClient) GetImageStoreContent(ctx context.Context, contentPath string, timeout *int64) (result ImageStoreContent, err error) { 8918 if tracing.IsEnabled() { 8919 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetImageStoreContent") 8920 defer func() { 8921 sc := -1 8922 if result.Response.Response != nil { 8923 sc = result.Response.Response.StatusCode 8924 } 8925 tracing.EndSpan(ctx, sc, err) 8926 }() 8927 } 8928 if err := validation.Validate([]validation.Validation{ 8929 {TargetValue: timeout, 8930 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 8931 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 8932 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 8933 }}}}}); err != nil { 8934 return result, validation.NewError("servicefabric.BaseClient", "GetImageStoreContent", err.Error()) 8935 } 8936 8937 req, err := client.GetImageStoreContentPreparer(ctx, contentPath, timeout) 8938 if err != nil { 8939 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetImageStoreContent", nil, "Failure preparing request") 8940 return 8941 } 8942 8943 resp, err := client.GetImageStoreContentSender(req) 8944 if err != nil { 8945 result.Response = autorest.Response{Response: resp} 8946 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetImageStoreContent", resp, "Failure sending request") 8947 return 8948 } 8949 8950 result, err = client.GetImageStoreContentResponder(resp) 8951 if err != nil { 8952 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetImageStoreContent", resp, "Failure responding to request") 8953 return 8954 } 8955 8956 return 8957} 8958 8959// GetImageStoreContentPreparer prepares the GetImageStoreContent request. 8960func (client BaseClient) GetImageStoreContentPreparer(ctx context.Context, contentPath string, timeout *int64) (*http.Request, error) { 8961 pathParameters := map[string]interface{}{ 8962 "contentPath": autorest.Encode("path", contentPath), 8963 } 8964 8965 const APIVersion = "6.2" 8966 queryParameters := map[string]interface{}{ 8967 "api-version": APIVersion, 8968 } 8969 if timeout != nil { 8970 queryParameters["timeout"] = autorest.Encode("query", *timeout) 8971 } else { 8972 queryParameters["timeout"] = autorest.Encode("query", 60) 8973 } 8974 8975 preparer := autorest.CreatePreparer( 8976 autorest.AsGet(), 8977 autorest.WithBaseURL(client.BaseURI), 8978 autorest.WithPathParameters("/ImageStore/{contentPath}", pathParameters), 8979 autorest.WithQueryParameters(queryParameters)) 8980 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 8981} 8982 8983// GetImageStoreContentSender sends the GetImageStoreContent request. The method will close the 8984// http.Response Body if it receives an error. 8985func (client BaseClient) GetImageStoreContentSender(req *http.Request) (*http.Response, error) { 8986 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 8987} 8988 8989// GetImageStoreContentResponder handles the response to the GetImageStoreContent request. The method always 8990// closes the http.Response Body. 8991func (client BaseClient) GetImageStoreContentResponder(resp *http.Response) (result ImageStoreContent, err error) { 8992 err = autorest.Respond( 8993 resp, 8994 azure.WithErrorUnlessStatusCode(http.StatusOK), 8995 autorest.ByUnmarshallingJSON(&result), 8996 autorest.ByClosing()) 8997 result.Response = autorest.Response{Response: resp} 8998 return 8999} 9000 9001// GetImageStoreRootContent returns the information about the image store content at the root of the image store. 9002// Parameters: 9003// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 9004// duration that the client is willing to wait for the requested operation to complete. The default value for 9005// this parameter is 60 seconds. 9006func (client BaseClient) GetImageStoreRootContent(ctx context.Context, timeout *int64) (result ImageStoreContent, err error) { 9007 if tracing.IsEnabled() { 9008 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetImageStoreRootContent") 9009 defer func() { 9010 sc := -1 9011 if result.Response.Response != nil { 9012 sc = result.Response.Response.StatusCode 9013 } 9014 tracing.EndSpan(ctx, sc, err) 9015 }() 9016 } 9017 if err := validation.Validate([]validation.Validation{ 9018 {TargetValue: timeout, 9019 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 9020 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 9021 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 9022 }}}}}); err != nil { 9023 return result, validation.NewError("servicefabric.BaseClient", "GetImageStoreRootContent", err.Error()) 9024 } 9025 9026 req, err := client.GetImageStoreRootContentPreparer(ctx, timeout) 9027 if err != nil { 9028 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetImageStoreRootContent", nil, "Failure preparing request") 9029 return 9030 } 9031 9032 resp, err := client.GetImageStoreRootContentSender(req) 9033 if err != nil { 9034 result.Response = autorest.Response{Response: resp} 9035 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetImageStoreRootContent", resp, "Failure sending request") 9036 return 9037 } 9038 9039 result, err = client.GetImageStoreRootContentResponder(resp) 9040 if err != nil { 9041 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetImageStoreRootContent", resp, "Failure responding to request") 9042 return 9043 } 9044 9045 return 9046} 9047 9048// GetImageStoreRootContentPreparer prepares the GetImageStoreRootContent request. 9049func (client BaseClient) GetImageStoreRootContentPreparer(ctx context.Context, timeout *int64) (*http.Request, error) { 9050 const APIVersion = "6.0" 9051 queryParameters := map[string]interface{}{ 9052 "api-version": APIVersion, 9053 } 9054 if timeout != nil { 9055 queryParameters["timeout"] = autorest.Encode("query", *timeout) 9056 } else { 9057 queryParameters["timeout"] = autorest.Encode("query", 60) 9058 } 9059 9060 preparer := autorest.CreatePreparer( 9061 autorest.AsGet(), 9062 autorest.WithBaseURL(client.BaseURI), 9063 autorest.WithPath("/ImageStore"), 9064 autorest.WithQueryParameters(queryParameters)) 9065 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 9066} 9067 9068// GetImageStoreRootContentSender sends the GetImageStoreRootContent request. The method will close the 9069// http.Response Body if it receives an error. 9070func (client BaseClient) GetImageStoreRootContentSender(req *http.Request) (*http.Response, error) { 9071 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 9072} 9073 9074// GetImageStoreRootContentResponder handles the response to the GetImageStoreRootContent request. The method always 9075// closes the http.Response Body. 9076func (client BaseClient) GetImageStoreRootContentResponder(resp *http.Response) (result ImageStoreContent, err error) { 9077 err = autorest.Respond( 9078 resp, 9079 azure.WithErrorUnlessStatusCode(http.StatusOK), 9080 autorest.ByUnmarshallingJSON(&result), 9081 autorest.ByClosing()) 9082 result.Response = autorest.Response{Response: resp} 9083 return 9084} 9085 9086// GetImageStoreUploadSessionByID gets the image store upload session identified by the given ID. User can query the 9087// upload session at any time during uploading. 9088// Parameters: 9089// sessionID - a GUID generated by the user for a file uploading. It identifies an image store upload session 9090// which keeps track of all file chunks until it is committed. 9091// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 9092// duration that the client is willing to wait for the requested operation to complete. The default value for 9093// this parameter is 60 seconds. 9094func (client BaseClient) GetImageStoreUploadSessionByID(ctx context.Context, sessionID uuid.UUID, timeout *int64) (result UploadSession, err error) { 9095 if tracing.IsEnabled() { 9096 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetImageStoreUploadSessionByID") 9097 defer func() { 9098 sc := -1 9099 if result.Response.Response != nil { 9100 sc = result.Response.Response.StatusCode 9101 } 9102 tracing.EndSpan(ctx, sc, err) 9103 }() 9104 } 9105 if err := validation.Validate([]validation.Validation{ 9106 {TargetValue: timeout, 9107 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 9108 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 9109 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 9110 }}}}}); err != nil { 9111 return result, validation.NewError("servicefabric.BaseClient", "GetImageStoreUploadSessionByID", err.Error()) 9112 } 9113 9114 req, err := client.GetImageStoreUploadSessionByIDPreparer(ctx, sessionID, timeout) 9115 if err != nil { 9116 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetImageStoreUploadSessionByID", nil, "Failure preparing request") 9117 return 9118 } 9119 9120 resp, err := client.GetImageStoreUploadSessionByIDSender(req) 9121 if err != nil { 9122 result.Response = autorest.Response{Response: resp} 9123 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetImageStoreUploadSessionByID", resp, "Failure sending request") 9124 return 9125 } 9126 9127 result, err = client.GetImageStoreUploadSessionByIDResponder(resp) 9128 if err != nil { 9129 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetImageStoreUploadSessionByID", resp, "Failure responding to request") 9130 return 9131 } 9132 9133 return 9134} 9135 9136// GetImageStoreUploadSessionByIDPreparer prepares the GetImageStoreUploadSessionByID request. 9137func (client BaseClient) GetImageStoreUploadSessionByIDPreparer(ctx context.Context, sessionID uuid.UUID, timeout *int64) (*http.Request, error) { 9138 const APIVersion = "6.0" 9139 queryParameters := map[string]interface{}{ 9140 "api-version": APIVersion, 9141 "session-id": autorest.Encode("query", sessionID), 9142 } 9143 if timeout != nil { 9144 queryParameters["timeout"] = autorest.Encode("query", *timeout) 9145 } else { 9146 queryParameters["timeout"] = autorest.Encode("query", 60) 9147 } 9148 9149 preparer := autorest.CreatePreparer( 9150 autorest.AsGet(), 9151 autorest.WithBaseURL(client.BaseURI), 9152 autorest.WithPath("/ImageStore/$/GetUploadSession"), 9153 autorest.WithQueryParameters(queryParameters)) 9154 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 9155} 9156 9157// GetImageStoreUploadSessionByIDSender sends the GetImageStoreUploadSessionByID request. The method will close the 9158// http.Response Body if it receives an error. 9159func (client BaseClient) GetImageStoreUploadSessionByIDSender(req *http.Request) (*http.Response, error) { 9160 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 9161} 9162 9163// GetImageStoreUploadSessionByIDResponder handles the response to the GetImageStoreUploadSessionByID request. The method always 9164// closes the http.Response Body. 9165func (client BaseClient) GetImageStoreUploadSessionByIDResponder(resp *http.Response) (result UploadSession, err error) { 9166 err = autorest.Respond( 9167 resp, 9168 azure.WithErrorUnlessStatusCode(http.StatusOK), 9169 autorest.ByUnmarshallingJSON(&result), 9170 autorest.ByClosing()) 9171 result.Response = autorest.Response{Response: resp} 9172 return 9173} 9174 9175// GetImageStoreUploadSessionByPath gets the image store upload session associated with the given image store relative 9176// path. User can query the upload session at any time during uploading. 9177// Parameters: 9178// contentPath - relative path to file or folder in the image store from its root. 9179// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 9180// duration that the client is willing to wait for the requested operation to complete. The default value for 9181// this parameter is 60 seconds. 9182func (client BaseClient) GetImageStoreUploadSessionByPath(ctx context.Context, contentPath string, timeout *int64) (result UploadSession, err error) { 9183 if tracing.IsEnabled() { 9184 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetImageStoreUploadSessionByPath") 9185 defer func() { 9186 sc := -1 9187 if result.Response.Response != nil { 9188 sc = result.Response.Response.StatusCode 9189 } 9190 tracing.EndSpan(ctx, sc, err) 9191 }() 9192 } 9193 if err := validation.Validate([]validation.Validation{ 9194 {TargetValue: timeout, 9195 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 9196 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 9197 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 9198 }}}}}); err != nil { 9199 return result, validation.NewError("servicefabric.BaseClient", "GetImageStoreUploadSessionByPath", err.Error()) 9200 } 9201 9202 req, err := client.GetImageStoreUploadSessionByPathPreparer(ctx, contentPath, timeout) 9203 if err != nil { 9204 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetImageStoreUploadSessionByPath", nil, "Failure preparing request") 9205 return 9206 } 9207 9208 resp, err := client.GetImageStoreUploadSessionByPathSender(req) 9209 if err != nil { 9210 result.Response = autorest.Response{Response: resp} 9211 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetImageStoreUploadSessionByPath", resp, "Failure sending request") 9212 return 9213 } 9214 9215 result, err = client.GetImageStoreUploadSessionByPathResponder(resp) 9216 if err != nil { 9217 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetImageStoreUploadSessionByPath", resp, "Failure responding to request") 9218 return 9219 } 9220 9221 return 9222} 9223 9224// GetImageStoreUploadSessionByPathPreparer prepares the GetImageStoreUploadSessionByPath request. 9225func (client BaseClient) GetImageStoreUploadSessionByPathPreparer(ctx context.Context, contentPath string, timeout *int64) (*http.Request, error) { 9226 pathParameters := map[string]interface{}{ 9227 "contentPath": autorest.Encode("path", contentPath), 9228 } 9229 9230 const APIVersion = "6.0" 9231 queryParameters := map[string]interface{}{ 9232 "api-version": APIVersion, 9233 } 9234 if timeout != nil { 9235 queryParameters["timeout"] = autorest.Encode("query", *timeout) 9236 } else { 9237 queryParameters["timeout"] = autorest.Encode("query", 60) 9238 } 9239 9240 preparer := autorest.CreatePreparer( 9241 autorest.AsGet(), 9242 autorest.WithBaseURL(client.BaseURI), 9243 autorest.WithPathParameters("/ImageStore/{contentPath}/$/GetUploadSession", pathParameters), 9244 autorest.WithQueryParameters(queryParameters)) 9245 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 9246} 9247 9248// GetImageStoreUploadSessionByPathSender sends the GetImageStoreUploadSessionByPath request. The method will close the 9249// http.Response Body if it receives an error. 9250func (client BaseClient) GetImageStoreUploadSessionByPathSender(req *http.Request) (*http.Response, error) { 9251 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 9252} 9253 9254// GetImageStoreUploadSessionByPathResponder handles the response to the GetImageStoreUploadSessionByPath request. The method always 9255// closes the http.Response Body. 9256func (client BaseClient) GetImageStoreUploadSessionByPathResponder(resp *http.Response) (result UploadSession, err error) { 9257 err = autorest.Respond( 9258 resp, 9259 azure.WithErrorUnlessStatusCode(http.StatusOK), 9260 autorest.ByUnmarshallingJSON(&result), 9261 autorest.ByClosing()) 9262 result.Response = autorest.Response{Response: resp} 9263 return 9264} 9265 9266// GetNameExistsInfo returns whether the specified Service Fabric name exists. 9267// Parameters: 9268// nameID - the Service Fabric name, without the 'fabric:' URI scheme. 9269// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 9270// duration that the client is willing to wait for the requested operation to complete. The default value for 9271// this parameter is 60 seconds. 9272func (client BaseClient) GetNameExistsInfo(ctx context.Context, nameID string, timeout *int64) (result autorest.Response, err error) { 9273 if tracing.IsEnabled() { 9274 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetNameExistsInfo") 9275 defer func() { 9276 sc := -1 9277 if result.Response != nil { 9278 sc = result.Response.StatusCode 9279 } 9280 tracing.EndSpan(ctx, sc, err) 9281 }() 9282 } 9283 if err := validation.Validate([]validation.Validation{ 9284 {TargetValue: timeout, 9285 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 9286 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 9287 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 9288 }}}}}); err != nil { 9289 return result, validation.NewError("servicefabric.BaseClient", "GetNameExistsInfo", err.Error()) 9290 } 9291 9292 req, err := client.GetNameExistsInfoPreparer(ctx, nameID, timeout) 9293 if err != nil { 9294 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNameExistsInfo", nil, "Failure preparing request") 9295 return 9296 } 9297 9298 resp, err := client.GetNameExistsInfoSender(req) 9299 if err != nil { 9300 result.Response = resp 9301 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNameExistsInfo", resp, "Failure sending request") 9302 return 9303 } 9304 9305 result, err = client.GetNameExistsInfoResponder(resp) 9306 if err != nil { 9307 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNameExistsInfo", resp, "Failure responding to request") 9308 return 9309 } 9310 9311 return 9312} 9313 9314// GetNameExistsInfoPreparer prepares the GetNameExistsInfo request. 9315func (client BaseClient) GetNameExistsInfoPreparer(ctx context.Context, nameID string, timeout *int64) (*http.Request, error) { 9316 pathParameters := map[string]interface{}{ 9317 "nameId": nameID, 9318 } 9319 9320 const APIVersion = "6.0" 9321 queryParameters := map[string]interface{}{ 9322 "api-version": APIVersion, 9323 } 9324 if timeout != nil { 9325 queryParameters["timeout"] = autorest.Encode("query", *timeout) 9326 } else { 9327 queryParameters["timeout"] = autorest.Encode("query", 60) 9328 } 9329 9330 preparer := autorest.CreatePreparer( 9331 autorest.AsGet(), 9332 autorest.WithBaseURL(client.BaseURI), 9333 autorest.WithPathParameters("/Names/{nameId}", pathParameters), 9334 autorest.WithQueryParameters(queryParameters)) 9335 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 9336} 9337 9338// GetNameExistsInfoSender sends the GetNameExistsInfo request. The method will close the 9339// http.Response Body if it receives an error. 9340func (client BaseClient) GetNameExistsInfoSender(req *http.Request) (*http.Response, error) { 9341 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 9342} 9343 9344// GetNameExistsInfoResponder handles the response to the GetNameExistsInfo request. The method always 9345// closes the http.Response Body. 9346func (client BaseClient) GetNameExistsInfoResponder(resp *http.Response) (result autorest.Response, err error) { 9347 err = autorest.Respond( 9348 resp, 9349 azure.WithErrorUnlessStatusCode(http.StatusOK), 9350 autorest.ByClosing()) 9351 result.Response = resp 9352 return 9353} 9354 9355// GetNodeEventList the response is list of NodeEvent objects. 9356// Parameters: 9357// nodeName - the name of the node. 9358// startTimeUtc - the start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. 9359// endTimeUtc - the end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. 9360// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 9361// duration that the client is willing to wait for the requested operation to complete. The default value for 9362// this parameter is 60 seconds. 9363// eventsTypesFilter - this is a comma separated string specifying the types of FabricEvents that should only 9364// be included in the response. 9365// excludeAnalysisEvents - this param disables the retrieval of AnalysisEvents if true is passed. 9366// skipCorrelationLookup - this param disables the search of CorrelatedEvents information if true is passed. 9367// otherwise the CorrelationEvents get processed and HasCorrelatedEvents field in every FabricEvent gets 9368// populated. 9369func (client BaseClient) GetNodeEventList(ctx context.Context, nodeName string, startTimeUtc string, endTimeUtc string, timeout *int64, eventsTypesFilter string, excludeAnalysisEvents *bool, skipCorrelationLookup *bool) (result ListNodeEvent, err error) { 9370 if tracing.IsEnabled() { 9371 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetNodeEventList") 9372 defer func() { 9373 sc := -1 9374 if result.Response.Response != nil { 9375 sc = result.Response.Response.StatusCode 9376 } 9377 tracing.EndSpan(ctx, sc, err) 9378 }() 9379 } 9380 if err := validation.Validate([]validation.Validation{ 9381 {TargetValue: timeout, 9382 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 9383 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 9384 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 9385 }}}}}); err != nil { 9386 return result, validation.NewError("servicefabric.BaseClient", "GetNodeEventList", err.Error()) 9387 } 9388 9389 req, err := client.GetNodeEventListPreparer(ctx, nodeName, startTimeUtc, endTimeUtc, timeout, eventsTypesFilter, excludeAnalysisEvents, skipCorrelationLookup) 9390 if err != nil { 9391 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNodeEventList", nil, "Failure preparing request") 9392 return 9393 } 9394 9395 resp, err := client.GetNodeEventListSender(req) 9396 if err != nil { 9397 result.Response = autorest.Response{Response: resp} 9398 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNodeEventList", resp, "Failure sending request") 9399 return 9400 } 9401 9402 result, err = client.GetNodeEventListResponder(resp) 9403 if err != nil { 9404 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNodeEventList", resp, "Failure responding to request") 9405 return 9406 } 9407 9408 return 9409} 9410 9411// GetNodeEventListPreparer prepares the GetNodeEventList request. 9412func (client BaseClient) GetNodeEventListPreparer(ctx context.Context, nodeName string, startTimeUtc string, endTimeUtc string, timeout *int64, eventsTypesFilter string, excludeAnalysisEvents *bool, skipCorrelationLookup *bool) (*http.Request, error) { 9413 pathParameters := map[string]interface{}{ 9414 "nodeName": autorest.Encode("path", nodeName), 9415 } 9416 9417 const APIVersion = "6.4" 9418 queryParameters := map[string]interface{}{ 9419 "api-version": APIVersion, 9420 "EndTimeUtc": autorest.Encode("query", endTimeUtc), 9421 "StartTimeUtc": autorest.Encode("query", startTimeUtc), 9422 } 9423 if timeout != nil { 9424 queryParameters["timeout"] = autorest.Encode("query", *timeout) 9425 } else { 9426 queryParameters["timeout"] = autorest.Encode("query", 60) 9427 } 9428 if len(eventsTypesFilter) > 0 { 9429 queryParameters["EventsTypesFilter"] = autorest.Encode("query", eventsTypesFilter) 9430 } 9431 if excludeAnalysisEvents != nil { 9432 queryParameters["ExcludeAnalysisEvents"] = autorest.Encode("query", *excludeAnalysisEvents) 9433 } 9434 if skipCorrelationLookup != nil { 9435 queryParameters["SkipCorrelationLookup"] = autorest.Encode("query", *skipCorrelationLookup) 9436 } 9437 9438 preparer := autorest.CreatePreparer( 9439 autorest.AsGet(), 9440 autorest.WithBaseURL(client.BaseURI), 9441 autorest.WithPathParameters("/EventsStore/Nodes/{nodeName}/$/Events", pathParameters), 9442 autorest.WithQueryParameters(queryParameters)) 9443 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 9444} 9445 9446// GetNodeEventListSender sends the GetNodeEventList request. The method will close the 9447// http.Response Body if it receives an error. 9448func (client BaseClient) GetNodeEventListSender(req *http.Request) (*http.Response, error) { 9449 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 9450} 9451 9452// GetNodeEventListResponder handles the response to the GetNodeEventList request. The method always 9453// closes the http.Response Body. 9454func (client BaseClient) GetNodeEventListResponder(resp *http.Response) (result ListNodeEvent, err error) { 9455 err = autorest.Respond( 9456 resp, 9457 azure.WithErrorUnlessStatusCode(http.StatusOK), 9458 autorest.ByUnmarshallingJSON(&result), 9459 autorest.ByClosing()) 9460 result.Response = autorest.Response{Response: resp} 9461 return 9462} 9463 9464// GetNodeHealth gets the health of a Service Fabric node. Use EventsHealthStateFilter to filter the collection of 9465// health events reported on the node based on the health state. If the node that you specify by name does not exist in 9466// the health store, this returns an error. 9467// Parameters: 9468// nodeName - the name of the node. 9469// eventsHealthStateFilter - allows filtering the collection of HealthEvent objects returned based on health 9470// state. 9471// The possible values for this parameter include integer value of one of the following health states. 9472// Only events that match the filter are returned. All events are used to evaluate the aggregated health state. 9473// If not specified, all entries are returned. The state values are flag-based enumeration, so the value could 9474// be a combination of these values, obtained using the bitwise 'OR' operator. For example, If the provided 9475// value is 6 then all of the events with HealthState value of OK (2) and Warning (4) are returned. 9476// 9477// - Default - Default value. Matches any HealthState. The value is zero. 9478// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given 9479// collection of states. The value is 1. 9480// - Ok - Filter that matches input with HealthState value Ok. The value is 2. 9481// - Warning - Filter that matches input with HealthState value Warning. The value is 4. 9482// - Error - Filter that matches input with HealthState value Error. The value is 8. 9483// - All - Filter that matches input with any HealthState value. The value is 65535. 9484// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 9485// duration that the client is willing to wait for the requested operation to complete. The default value for 9486// this parameter is 60 seconds. 9487func (client BaseClient) GetNodeHealth(ctx context.Context, nodeName string, eventsHealthStateFilter *int32, timeout *int64) (result NodeHealth, err error) { 9488 if tracing.IsEnabled() { 9489 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetNodeHealth") 9490 defer func() { 9491 sc := -1 9492 if result.Response.Response != nil { 9493 sc = result.Response.Response.StatusCode 9494 } 9495 tracing.EndSpan(ctx, sc, err) 9496 }() 9497 } 9498 if err := validation.Validate([]validation.Validation{ 9499 {TargetValue: timeout, 9500 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 9501 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 9502 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 9503 }}}}}); err != nil { 9504 return result, validation.NewError("servicefabric.BaseClient", "GetNodeHealth", err.Error()) 9505 } 9506 9507 req, err := client.GetNodeHealthPreparer(ctx, nodeName, eventsHealthStateFilter, timeout) 9508 if err != nil { 9509 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNodeHealth", nil, "Failure preparing request") 9510 return 9511 } 9512 9513 resp, err := client.GetNodeHealthSender(req) 9514 if err != nil { 9515 result.Response = autorest.Response{Response: resp} 9516 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNodeHealth", resp, "Failure sending request") 9517 return 9518 } 9519 9520 result, err = client.GetNodeHealthResponder(resp) 9521 if err != nil { 9522 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNodeHealth", resp, "Failure responding to request") 9523 return 9524 } 9525 9526 return 9527} 9528 9529// GetNodeHealthPreparer prepares the GetNodeHealth request. 9530func (client BaseClient) GetNodeHealthPreparer(ctx context.Context, nodeName string, eventsHealthStateFilter *int32, timeout *int64) (*http.Request, error) { 9531 pathParameters := map[string]interface{}{ 9532 "nodeName": autorest.Encode("path", nodeName), 9533 } 9534 9535 const APIVersion = "6.0" 9536 queryParameters := map[string]interface{}{ 9537 "api-version": APIVersion, 9538 } 9539 if eventsHealthStateFilter != nil { 9540 queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", *eventsHealthStateFilter) 9541 } else { 9542 queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", 0) 9543 } 9544 if timeout != nil { 9545 queryParameters["timeout"] = autorest.Encode("query", *timeout) 9546 } else { 9547 queryParameters["timeout"] = autorest.Encode("query", 60) 9548 } 9549 9550 preparer := autorest.CreatePreparer( 9551 autorest.AsGet(), 9552 autorest.WithBaseURL(client.BaseURI), 9553 autorest.WithPathParameters("/Nodes/{nodeName}/$/GetHealth", pathParameters), 9554 autorest.WithQueryParameters(queryParameters)) 9555 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 9556} 9557 9558// GetNodeHealthSender sends the GetNodeHealth request. The method will close the 9559// http.Response Body if it receives an error. 9560func (client BaseClient) GetNodeHealthSender(req *http.Request) (*http.Response, error) { 9561 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 9562} 9563 9564// GetNodeHealthResponder handles the response to the GetNodeHealth request. The method always 9565// closes the http.Response Body. 9566func (client BaseClient) GetNodeHealthResponder(resp *http.Response) (result NodeHealth, err error) { 9567 err = autorest.Respond( 9568 resp, 9569 azure.WithErrorUnlessStatusCode(http.StatusOK), 9570 autorest.ByUnmarshallingJSON(&result), 9571 autorest.ByClosing()) 9572 result.Response = autorest.Response{Response: resp} 9573 return 9574} 9575 9576// GetNodeHealthUsingPolicy gets the health of a Service Fabric node. Use EventsHealthStateFilter to filter the 9577// collection of health events reported on the node based on the health state. Use ClusterHealthPolicy in the POST body 9578// to override the health policies used to evaluate the health. If the node that you specify by name does not exist in 9579// the health store, this returns an error. 9580// Parameters: 9581// nodeName - the name of the node. 9582// eventsHealthStateFilter - allows filtering the collection of HealthEvent objects returned based on health 9583// state. 9584// The possible values for this parameter include integer value of one of the following health states. 9585// Only events that match the filter are returned. All events are used to evaluate the aggregated health state. 9586// If not specified, all entries are returned. The state values are flag-based enumeration, so the value could 9587// be a combination of these values, obtained using the bitwise 'OR' operator. For example, If the provided 9588// value is 6 then all of the events with HealthState value of OK (2) and Warning (4) are returned. 9589// 9590// - Default - Default value. Matches any HealthState. The value is zero. 9591// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given 9592// collection of states. The value is 1. 9593// - Ok - Filter that matches input with HealthState value Ok. The value is 2. 9594// - Warning - Filter that matches input with HealthState value Warning. The value is 4. 9595// - Error - Filter that matches input with HealthState value Error. The value is 8. 9596// - All - Filter that matches input with any HealthState value. The value is 65535. 9597// clusterHealthPolicy - describes the health policies used to evaluate the health of a cluster or node. If not 9598// present, the health evaluation uses the health policy from cluster manifest or the default health policy. 9599// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 9600// duration that the client is willing to wait for the requested operation to complete. The default value for 9601// this parameter is 60 seconds. 9602func (client BaseClient) GetNodeHealthUsingPolicy(ctx context.Context, nodeName string, eventsHealthStateFilter *int32, clusterHealthPolicy *ClusterHealthPolicy, timeout *int64) (result NodeHealth, err error) { 9603 if tracing.IsEnabled() { 9604 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetNodeHealthUsingPolicy") 9605 defer func() { 9606 sc := -1 9607 if result.Response.Response != nil { 9608 sc = result.Response.Response.StatusCode 9609 } 9610 tracing.EndSpan(ctx, sc, err) 9611 }() 9612 } 9613 if err := validation.Validate([]validation.Validation{ 9614 {TargetValue: timeout, 9615 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 9616 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 9617 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 9618 }}}}}); err != nil { 9619 return result, validation.NewError("servicefabric.BaseClient", "GetNodeHealthUsingPolicy", err.Error()) 9620 } 9621 9622 req, err := client.GetNodeHealthUsingPolicyPreparer(ctx, nodeName, eventsHealthStateFilter, clusterHealthPolicy, timeout) 9623 if err != nil { 9624 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNodeHealthUsingPolicy", nil, "Failure preparing request") 9625 return 9626 } 9627 9628 resp, err := client.GetNodeHealthUsingPolicySender(req) 9629 if err != nil { 9630 result.Response = autorest.Response{Response: resp} 9631 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNodeHealthUsingPolicy", resp, "Failure sending request") 9632 return 9633 } 9634 9635 result, err = client.GetNodeHealthUsingPolicyResponder(resp) 9636 if err != nil { 9637 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNodeHealthUsingPolicy", resp, "Failure responding to request") 9638 return 9639 } 9640 9641 return 9642} 9643 9644// GetNodeHealthUsingPolicyPreparer prepares the GetNodeHealthUsingPolicy request. 9645func (client BaseClient) GetNodeHealthUsingPolicyPreparer(ctx context.Context, nodeName string, eventsHealthStateFilter *int32, clusterHealthPolicy *ClusterHealthPolicy, timeout *int64) (*http.Request, error) { 9646 pathParameters := map[string]interface{}{ 9647 "nodeName": autorest.Encode("path", nodeName), 9648 } 9649 9650 const APIVersion = "6.0" 9651 queryParameters := map[string]interface{}{ 9652 "api-version": APIVersion, 9653 } 9654 if eventsHealthStateFilter != nil { 9655 queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", *eventsHealthStateFilter) 9656 } else { 9657 queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", 0) 9658 } 9659 if timeout != nil { 9660 queryParameters["timeout"] = autorest.Encode("query", *timeout) 9661 } else { 9662 queryParameters["timeout"] = autorest.Encode("query", 60) 9663 } 9664 9665 preparer := autorest.CreatePreparer( 9666 autorest.AsContentType("application/json; charset=utf-8"), 9667 autorest.AsPost(), 9668 autorest.WithBaseURL(client.BaseURI), 9669 autorest.WithPathParameters("/Nodes/{nodeName}/$/GetHealth", pathParameters), 9670 autorest.WithQueryParameters(queryParameters)) 9671 if clusterHealthPolicy != nil { 9672 preparer = autorest.DecoratePreparer(preparer, 9673 autorest.WithJSON(clusterHealthPolicy)) 9674 } 9675 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 9676} 9677 9678// GetNodeHealthUsingPolicySender sends the GetNodeHealthUsingPolicy request. The method will close the 9679// http.Response Body if it receives an error. 9680func (client BaseClient) GetNodeHealthUsingPolicySender(req *http.Request) (*http.Response, error) { 9681 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 9682} 9683 9684// GetNodeHealthUsingPolicyResponder handles the response to the GetNodeHealthUsingPolicy request. The method always 9685// closes the http.Response Body. 9686func (client BaseClient) GetNodeHealthUsingPolicyResponder(resp *http.Response) (result NodeHealth, err error) { 9687 err = autorest.Respond( 9688 resp, 9689 azure.WithErrorUnlessStatusCode(http.StatusOK), 9690 autorest.ByUnmarshallingJSON(&result), 9691 autorest.ByClosing()) 9692 result.Response = autorest.Response{Response: resp} 9693 return 9694} 9695 9696// GetNodeInfo the response includes the name, status, ID, health, uptime, and other details about the node. 9697// Parameters: 9698// nodeName - the name of the node. 9699// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 9700// duration that the client is willing to wait for the requested operation to complete. The default value for 9701// this parameter is 60 seconds. 9702func (client BaseClient) GetNodeInfo(ctx context.Context, nodeName string, timeout *int64) (result NodeInfo, err error) { 9703 if tracing.IsEnabled() { 9704 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetNodeInfo") 9705 defer func() { 9706 sc := -1 9707 if result.Response.Response != nil { 9708 sc = result.Response.Response.StatusCode 9709 } 9710 tracing.EndSpan(ctx, sc, err) 9711 }() 9712 } 9713 if err := validation.Validate([]validation.Validation{ 9714 {TargetValue: timeout, 9715 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 9716 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 9717 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 9718 }}}}}); err != nil { 9719 return result, validation.NewError("servicefabric.BaseClient", "GetNodeInfo", err.Error()) 9720 } 9721 9722 req, err := client.GetNodeInfoPreparer(ctx, nodeName, timeout) 9723 if err != nil { 9724 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNodeInfo", nil, "Failure preparing request") 9725 return 9726 } 9727 9728 resp, err := client.GetNodeInfoSender(req) 9729 if err != nil { 9730 result.Response = autorest.Response{Response: resp} 9731 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNodeInfo", resp, "Failure sending request") 9732 return 9733 } 9734 9735 result, err = client.GetNodeInfoResponder(resp) 9736 if err != nil { 9737 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNodeInfo", resp, "Failure responding to request") 9738 return 9739 } 9740 9741 return 9742} 9743 9744// GetNodeInfoPreparer prepares the GetNodeInfo request. 9745func (client BaseClient) GetNodeInfoPreparer(ctx context.Context, nodeName string, timeout *int64) (*http.Request, error) { 9746 pathParameters := map[string]interface{}{ 9747 "nodeName": autorest.Encode("path", nodeName), 9748 } 9749 9750 const APIVersion = "6.0" 9751 queryParameters := map[string]interface{}{ 9752 "api-version": APIVersion, 9753 } 9754 if timeout != nil { 9755 queryParameters["timeout"] = autorest.Encode("query", *timeout) 9756 } else { 9757 queryParameters["timeout"] = autorest.Encode("query", 60) 9758 } 9759 9760 preparer := autorest.CreatePreparer( 9761 autorest.AsGet(), 9762 autorest.WithBaseURL(client.BaseURI), 9763 autorest.WithPathParameters("/Nodes/{nodeName}", pathParameters), 9764 autorest.WithQueryParameters(queryParameters)) 9765 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 9766} 9767 9768// GetNodeInfoSender sends the GetNodeInfo request. The method will close the 9769// http.Response Body if it receives an error. 9770func (client BaseClient) GetNodeInfoSender(req *http.Request) (*http.Response, error) { 9771 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 9772} 9773 9774// GetNodeInfoResponder handles the response to the GetNodeInfo request. The method always 9775// closes the http.Response Body. 9776func (client BaseClient) GetNodeInfoResponder(resp *http.Response) (result NodeInfo, err error) { 9777 err = autorest.Respond( 9778 resp, 9779 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), 9780 autorest.ByUnmarshallingJSON(&result), 9781 autorest.ByClosing()) 9782 result.Response = autorest.Response{Response: resp} 9783 return 9784} 9785 9786// GetNodeInfoList the response includes the name, status, ID, health, uptime, and other details about the nodes. 9787// Parameters: 9788// continuationToken - the continuation token parameter is used to obtain next set of results. A continuation 9789// token with a non-empty value is included in the response of the API when the results from the system do not 9790// fit in a single response. When this value is passed to the next API call, the API returns next set of 9791// results. If there are no further results, then the continuation token does not contain a value. The value of 9792// this parameter should not be URL encoded. 9793// nodeStatusFilter - allows filtering the nodes based on the NodeStatus. Only the nodes that are matching the 9794// specified filter value will be returned. The filter value can be one of the following. 9795// maxResults - the maximum number of results to be returned as part of the paged queries. This parameter 9796// defines the upper bound on the number of results returned. The results returned can be less than the 9797// specified maximum results if they do not fit in the message as per the max message size restrictions defined 9798// in the configuration. If this parameter is zero or not specified, the paged query includes as many results 9799// as possible that fit in the return message. 9800// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 9801// duration that the client is willing to wait for the requested operation to complete. The default value for 9802// this parameter is 60 seconds. 9803func (client BaseClient) GetNodeInfoList(ctx context.Context, continuationToken string, nodeStatusFilter NodeStatusFilter, maxResults *int64, timeout *int64) (result PagedNodeInfoList, err error) { 9804 if tracing.IsEnabled() { 9805 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetNodeInfoList") 9806 defer func() { 9807 sc := -1 9808 if result.Response.Response != nil { 9809 sc = result.Response.Response.StatusCode 9810 } 9811 tracing.EndSpan(ctx, sc, err) 9812 }() 9813 } 9814 if err := validation.Validate([]validation.Validation{ 9815 {TargetValue: maxResults, 9816 Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false, 9817 Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}}}}}, 9818 {TargetValue: timeout, 9819 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 9820 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 9821 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 9822 }}}}}); err != nil { 9823 return result, validation.NewError("servicefabric.BaseClient", "GetNodeInfoList", err.Error()) 9824 } 9825 9826 req, err := client.GetNodeInfoListPreparer(ctx, continuationToken, nodeStatusFilter, maxResults, timeout) 9827 if err != nil { 9828 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNodeInfoList", nil, "Failure preparing request") 9829 return 9830 } 9831 9832 resp, err := client.GetNodeInfoListSender(req) 9833 if err != nil { 9834 result.Response = autorest.Response{Response: resp} 9835 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNodeInfoList", resp, "Failure sending request") 9836 return 9837 } 9838 9839 result, err = client.GetNodeInfoListResponder(resp) 9840 if err != nil { 9841 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNodeInfoList", resp, "Failure responding to request") 9842 return 9843 } 9844 9845 return 9846} 9847 9848// GetNodeInfoListPreparer prepares the GetNodeInfoList request. 9849func (client BaseClient) GetNodeInfoListPreparer(ctx context.Context, continuationToken string, nodeStatusFilter NodeStatusFilter, maxResults *int64, timeout *int64) (*http.Request, error) { 9850 const APIVersion = "6.3" 9851 queryParameters := map[string]interface{}{ 9852 "api-version": APIVersion, 9853 } 9854 if len(continuationToken) > 0 { 9855 queryParameters["ContinuationToken"] = continuationToken 9856 } 9857 if len(string(nodeStatusFilter)) > 0 { 9858 queryParameters["NodeStatusFilter"] = autorest.Encode("query", nodeStatusFilter) 9859 } else { 9860 queryParameters["NodeStatusFilter"] = autorest.Encode("query", "default") 9861 } 9862 if maxResults != nil { 9863 queryParameters["MaxResults"] = autorest.Encode("query", *maxResults) 9864 } else { 9865 queryParameters["MaxResults"] = autorest.Encode("query", 0) 9866 } 9867 if timeout != nil { 9868 queryParameters["timeout"] = autorest.Encode("query", *timeout) 9869 } else { 9870 queryParameters["timeout"] = autorest.Encode("query", 60) 9871 } 9872 9873 preparer := autorest.CreatePreparer( 9874 autorest.AsGet(), 9875 autorest.WithBaseURL(client.BaseURI), 9876 autorest.WithPath("/Nodes"), 9877 autorest.WithQueryParameters(queryParameters)) 9878 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 9879} 9880 9881// GetNodeInfoListSender sends the GetNodeInfoList request. The method will close the 9882// http.Response Body if it receives an error. 9883func (client BaseClient) GetNodeInfoListSender(req *http.Request) (*http.Response, error) { 9884 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 9885} 9886 9887// GetNodeInfoListResponder handles the response to the GetNodeInfoList request. The method always 9888// closes the http.Response Body. 9889func (client BaseClient) GetNodeInfoListResponder(resp *http.Response) (result PagedNodeInfoList, err error) { 9890 err = autorest.Respond( 9891 resp, 9892 azure.WithErrorUnlessStatusCode(http.StatusOK), 9893 autorest.ByUnmarshallingJSON(&result), 9894 autorest.ByClosing()) 9895 result.Response = autorest.Response{Response: resp} 9896 return 9897} 9898 9899// GetNodeLoadInfo retrieves the load information of a Service Fabric node for all the metrics that have load or 9900// capacity defined. 9901// Parameters: 9902// nodeName - the name of the node. 9903// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 9904// duration that the client is willing to wait for the requested operation to complete. The default value for 9905// this parameter is 60 seconds. 9906func (client BaseClient) GetNodeLoadInfo(ctx context.Context, nodeName string, timeout *int64) (result NodeLoadInfo, err error) { 9907 if tracing.IsEnabled() { 9908 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetNodeLoadInfo") 9909 defer func() { 9910 sc := -1 9911 if result.Response.Response != nil { 9912 sc = result.Response.Response.StatusCode 9913 } 9914 tracing.EndSpan(ctx, sc, err) 9915 }() 9916 } 9917 if err := validation.Validate([]validation.Validation{ 9918 {TargetValue: timeout, 9919 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 9920 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 9921 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 9922 }}}}}); err != nil { 9923 return result, validation.NewError("servicefabric.BaseClient", "GetNodeLoadInfo", err.Error()) 9924 } 9925 9926 req, err := client.GetNodeLoadInfoPreparer(ctx, nodeName, timeout) 9927 if err != nil { 9928 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNodeLoadInfo", nil, "Failure preparing request") 9929 return 9930 } 9931 9932 resp, err := client.GetNodeLoadInfoSender(req) 9933 if err != nil { 9934 result.Response = autorest.Response{Response: resp} 9935 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNodeLoadInfo", resp, "Failure sending request") 9936 return 9937 } 9938 9939 result, err = client.GetNodeLoadInfoResponder(resp) 9940 if err != nil { 9941 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNodeLoadInfo", resp, "Failure responding to request") 9942 return 9943 } 9944 9945 return 9946} 9947 9948// GetNodeLoadInfoPreparer prepares the GetNodeLoadInfo request. 9949func (client BaseClient) GetNodeLoadInfoPreparer(ctx context.Context, nodeName string, timeout *int64) (*http.Request, error) { 9950 pathParameters := map[string]interface{}{ 9951 "nodeName": autorest.Encode("path", nodeName), 9952 } 9953 9954 const APIVersion = "6.0" 9955 queryParameters := map[string]interface{}{ 9956 "api-version": APIVersion, 9957 } 9958 if timeout != nil { 9959 queryParameters["timeout"] = autorest.Encode("query", *timeout) 9960 } else { 9961 queryParameters["timeout"] = autorest.Encode("query", 60) 9962 } 9963 9964 preparer := autorest.CreatePreparer( 9965 autorest.AsGet(), 9966 autorest.WithBaseURL(client.BaseURI), 9967 autorest.WithPathParameters("/Nodes/{nodeName}/$/GetLoadInformation", pathParameters), 9968 autorest.WithQueryParameters(queryParameters)) 9969 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 9970} 9971 9972// GetNodeLoadInfoSender sends the GetNodeLoadInfo request. The method will close the 9973// http.Response Body if it receives an error. 9974func (client BaseClient) GetNodeLoadInfoSender(req *http.Request) (*http.Response, error) { 9975 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 9976} 9977 9978// GetNodeLoadInfoResponder handles the response to the GetNodeLoadInfo request. The method always 9979// closes the http.Response Body. 9980func (client BaseClient) GetNodeLoadInfoResponder(resp *http.Response) (result NodeLoadInfo, err error) { 9981 err = autorest.Respond( 9982 resp, 9983 azure.WithErrorUnlessStatusCode(http.StatusOK), 9984 autorest.ByUnmarshallingJSON(&result), 9985 autorest.ByClosing()) 9986 result.Response = autorest.Response{Response: resp} 9987 return 9988} 9989 9990// GetNodesEventList the response is list of NodeEvent objects. 9991// Parameters: 9992// startTimeUtc - the start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. 9993// endTimeUtc - the end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. 9994// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 9995// duration that the client is willing to wait for the requested operation to complete. The default value for 9996// this parameter is 60 seconds. 9997// eventsTypesFilter - this is a comma separated string specifying the types of FabricEvents that should only 9998// be included in the response. 9999// excludeAnalysisEvents - this param disables the retrieval of AnalysisEvents if true is passed. 10000// skipCorrelationLookup - this param disables the search of CorrelatedEvents information if true is passed. 10001// otherwise the CorrelationEvents get processed and HasCorrelatedEvents field in every FabricEvent gets 10002// populated. 10003func (client BaseClient) GetNodesEventList(ctx context.Context, startTimeUtc string, endTimeUtc string, timeout *int64, eventsTypesFilter string, excludeAnalysisEvents *bool, skipCorrelationLookup *bool) (result ListNodeEvent, err error) { 10004 if tracing.IsEnabled() { 10005 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetNodesEventList") 10006 defer func() { 10007 sc := -1 10008 if result.Response.Response != nil { 10009 sc = result.Response.Response.StatusCode 10010 } 10011 tracing.EndSpan(ctx, sc, err) 10012 }() 10013 } 10014 if err := validation.Validate([]validation.Validation{ 10015 {TargetValue: timeout, 10016 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 10017 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 10018 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 10019 }}}}}); err != nil { 10020 return result, validation.NewError("servicefabric.BaseClient", "GetNodesEventList", err.Error()) 10021 } 10022 10023 req, err := client.GetNodesEventListPreparer(ctx, startTimeUtc, endTimeUtc, timeout, eventsTypesFilter, excludeAnalysisEvents, skipCorrelationLookup) 10024 if err != nil { 10025 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNodesEventList", nil, "Failure preparing request") 10026 return 10027 } 10028 10029 resp, err := client.GetNodesEventListSender(req) 10030 if err != nil { 10031 result.Response = autorest.Response{Response: resp} 10032 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNodesEventList", resp, "Failure sending request") 10033 return 10034 } 10035 10036 result, err = client.GetNodesEventListResponder(resp) 10037 if err != nil { 10038 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNodesEventList", resp, "Failure responding to request") 10039 return 10040 } 10041 10042 return 10043} 10044 10045// GetNodesEventListPreparer prepares the GetNodesEventList request. 10046func (client BaseClient) GetNodesEventListPreparer(ctx context.Context, startTimeUtc string, endTimeUtc string, timeout *int64, eventsTypesFilter string, excludeAnalysisEvents *bool, skipCorrelationLookup *bool) (*http.Request, error) { 10047 const APIVersion = "6.4" 10048 queryParameters := map[string]interface{}{ 10049 "api-version": APIVersion, 10050 "EndTimeUtc": autorest.Encode("query", endTimeUtc), 10051 "StartTimeUtc": autorest.Encode("query", startTimeUtc), 10052 } 10053 if timeout != nil { 10054 queryParameters["timeout"] = autorest.Encode("query", *timeout) 10055 } else { 10056 queryParameters["timeout"] = autorest.Encode("query", 60) 10057 } 10058 if len(eventsTypesFilter) > 0 { 10059 queryParameters["EventsTypesFilter"] = autorest.Encode("query", eventsTypesFilter) 10060 } 10061 if excludeAnalysisEvents != nil { 10062 queryParameters["ExcludeAnalysisEvents"] = autorest.Encode("query", *excludeAnalysisEvents) 10063 } 10064 if skipCorrelationLookup != nil { 10065 queryParameters["SkipCorrelationLookup"] = autorest.Encode("query", *skipCorrelationLookup) 10066 } 10067 10068 preparer := autorest.CreatePreparer( 10069 autorest.AsGet(), 10070 autorest.WithBaseURL(client.BaseURI), 10071 autorest.WithPath("/EventsStore/Nodes/Events"), 10072 autorest.WithQueryParameters(queryParameters)) 10073 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 10074} 10075 10076// GetNodesEventListSender sends the GetNodesEventList request. The method will close the 10077// http.Response Body if it receives an error. 10078func (client BaseClient) GetNodesEventListSender(req *http.Request) (*http.Response, error) { 10079 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 10080} 10081 10082// GetNodesEventListResponder handles the response to the GetNodesEventList request. The method always 10083// closes the http.Response Body. 10084func (client BaseClient) GetNodesEventListResponder(resp *http.Response) (result ListNodeEvent, err error) { 10085 err = autorest.Respond( 10086 resp, 10087 azure.WithErrorUnlessStatusCode(http.StatusOK), 10088 autorest.ByUnmarshallingJSON(&result), 10089 autorest.ByClosing()) 10090 result.Response = autorest.Response{Response: resp} 10091 return 10092} 10093 10094// GetNodeTransitionProgress gets the progress of an operation started with StartNodeTransition using the provided 10095// OperationId. 10096// Parameters: 10097// nodeName - the name of the node. 10098// operationID - a GUID that identifies a call of this API. This is passed into the corresponding GetProgress 10099// API 10100// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 10101// duration that the client is willing to wait for the requested operation to complete. The default value for 10102// this parameter is 60 seconds. 10103func (client BaseClient) GetNodeTransitionProgress(ctx context.Context, nodeName string, operationID uuid.UUID, timeout *int64) (result NodeTransitionProgress, err error) { 10104 if tracing.IsEnabled() { 10105 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetNodeTransitionProgress") 10106 defer func() { 10107 sc := -1 10108 if result.Response.Response != nil { 10109 sc = result.Response.Response.StatusCode 10110 } 10111 tracing.EndSpan(ctx, sc, err) 10112 }() 10113 } 10114 if err := validation.Validate([]validation.Validation{ 10115 {TargetValue: timeout, 10116 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 10117 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 10118 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 10119 }}}}}); err != nil { 10120 return result, validation.NewError("servicefabric.BaseClient", "GetNodeTransitionProgress", err.Error()) 10121 } 10122 10123 req, err := client.GetNodeTransitionProgressPreparer(ctx, nodeName, operationID, timeout) 10124 if err != nil { 10125 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNodeTransitionProgress", nil, "Failure preparing request") 10126 return 10127 } 10128 10129 resp, err := client.GetNodeTransitionProgressSender(req) 10130 if err != nil { 10131 result.Response = autorest.Response{Response: resp} 10132 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNodeTransitionProgress", resp, "Failure sending request") 10133 return 10134 } 10135 10136 result, err = client.GetNodeTransitionProgressResponder(resp) 10137 if err != nil { 10138 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetNodeTransitionProgress", resp, "Failure responding to request") 10139 return 10140 } 10141 10142 return 10143} 10144 10145// GetNodeTransitionProgressPreparer prepares the GetNodeTransitionProgress request. 10146func (client BaseClient) GetNodeTransitionProgressPreparer(ctx context.Context, nodeName string, operationID uuid.UUID, timeout *int64) (*http.Request, error) { 10147 pathParameters := map[string]interface{}{ 10148 "nodeName": autorest.Encode("path", nodeName), 10149 } 10150 10151 const APIVersion = "6.0" 10152 queryParameters := map[string]interface{}{ 10153 "api-version": APIVersion, 10154 "OperationId": autorest.Encode("query", operationID), 10155 } 10156 if timeout != nil { 10157 queryParameters["timeout"] = autorest.Encode("query", *timeout) 10158 } else { 10159 queryParameters["timeout"] = autorest.Encode("query", 60) 10160 } 10161 10162 preparer := autorest.CreatePreparer( 10163 autorest.AsGet(), 10164 autorest.WithBaseURL(client.BaseURI), 10165 autorest.WithPathParameters("/Faults/Nodes/{nodeName}/$/GetTransitionProgress", pathParameters), 10166 autorest.WithQueryParameters(queryParameters)) 10167 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 10168} 10169 10170// GetNodeTransitionProgressSender sends the GetNodeTransitionProgress request. The method will close the 10171// http.Response Body if it receives an error. 10172func (client BaseClient) GetNodeTransitionProgressSender(req *http.Request) (*http.Response, error) { 10173 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 10174} 10175 10176// GetNodeTransitionProgressResponder handles the response to the GetNodeTransitionProgress request. The method always 10177// closes the http.Response Body. 10178func (client BaseClient) GetNodeTransitionProgressResponder(resp *http.Response) (result NodeTransitionProgress, err error) { 10179 err = autorest.Respond( 10180 resp, 10181 azure.WithErrorUnlessStatusCode(http.StatusOK), 10182 autorest.ByUnmarshallingJSON(&result), 10183 autorest.ByClosing()) 10184 result.Response = autorest.Response{Response: resp} 10185 return 10186} 10187 10188// GetPartitionBackupConfigurationInfo gets the Service Fabric Backup configuration information for the specified 10189// partition. 10190// Parameters: 10191// partitionID - the identity of the partition. 10192// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 10193// duration that the client is willing to wait for the requested operation to complete. The default value for 10194// this parameter is 60 seconds. 10195func (client BaseClient) GetPartitionBackupConfigurationInfo(ctx context.Context, partitionID uuid.UUID, timeout *int64) (result PartitionBackupConfigurationInfo, err error) { 10196 if tracing.IsEnabled() { 10197 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetPartitionBackupConfigurationInfo") 10198 defer func() { 10199 sc := -1 10200 if result.Response.Response != nil { 10201 sc = result.Response.Response.StatusCode 10202 } 10203 tracing.EndSpan(ctx, sc, err) 10204 }() 10205 } 10206 if err := validation.Validate([]validation.Validation{ 10207 {TargetValue: timeout, 10208 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 10209 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 10210 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 10211 }}}}}); err != nil { 10212 return result, validation.NewError("servicefabric.BaseClient", "GetPartitionBackupConfigurationInfo", err.Error()) 10213 } 10214 10215 req, err := client.GetPartitionBackupConfigurationInfoPreparer(ctx, partitionID, timeout) 10216 if err != nil { 10217 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionBackupConfigurationInfo", nil, "Failure preparing request") 10218 return 10219 } 10220 10221 resp, err := client.GetPartitionBackupConfigurationInfoSender(req) 10222 if err != nil { 10223 result.Response = autorest.Response{Response: resp} 10224 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionBackupConfigurationInfo", resp, "Failure sending request") 10225 return 10226 } 10227 10228 result, err = client.GetPartitionBackupConfigurationInfoResponder(resp) 10229 if err != nil { 10230 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionBackupConfigurationInfo", resp, "Failure responding to request") 10231 return 10232 } 10233 10234 return 10235} 10236 10237// GetPartitionBackupConfigurationInfoPreparer prepares the GetPartitionBackupConfigurationInfo request. 10238func (client BaseClient) GetPartitionBackupConfigurationInfoPreparer(ctx context.Context, partitionID uuid.UUID, timeout *int64) (*http.Request, error) { 10239 pathParameters := map[string]interface{}{ 10240 "partitionId": partitionID, 10241 } 10242 10243 const APIVersion = "6.4" 10244 queryParameters := map[string]interface{}{ 10245 "api-version": APIVersion, 10246 } 10247 if timeout != nil { 10248 queryParameters["timeout"] = autorest.Encode("query", *timeout) 10249 } else { 10250 queryParameters["timeout"] = autorest.Encode("query", 60) 10251 } 10252 10253 preparer := autorest.CreatePreparer( 10254 autorest.AsGet(), 10255 autorest.WithBaseURL(client.BaseURI), 10256 autorest.WithPathParameters("/Partitions/{partitionId}/$/GetBackupConfigurationInfo", pathParameters), 10257 autorest.WithQueryParameters(queryParameters)) 10258 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 10259} 10260 10261// GetPartitionBackupConfigurationInfoSender sends the GetPartitionBackupConfigurationInfo request. The method will close the 10262// http.Response Body if it receives an error. 10263func (client BaseClient) GetPartitionBackupConfigurationInfoSender(req *http.Request) (*http.Response, error) { 10264 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 10265} 10266 10267// GetPartitionBackupConfigurationInfoResponder handles the response to the GetPartitionBackupConfigurationInfo request. The method always 10268// closes the http.Response Body. 10269func (client BaseClient) GetPartitionBackupConfigurationInfoResponder(resp *http.Response) (result PartitionBackupConfigurationInfo, err error) { 10270 err = autorest.Respond( 10271 resp, 10272 azure.WithErrorUnlessStatusCode(http.StatusOK), 10273 autorest.ByUnmarshallingJSON(&result), 10274 autorest.ByClosing()) 10275 result.Response = autorest.Response{Response: resp} 10276 return 10277} 10278 10279// GetPartitionBackupList returns a list of backups available for the specified partition. The server enumerates all 10280// the backups available in the backup store configured in the backup policy. It also allows filtering of the result 10281// based on start and end datetime or just fetching the latest available backup for the partition. 10282// Parameters: 10283// partitionID - the identity of the partition. 10284// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 10285// duration that the client is willing to wait for the requested operation to complete. The default value for 10286// this parameter is 60 seconds. 10287// latest - specifies whether to get only the most recent backup available for a partition for the specified 10288// time range. 10289// startDateTimeFilter - specify the start date time from which to enumerate backups, in datetime format. The 10290// date time must be specified in ISO8601 format. This is an optional parameter. If not specified, all backups 10291// from the beginning are enumerated. 10292// endDateTimeFilter - specify the end date time till which to enumerate backups, in datetime format. The date 10293// time must be specified in ISO8601 format. This is an optional parameter. If not specified, enumeration is 10294// done till the most recent backup. 10295func (client BaseClient) GetPartitionBackupList(ctx context.Context, partitionID uuid.UUID, timeout *int64, latest *bool, startDateTimeFilter *date.Time, endDateTimeFilter *date.Time) (result PagedBackupInfoList, err error) { 10296 if tracing.IsEnabled() { 10297 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetPartitionBackupList") 10298 defer func() { 10299 sc := -1 10300 if result.Response.Response != nil { 10301 sc = result.Response.Response.StatusCode 10302 } 10303 tracing.EndSpan(ctx, sc, err) 10304 }() 10305 } 10306 if err := validation.Validate([]validation.Validation{ 10307 {TargetValue: timeout, 10308 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 10309 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 10310 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 10311 }}}}}); err != nil { 10312 return result, validation.NewError("servicefabric.BaseClient", "GetPartitionBackupList", err.Error()) 10313 } 10314 10315 req, err := client.GetPartitionBackupListPreparer(ctx, partitionID, timeout, latest, startDateTimeFilter, endDateTimeFilter) 10316 if err != nil { 10317 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionBackupList", nil, "Failure preparing request") 10318 return 10319 } 10320 10321 resp, err := client.GetPartitionBackupListSender(req) 10322 if err != nil { 10323 result.Response = autorest.Response{Response: resp} 10324 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionBackupList", resp, "Failure sending request") 10325 return 10326 } 10327 10328 result, err = client.GetPartitionBackupListResponder(resp) 10329 if err != nil { 10330 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionBackupList", resp, "Failure responding to request") 10331 return 10332 } 10333 10334 return 10335} 10336 10337// GetPartitionBackupListPreparer prepares the GetPartitionBackupList request. 10338func (client BaseClient) GetPartitionBackupListPreparer(ctx context.Context, partitionID uuid.UUID, timeout *int64, latest *bool, startDateTimeFilter *date.Time, endDateTimeFilter *date.Time) (*http.Request, error) { 10339 pathParameters := map[string]interface{}{ 10340 "partitionId": partitionID, 10341 } 10342 10343 const APIVersion = "6.4" 10344 queryParameters := map[string]interface{}{ 10345 "api-version": APIVersion, 10346 } 10347 if timeout != nil { 10348 queryParameters["timeout"] = autorest.Encode("query", *timeout) 10349 } else { 10350 queryParameters["timeout"] = autorest.Encode("query", 60) 10351 } 10352 if latest != nil { 10353 queryParameters["Latest"] = autorest.Encode("query", *latest) 10354 } else { 10355 queryParameters["Latest"] = autorest.Encode("query", false) 10356 } 10357 if startDateTimeFilter != nil { 10358 queryParameters["StartDateTimeFilter"] = autorest.Encode("query", *startDateTimeFilter) 10359 } 10360 if endDateTimeFilter != nil { 10361 queryParameters["EndDateTimeFilter"] = autorest.Encode("query", *endDateTimeFilter) 10362 } 10363 10364 preparer := autorest.CreatePreparer( 10365 autorest.AsGet(), 10366 autorest.WithBaseURL(client.BaseURI), 10367 autorest.WithPathParameters("/Partitions/{partitionId}/$/GetBackups", pathParameters), 10368 autorest.WithQueryParameters(queryParameters)) 10369 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 10370} 10371 10372// GetPartitionBackupListSender sends the GetPartitionBackupList request. The method will close the 10373// http.Response Body if it receives an error. 10374func (client BaseClient) GetPartitionBackupListSender(req *http.Request) (*http.Response, error) { 10375 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 10376} 10377 10378// GetPartitionBackupListResponder handles the response to the GetPartitionBackupList request. The method always 10379// closes the http.Response Body. 10380func (client BaseClient) GetPartitionBackupListResponder(resp *http.Response) (result PagedBackupInfoList, err error) { 10381 err = autorest.Respond( 10382 resp, 10383 azure.WithErrorUnlessStatusCode(http.StatusOK), 10384 autorest.ByUnmarshallingJSON(&result), 10385 autorest.ByClosing()) 10386 result.Response = autorest.Response{Response: resp} 10387 return 10388} 10389 10390// GetPartitionBackupProgress returns information about the state of the latest backup along with details or failure 10391// reason in case of completion. 10392// Parameters: 10393// partitionID - the identity of the partition. 10394// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 10395// duration that the client is willing to wait for the requested operation to complete. The default value for 10396// this parameter is 60 seconds. 10397func (client BaseClient) GetPartitionBackupProgress(ctx context.Context, partitionID uuid.UUID, timeout *int64) (result BackupProgressInfo, err error) { 10398 if tracing.IsEnabled() { 10399 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetPartitionBackupProgress") 10400 defer func() { 10401 sc := -1 10402 if result.Response.Response != nil { 10403 sc = result.Response.Response.StatusCode 10404 } 10405 tracing.EndSpan(ctx, sc, err) 10406 }() 10407 } 10408 if err := validation.Validate([]validation.Validation{ 10409 {TargetValue: timeout, 10410 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 10411 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 10412 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 10413 }}}}}); err != nil { 10414 return result, validation.NewError("servicefabric.BaseClient", "GetPartitionBackupProgress", err.Error()) 10415 } 10416 10417 req, err := client.GetPartitionBackupProgressPreparer(ctx, partitionID, timeout) 10418 if err != nil { 10419 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionBackupProgress", nil, "Failure preparing request") 10420 return 10421 } 10422 10423 resp, err := client.GetPartitionBackupProgressSender(req) 10424 if err != nil { 10425 result.Response = autorest.Response{Response: resp} 10426 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionBackupProgress", resp, "Failure sending request") 10427 return 10428 } 10429 10430 result, err = client.GetPartitionBackupProgressResponder(resp) 10431 if err != nil { 10432 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionBackupProgress", resp, "Failure responding to request") 10433 return 10434 } 10435 10436 return 10437} 10438 10439// GetPartitionBackupProgressPreparer prepares the GetPartitionBackupProgress request. 10440func (client BaseClient) GetPartitionBackupProgressPreparer(ctx context.Context, partitionID uuid.UUID, timeout *int64) (*http.Request, error) { 10441 pathParameters := map[string]interface{}{ 10442 "partitionId": partitionID, 10443 } 10444 10445 const APIVersion = "6.4" 10446 queryParameters := map[string]interface{}{ 10447 "api-version": APIVersion, 10448 } 10449 if timeout != nil { 10450 queryParameters["timeout"] = autorest.Encode("query", *timeout) 10451 } else { 10452 queryParameters["timeout"] = autorest.Encode("query", 60) 10453 } 10454 10455 preparer := autorest.CreatePreparer( 10456 autorest.AsGet(), 10457 autorest.WithBaseURL(client.BaseURI), 10458 autorest.WithPathParameters("/Partitions/{partitionId}/$/GetBackupProgress", pathParameters), 10459 autorest.WithQueryParameters(queryParameters)) 10460 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 10461} 10462 10463// GetPartitionBackupProgressSender sends the GetPartitionBackupProgress request. The method will close the 10464// http.Response Body if it receives an error. 10465func (client BaseClient) GetPartitionBackupProgressSender(req *http.Request) (*http.Response, error) { 10466 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 10467} 10468 10469// GetPartitionBackupProgressResponder handles the response to the GetPartitionBackupProgress request. The method always 10470// closes the http.Response Body. 10471func (client BaseClient) GetPartitionBackupProgressResponder(resp *http.Response) (result BackupProgressInfo, err error) { 10472 err = autorest.Respond( 10473 resp, 10474 azure.WithErrorUnlessStatusCode(http.StatusOK), 10475 autorest.ByUnmarshallingJSON(&result), 10476 autorest.ByClosing()) 10477 result.Response = autorest.Response{Response: resp} 10478 return 10479} 10480 10481// GetPartitionEventList the response is list of PartitionEvent objects. 10482// Parameters: 10483// partitionID - the identity of the partition. 10484// startTimeUtc - the start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. 10485// endTimeUtc - the end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. 10486// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 10487// duration that the client is willing to wait for the requested operation to complete. The default value for 10488// this parameter is 60 seconds. 10489// eventsTypesFilter - this is a comma separated string specifying the types of FabricEvents that should only 10490// be included in the response. 10491// excludeAnalysisEvents - this param disables the retrieval of AnalysisEvents if true is passed. 10492// skipCorrelationLookup - this param disables the search of CorrelatedEvents information if true is passed. 10493// otherwise the CorrelationEvents get processed and HasCorrelatedEvents field in every FabricEvent gets 10494// populated. 10495func (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) { 10496 if tracing.IsEnabled() { 10497 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetPartitionEventList") 10498 defer func() { 10499 sc := -1 10500 if result.Response.Response != nil { 10501 sc = result.Response.Response.StatusCode 10502 } 10503 tracing.EndSpan(ctx, sc, err) 10504 }() 10505 } 10506 if err := validation.Validate([]validation.Validation{ 10507 {TargetValue: timeout, 10508 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 10509 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 10510 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 10511 }}}}}); err != nil { 10512 return result, validation.NewError("servicefabric.BaseClient", "GetPartitionEventList", err.Error()) 10513 } 10514 10515 req, err := client.GetPartitionEventListPreparer(ctx, partitionID, startTimeUtc, endTimeUtc, timeout, eventsTypesFilter, excludeAnalysisEvents, skipCorrelationLookup) 10516 if err != nil { 10517 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionEventList", nil, "Failure preparing request") 10518 return 10519 } 10520 10521 resp, err := client.GetPartitionEventListSender(req) 10522 if err != nil { 10523 result.Response = autorest.Response{Response: resp} 10524 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionEventList", resp, "Failure sending request") 10525 return 10526 } 10527 10528 result, err = client.GetPartitionEventListResponder(resp) 10529 if err != nil { 10530 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionEventList", resp, "Failure responding to request") 10531 return 10532 } 10533 10534 return 10535} 10536 10537// GetPartitionEventListPreparer prepares the GetPartitionEventList request. 10538func (client BaseClient) GetPartitionEventListPreparer(ctx context.Context, partitionID uuid.UUID, startTimeUtc string, endTimeUtc string, timeout *int64, eventsTypesFilter string, excludeAnalysisEvents *bool, skipCorrelationLookup *bool) (*http.Request, error) { 10539 pathParameters := map[string]interface{}{ 10540 "partitionId": partitionID, 10541 } 10542 10543 const APIVersion = "6.4" 10544 queryParameters := map[string]interface{}{ 10545 "api-version": APIVersion, 10546 "EndTimeUtc": autorest.Encode("query", endTimeUtc), 10547 "StartTimeUtc": autorest.Encode("query", startTimeUtc), 10548 } 10549 if timeout != nil { 10550 queryParameters["timeout"] = autorest.Encode("query", *timeout) 10551 } else { 10552 queryParameters["timeout"] = autorest.Encode("query", 60) 10553 } 10554 if len(eventsTypesFilter) > 0 { 10555 queryParameters["EventsTypesFilter"] = autorest.Encode("query", eventsTypesFilter) 10556 } 10557 if excludeAnalysisEvents != nil { 10558 queryParameters["ExcludeAnalysisEvents"] = autorest.Encode("query", *excludeAnalysisEvents) 10559 } 10560 if skipCorrelationLookup != nil { 10561 queryParameters["SkipCorrelationLookup"] = autorest.Encode("query", *skipCorrelationLookup) 10562 } 10563 10564 preparer := autorest.CreatePreparer( 10565 autorest.AsGet(), 10566 autorest.WithBaseURL(client.BaseURI), 10567 autorest.WithPathParameters("/EventsStore/Partitions/{partitionId}/$/Events", pathParameters), 10568 autorest.WithQueryParameters(queryParameters)) 10569 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 10570} 10571 10572// GetPartitionEventListSender sends the GetPartitionEventList request. The method will close the 10573// http.Response Body if it receives an error. 10574func (client BaseClient) GetPartitionEventListSender(req *http.Request) (*http.Response, error) { 10575 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 10576} 10577 10578// GetPartitionEventListResponder handles the response to the GetPartitionEventList request. The method always 10579// closes the http.Response Body. 10580func (client BaseClient) GetPartitionEventListResponder(resp *http.Response) (result ListPartitionEvent, err error) { 10581 err = autorest.Respond( 10582 resp, 10583 azure.WithErrorUnlessStatusCode(http.StatusOK), 10584 autorest.ByUnmarshallingJSON(&result), 10585 autorest.ByClosing()) 10586 result.Response = autorest.Response{Response: resp} 10587 return 10588} 10589 10590// GetPartitionHealth use EventsHealthStateFilter to filter the collection of health events reported on the service 10591// based on the health state. 10592// Use ReplicasHealthStateFilter to filter the collection of ReplicaHealthState objects on the partition. 10593// If you specify a partition that does not exist in the health store, this request returns an error. 10594// Parameters: 10595// partitionID - the identity of the partition. 10596// eventsHealthStateFilter - allows filtering the collection of HealthEvent objects returned based on health 10597// state. 10598// The possible values for this parameter include integer value of one of the following health states. 10599// Only events that match the filter are returned. All events are used to evaluate the aggregated health state. 10600// If not specified, all entries are returned. The state values are flag-based enumeration, so the value could 10601// be a combination of these values, obtained using the bitwise 'OR' operator. For example, If the provided 10602// value is 6 then all of the events with HealthState value of OK (2) and Warning (4) are returned. 10603// 10604// - Default - Default value. Matches any HealthState. The value is zero. 10605// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given 10606// collection of states. The value is 1. 10607// - Ok - Filter that matches input with HealthState value Ok. The value is 2. 10608// - Warning - Filter that matches input with HealthState value Warning. The value is 4. 10609// - Error - Filter that matches input with HealthState value Error. The value is 8. 10610// - All - Filter that matches input with any HealthState value. The value is 65535. 10611// replicasHealthStateFilter - allows filtering the collection of ReplicaHealthState objects on the partition. 10612// The value can be obtained from members or bitwise operations on members of HealthStateFilter. Only replicas 10613// that match the filter will be returned. All replicas will be used to evaluate the aggregated health state. 10614// If not specified, all entries will be returned.The state values are flag-based enumeration, so the value 10615// could be a combination of these values obtained using bitwise 'OR' operator. For example, If the provided 10616// value is 6 then all of the events with HealthState value of OK (2) and Warning (4) will be returned. The 10617// possible values for this parameter include integer value of one of the following health states. 10618// 10619// - Default - Default value. Matches any HealthState. The value is zero. 10620// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given 10621// collection of states. The value is 1. 10622// - Ok - Filter that matches input with HealthState value Ok. The value is 2. 10623// - Warning - Filter that matches input with HealthState value Warning. The value is 4. 10624// - Error - Filter that matches input with HealthState value Error. The value is 8. 10625// - All - Filter that matches input with any HealthState value. The value is 65535. 10626// excludeHealthStatistics - indicates whether the health statistics should be returned as part of the query 10627// result. False by default. 10628// The statistics show the number of children entities in health state Ok, Warning, and Error. 10629// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 10630// duration that the client is willing to wait for the requested operation to complete. The default value for 10631// this parameter is 60 seconds. 10632func (client BaseClient) GetPartitionHealth(ctx context.Context, partitionID uuid.UUID, eventsHealthStateFilter *int32, replicasHealthStateFilter *int32, excludeHealthStatistics *bool, timeout *int64) (result PartitionHealth, err error) { 10633 if tracing.IsEnabled() { 10634 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetPartitionHealth") 10635 defer func() { 10636 sc := -1 10637 if result.Response.Response != nil { 10638 sc = result.Response.Response.StatusCode 10639 } 10640 tracing.EndSpan(ctx, sc, err) 10641 }() 10642 } 10643 if err := validation.Validate([]validation.Validation{ 10644 {TargetValue: timeout, 10645 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 10646 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 10647 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 10648 }}}}}); err != nil { 10649 return result, validation.NewError("servicefabric.BaseClient", "GetPartitionHealth", err.Error()) 10650 } 10651 10652 req, err := client.GetPartitionHealthPreparer(ctx, partitionID, eventsHealthStateFilter, replicasHealthStateFilter, excludeHealthStatistics, timeout) 10653 if err != nil { 10654 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionHealth", nil, "Failure preparing request") 10655 return 10656 } 10657 10658 resp, err := client.GetPartitionHealthSender(req) 10659 if err != nil { 10660 result.Response = autorest.Response{Response: resp} 10661 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionHealth", resp, "Failure sending request") 10662 return 10663 } 10664 10665 result, err = client.GetPartitionHealthResponder(resp) 10666 if err != nil { 10667 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionHealth", resp, "Failure responding to request") 10668 return 10669 } 10670 10671 return 10672} 10673 10674// GetPartitionHealthPreparer prepares the GetPartitionHealth request. 10675func (client BaseClient) GetPartitionHealthPreparer(ctx context.Context, partitionID uuid.UUID, eventsHealthStateFilter *int32, replicasHealthStateFilter *int32, excludeHealthStatistics *bool, timeout *int64) (*http.Request, error) { 10676 pathParameters := map[string]interface{}{ 10677 "partitionId": partitionID, 10678 } 10679 10680 const APIVersion = "6.0" 10681 queryParameters := map[string]interface{}{ 10682 "api-version": APIVersion, 10683 } 10684 if eventsHealthStateFilter != nil { 10685 queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", *eventsHealthStateFilter) 10686 } else { 10687 queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", 0) 10688 } 10689 if replicasHealthStateFilter != nil { 10690 queryParameters["ReplicasHealthStateFilter"] = autorest.Encode("query", *replicasHealthStateFilter) 10691 } else { 10692 queryParameters["ReplicasHealthStateFilter"] = autorest.Encode("query", 0) 10693 } 10694 if excludeHealthStatistics != nil { 10695 queryParameters["ExcludeHealthStatistics"] = autorest.Encode("query", *excludeHealthStatistics) 10696 } else { 10697 queryParameters["ExcludeHealthStatistics"] = autorest.Encode("query", false) 10698 } 10699 if timeout != nil { 10700 queryParameters["timeout"] = autorest.Encode("query", *timeout) 10701 } else { 10702 queryParameters["timeout"] = autorest.Encode("query", 60) 10703 } 10704 10705 preparer := autorest.CreatePreparer( 10706 autorest.AsGet(), 10707 autorest.WithBaseURL(client.BaseURI), 10708 autorest.WithPathParameters("/Partitions/{partitionId}/$/GetHealth", pathParameters), 10709 autorest.WithQueryParameters(queryParameters)) 10710 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 10711} 10712 10713// GetPartitionHealthSender sends the GetPartitionHealth request. The method will close the 10714// http.Response Body if it receives an error. 10715func (client BaseClient) GetPartitionHealthSender(req *http.Request) (*http.Response, error) { 10716 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 10717} 10718 10719// GetPartitionHealthResponder handles the response to the GetPartitionHealth request. The method always 10720// closes the http.Response Body. 10721func (client BaseClient) GetPartitionHealthResponder(resp *http.Response) (result PartitionHealth, err error) { 10722 err = autorest.Respond( 10723 resp, 10724 azure.WithErrorUnlessStatusCode(http.StatusOK), 10725 autorest.ByUnmarshallingJSON(&result), 10726 autorest.ByClosing()) 10727 result.Response = autorest.Response{Response: resp} 10728 return 10729} 10730 10731// GetPartitionHealthUsingPolicy gets the health information of the specified partition. 10732// If the application health policy is specified, the health evaluation uses it to get the aggregated health state. 10733// If the policy is not specified, the health evaluation uses the application health policy defined in the application 10734// manifest, or the default health policy, if no policy is defined in the manifest. 10735// Use EventsHealthStateFilter to filter the collection of health events reported on the partition based on the health 10736// state. 10737// Use ReplicasHealthStateFilter to filter the collection of ReplicaHealthState objects on the partition. Use 10738// ApplicationHealthPolicy in the POST body to override the health policies used to evaluate the health. 10739// If you specify a partition that does not exist in the health store, this request returns an error. 10740// Parameters: 10741// partitionID - the identity of the partition. 10742// eventsHealthStateFilter - allows filtering the collection of HealthEvent objects returned based on health 10743// state. 10744// The possible values for this parameter include integer value of one of the following health states. 10745// Only events that match the filter are returned. All events are used to evaluate the aggregated health state. 10746// If not specified, all entries are returned. The state values are flag-based enumeration, so the value could 10747// be a combination of these values, obtained using the bitwise 'OR' operator. For example, If the provided 10748// value is 6 then all of the events with HealthState value of OK (2) and Warning (4) are returned. 10749// 10750// - Default - Default value. Matches any HealthState. The value is zero. 10751// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given 10752// collection of states. The value is 1. 10753// - Ok - Filter that matches input with HealthState value Ok. The value is 2. 10754// - Warning - Filter that matches input with HealthState value Warning. The value is 4. 10755// - Error - Filter that matches input with HealthState value Error. The value is 8. 10756// - All - Filter that matches input with any HealthState value. The value is 65535. 10757// replicasHealthStateFilter - allows filtering the collection of ReplicaHealthState objects on the partition. 10758// The value can be obtained from members or bitwise operations on members of HealthStateFilter. Only replicas 10759// that match the filter will be returned. All replicas will be used to evaluate the aggregated health state. 10760// If not specified, all entries will be returned.The state values are flag-based enumeration, so the value 10761// could be a combination of these values obtained using bitwise 'OR' operator. For example, If the provided 10762// value is 6 then all of the events with HealthState value of OK (2) and Warning (4) will be returned. The 10763// possible values for this parameter include integer value of one of the following health states. 10764// 10765// - Default - Default value. Matches any HealthState. The value is zero. 10766// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given 10767// collection of states. The value is 1. 10768// - Ok - Filter that matches input with HealthState value Ok. The value is 2. 10769// - Warning - Filter that matches input with HealthState value Warning. The value is 4. 10770// - Error - Filter that matches input with HealthState value Error. The value is 8. 10771// - All - Filter that matches input with any HealthState value. The value is 65535. 10772// applicationHealthPolicy - describes the health policies used to evaluate the health of an application or one 10773// of its children. 10774// If not present, the health evaluation uses the health policy from application manifest or the default health 10775// policy. 10776// excludeHealthStatistics - indicates whether the health statistics should be returned as part of the query 10777// result. False by default. 10778// The statistics show the number of children entities in health state Ok, Warning, and Error. 10779// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 10780// duration that the client is willing to wait for the requested operation to complete. The default value for 10781// this parameter is 60 seconds. 10782func (client BaseClient) GetPartitionHealthUsingPolicy(ctx context.Context, partitionID uuid.UUID, eventsHealthStateFilter *int32, replicasHealthStateFilter *int32, applicationHealthPolicy *ApplicationHealthPolicy, excludeHealthStatistics *bool, timeout *int64) (result PartitionHealth, err error) { 10783 if tracing.IsEnabled() { 10784 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetPartitionHealthUsingPolicy") 10785 defer func() { 10786 sc := -1 10787 if result.Response.Response != nil { 10788 sc = result.Response.Response.StatusCode 10789 } 10790 tracing.EndSpan(ctx, sc, err) 10791 }() 10792 } 10793 if err := validation.Validate([]validation.Validation{ 10794 {TargetValue: timeout, 10795 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 10796 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 10797 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 10798 }}}}}); err != nil { 10799 return result, validation.NewError("servicefabric.BaseClient", "GetPartitionHealthUsingPolicy", err.Error()) 10800 } 10801 10802 req, err := client.GetPartitionHealthUsingPolicyPreparer(ctx, partitionID, eventsHealthStateFilter, replicasHealthStateFilter, applicationHealthPolicy, excludeHealthStatistics, timeout) 10803 if err != nil { 10804 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionHealthUsingPolicy", nil, "Failure preparing request") 10805 return 10806 } 10807 10808 resp, err := client.GetPartitionHealthUsingPolicySender(req) 10809 if err != nil { 10810 result.Response = autorest.Response{Response: resp} 10811 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionHealthUsingPolicy", resp, "Failure sending request") 10812 return 10813 } 10814 10815 result, err = client.GetPartitionHealthUsingPolicyResponder(resp) 10816 if err != nil { 10817 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionHealthUsingPolicy", resp, "Failure responding to request") 10818 return 10819 } 10820 10821 return 10822} 10823 10824// GetPartitionHealthUsingPolicyPreparer prepares the GetPartitionHealthUsingPolicy request. 10825func (client BaseClient) GetPartitionHealthUsingPolicyPreparer(ctx context.Context, partitionID uuid.UUID, eventsHealthStateFilter *int32, replicasHealthStateFilter *int32, applicationHealthPolicy *ApplicationHealthPolicy, excludeHealthStatistics *bool, timeout *int64) (*http.Request, error) { 10826 pathParameters := map[string]interface{}{ 10827 "partitionId": partitionID, 10828 } 10829 10830 const APIVersion = "6.0" 10831 queryParameters := map[string]interface{}{ 10832 "api-version": APIVersion, 10833 } 10834 if eventsHealthStateFilter != nil { 10835 queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", *eventsHealthStateFilter) 10836 } else { 10837 queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", 0) 10838 } 10839 if replicasHealthStateFilter != nil { 10840 queryParameters["ReplicasHealthStateFilter"] = autorest.Encode("query", *replicasHealthStateFilter) 10841 } else { 10842 queryParameters["ReplicasHealthStateFilter"] = autorest.Encode("query", 0) 10843 } 10844 if excludeHealthStatistics != nil { 10845 queryParameters["ExcludeHealthStatistics"] = autorest.Encode("query", *excludeHealthStatistics) 10846 } else { 10847 queryParameters["ExcludeHealthStatistics"] = autorest.Encode("query", false) 10848 } 10849 if timeout != nil { 10850 queryParameters["timeout"] = autorest.Encode("query", *timeout) 10851 } else { 10852 queryParameters["timeout"] = autorest.Encode("query", 60) 10853 } 10854 10855 preparer := autorest.CreatePreparer( 10856 autorest.AsContentType("application/json; charset=utf-8"), 10857 autorest.AsPost(), 10858 autorest.WithBaseURL(client.BaseURI), 10859 autorest.WithPathParameters("/Partitions/{partitionId}/$/GetHealth", pathParameters), 10860 autorest.WithQueryParameters(queryParameters)) 10861 if applicationHealthPolicy != nil { 10862 preparer = autorest.DecoratePreparer(preparer, 10863 autorest.WithJSON(applicationHealthPolicy)) 10864 } 10865 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 10866} 10867 10868// GetPartitionHealthUsingPolicySender sends the GetPartitionHealthUsingPolicy request. The method will close the 10869// http.Response Body if it receives an error. 10870func (client BaseClient) GetPartitionHealthUsingPolicySender(req *http.Request) (*http.Response, error) { 10871 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 10872} 10873 10874// GetPartitionHealthUsingPolicyResponder handles the response to the GetPartitionHealthUsingPolicy request. The method always 10875// closes the http.Response Body. 10876func (client BaseClient) GetPartitionHealthUsingPolicyResponder(resp *http.Response) (result PartitionHealth, err error) { 10877 err = autorest.Respond( 10878 resp, 10879 azure.WithErrorUnlessStatusCode(http.StatusOK), 10880 autorest.ByUnmarshallingJSON(&result), 10881 autorest.ByClosing()) 10882 result.Response = autorest.Response{Response: resp} 10883 return 10884} 10885 10886// GetPartitionInfo gets the information about the specified partition. The response includes the partition ID, 10887// partitioning scheme information, keys supported by the partition, status, health, and other details about the 10888// partition. 10889// Parameters: 10890// partitionID - the identity of the partition. 10891// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 10892// duration that the client is willing to wait for the requested operation to complete. The default value for 10893// this parameter is 60 seconds. 10894func (client BaseClient) GetPartitionInfo(ctx context.Context, partitionID uuid.UUID, timeout *int64) (result ServicePartitionInfoModel, err error) { 10895 if tracing.IsEnabled() { 10896 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetPartitionInfo") 10897 defer func() { 10898 sc := -1 10899 if result.Response.Response != nil { 10900 sc = result.Response.Response.StatusCode 10901 } 10902 tracing.EndSpan(ctx, sc, err) 10903 }() 10904 } 10905 if err := validation.Validate([]validation.Validation{ 10906 {TargetValue: timeout, 10907 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 10908 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 10909 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 10910 }}}}}); err != nil { 10911 return result, validation.NewError("servicefabric.BaseClient", "GetPartitionInfo", err.Error()) 10912 } 10913 10914 req, err := client.GetPartitionInfoPreparer(ctx, partitionID, timeout) 10915 if err != nil { 10916 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionInfo", nil, "Failure preparing request") 10917 return 10918 } 10919 10920 resp, err := client.GetPartitionInfoSender(req) 10921 if err != nil { 10922 result.Response = autorest.Response{Response: resp} 10923 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionInfo", resp, "Failure sending request") 10924 return 10925 } 10926 10927 result, err = client.GetPartitionInfoResponder(resp) 10928 if err != nil { 10929 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionInfo", resp, "Failure responding to request") 10930 return 10931 } 10932 10933 return 10934} 10935 10936// GetPartitionInfoPreparer prepares the GetPartitionInfo request. 10937func (client BaseClient) GetPartitionInfoPreparer(ctx context.Context, partitionID uuid.UUID, timeout *int64) (*http.Request, error) { 10938 pathParameters := map[string]interface{}{ 10939 "partitionId": partitionID, 10940 } 10941 10942 const APIVersion = "6.0" 10943 queryParameters := map[string]interface{}{ 10944 "api-version": APIVersion, 10945 } 10946 if timeout != nil { 10947 queryParameters["timeout"] = autorest.Encode("query", *timeout) 10948 } else { 10949 queryParameters["timeout"] = autorest.Encode("query", 60) 10950 } 10951 10952 preparer := autorest.CreatePreparer( 10953 autorest.AsGet(), 10954 autorest.WithBaseURL(client.BaseURI), 10955 autorest.WithPathParameters("/Partitions/{partitionId}", pathParameters), 10956 autorest.WithQueryParameters(queryParameters)) 10957 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 10958} 10959 10960// GetPartitionInfoSender sends the GetPartitionInfo request. The method will close the 10961// http.Response Body if it receives an error. 10962func (client BaseClient) GetPartitionInfoSender(req *http.Request) (*http.Response, error) { 10963 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 10964} 10965 10966// GetPartitionInfoResponder handles the response to the GetPartitionInfo request. The method always 10967// closes the http.Response Body. 10968func (client BaseClient) GetPartitionInfoResponder(resp *http.Response) (result ServicePartitionInfoModel, err error) { 10969 err = autorest.Respond( 10970 resp, 10971 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), 10972 autorest.ByUnmarshallingJSON(&result), 10973 autorest.ByClosing()) 10974 result.Response = autorest.Response{Response: resp} 10975 return 10976} 10977 10978// GetPartitionInfoList the response includes the partition ID, partitioning scheme information, keys supported by the 10979// partition, status, health, and other details about the partition. 10980// Parameters: 10981// serviceID - the identity of the service. This ID is typically the full name of the service without the 10982// 'fabric:' URI scheme. 10983// Starting from version 6.0, hierarchical names are delimited with the "~" character. 10984// For example, if the service name is "fabric:/myapp/app1/svc1", the service identity would be 10985// "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in previous versions. 10986// continuationToken - the continuation token parameter is used to obtain next set of results. A continuation 10987// token with a non-empty value is included in the response of the API when the results from the system do not 10988// fit in a single response. When this value is passed to the next API call, the API returns next set of 10989// results. If there are no further results, then the continuation token does not contain a value. The value of 10990// this parameter should not be URL encoded. 10991// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 10992// duration that the client is willing to wait for the requested operation to complete. The default value for 10993// this parameter is 60 seconds. 10994func (client BaseClient) GetPartitionInfoList(ctx context.Context, serviceID string, continuationToken string, timeout *int64) (result PagedServicePartitionInfoList, err error) { 10995 if tracing.IsEnabled() { 10996 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetPartitionInfoList") 10997 defer func() { 10998 sc := -1 10999 if result.Response.Response != nil { 11000 sc = result.Response.Response.StatusCode 11001 } 11002 tracing.EndSpan(ctx, sc, err) 11003 }() 11004 } 11005 if err := validation.Validate([]validation.Validation{ 11006 {TargetValue: timeout, 11007 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 11008 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 11009 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 11010 }}}}}); err != nil { 11011 return result, validation.NewError("servicefabric.BaseClient", "GetPartitionInfoList", err.Error()) 11012 } 11013 11014 req, err := client.GetPartitionInfoListPreparer(ctx, serviceID, continuationToken, timeout) 11015 if err != nil { 11016 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionInfoList", nil, "Failure preparing request") 11017 return 11018 } 11019 11020 resp, err := client.GetPartitionInfoListSender(req) 11021 if err != nil { 11022 result.Response = autorest.Response{Response: resp} 11023 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionInfoList", resp, "Failure sending request") 11024 return 11025 } 11026 11027 result, err = client.GetPartitionInfoListResponder(resp) 11028 if err != nil { 11029 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionInfoList", resp, "Failure responding to request") 11030 return 11031 } 11032 11033 return 11034} 11035 11036// GetPartitionInfoListPreparer prepares the GetPartitionInfoList request. 11037func (client BaseClient) GetPartitionInfoListPreparer(ctx context.Context, serviceID string, continuationToken string, timeout *int64) (*http.Request, error) { 11038 pathParameters := map[string]interface{}{ 11039 "serviceId": serviceID, 11040 } 11041 11042 const APIVersion = "6.4" 11043 queryParameters := map[string]interface{}{ 11044 "api-version": APIVersion, 11045 } 11046 if len(continuationToken) > 0 { 11047 queryParameters["ContinuationToken"] = continuationToken 11048 } 11049 if timeout != nil { 11050 queryParameters["timeout"] = autorest.Encode("query", *timeout) 11051 } else { 11052 queryParameters["timeout"] = autorest.Encode("query", 60) 11053 } 11054 11055 preparer := autorest.CreatePreparer( 11056 autorest.AsGet(), 11057 autorest.WithBaseURL(client.BaseURI), 11058 autorest.WithPathParameters("/Services/{serviceId}/$/GetPartitions", pathParameters), 11059 autorest.WithQueryParameters(queryParameters)) 11060 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 11061} 11062 11063// GetPartitionInfoListSender sends the GetPartitionInfoList request. The method will close the 11064// http.Response Body if it receives an error. 11065func (client BaseClient) GetPartitionInfoListSender(req *http.Request) (*http.Response, error) { 11066 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 11067} 11068 11069// GetPartitionInfoListResponder handles the response to the GetPartitionInfoList request. The method always 11070// closes the http.Response Body. 11071func (client BaseClient) GetPartitionInfoListResponder(resp *http.Response) (result PagedServicePartitionInfoList, err error) { 11072 err = autorest.Respond( 11073 resp, 11074 azure.WithErrorUnlessStatusCode(http.StatusOK), 11075 autorest.ByUnmarshallingJSON(&result), 11076 autorest.ByClosing()) 11077 result.Response = autorest.Response{Response: resp} 11078 return 11079} 11080 11081// GetPartitionLoadInformation returns information about the load of a specified partition. 11082// The response includes a list of load reports for a Service Fabric partition. 11083// Each report includes the load metric name, value, and last reported time in UTC. 11084// Parameters: 11085// partitionID - the identity of the partition. 11086// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 11087// duration that the client is willing to wait for the requested operation to complete. The default value for 11088// this parameter is 60 seconds. 11089func (client BaseClient) GetPartitionLoadInformation(ctx context.Context, partitionID uuid.UUID, timeout *int64) (result PartitionLoadInformation, err error) { 11090 if tracing.IsEnabled() { 11091 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetPartitionLoadInformation") 11092 defer func() { 11093 sc := -1 11094 if result.Response.Response != nil { 11095 sc = result.Response.Response.StatusCode 11096 } 11097 tracing.EndSpan(ctx, sc, err) 11098 }() 11099 } 11100 if err := validation.Validate([]validation.Validation{ 11101 {TargetValue: timeout, 11102 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 11103 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 11104 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 11105 }}}}}); err != nil { 11106 return result, validation.NewError("servicefabric.BaseClient", "GetPartitionLoadInformation", err.Error()) 11107 } 11108 11109 req, err := client.GetPartitionLoadInformationPreparer(ctx, partitionID, timeout) 11110 if err != nil { 11111 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionLoadInformation", nil, "Failure preparing request") 11112 return 11113 } 11114 11115 resp, err := client.GetPartitionLoadInformationSender(req) 11116 if err != nil { 11117 result.Response = autorest.Response{Response: resp} 11118 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionLoadInformation", resp, "Failure sending request") 11119 return 11120 } 11121 11122 result, err = client.GetPartitionLoadInformationResponder(resp) 11123 if err != nil { 11124 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionLoadInformation", resp, "Failure responding to request") 11125 return 11126 } 11127 11128 return 11129} 11130 11131// GetPartitionLoadInformationPreparer prepares the GetPartitionLoadInformation request. 11132func (client BaseClient) GetPartitionLoadInformationPreparer(ctx context.Context, partitionID uuid.UUID, timeout *int64) (*http.Request, error) { 11133 pathParameters := map[string]interface{}{ 11134 "partitionId": partitionID, 11135 } 11136 11137 const APIVersion = "6.0" 11138 queryParameters := map[string]interface{}{ 11139 "api-version": APIVersion, 11140 } 11141 if timeout != nil { 11142 queryParameters["timeout"] = autorest.Encode("query", *timeout) 11143 } else { 11144 queryParameters["timeout"] = autorest.Encode("query", 60) 11145 } 11146 11147 preparer := autorest.CreatePreparer( 11148 autorest.AsGet(), 11149 autorest.WithBaseURL(client.BaseURI), 11150 autorest.WithPathParameters("/Partitions/{partitionId}/$/GetLoadInformation", pathParameters), 11151 autorest.WithQueryParameters(queryParameters)) 11152 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 11153} 11154 11155// GetPartitionLoadInformationSender sends the GetPartitionLoadInformation request. The method will close the 11156// http.Response Body if it receives an error. 11157func (client BaseClient) GetPartitionLoadInformationSender(req *http.Request) (*http.Response, error) { 11158 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 11159} 11160 11161// GetPartitionLoadInformationResponder handles the response to the GetPartitionLoadInformation request. The method always 11162// closes the http.Response Body. 11163func (client BaseClient) GetPartitionLoadInformationResponder(resp *http.Response) (result PartitionLoadInformation, err error) { 11164 err = autorest.Respond( 11165 resp, 11166 azure.WithErrorUnlessStatusCode(http.StatusOK), 11167 autorest.ByUnmarshallingJSON(&result), 11168 autorest.ByClosing()) 11169 result.Response = autorest.Response{Response: resp} 11170 return 11171} 11172 11173// GetPartitionReplicaEventList the response is list of ReplicaEvent objects. 11174// Parameters: 11175// partitionID - the identity of the partition. 11176// replicaID - the identifier of the replica. 11177// startTimeUtc - the start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. 11178// endTimeUtc - the end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. 11179// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 11180// duration that the client is willing to wait for the requested operation to complete. The default value for 11181// this parameter is 60 seconds. 11182// eventsTypesFilter - this is a comma separated string specifying the types of FabricEvents that should only 11183// be included in the response. 11184// excludeAnalysisEvents - this param disables the retrieval of AnalysisEvents if true is passed. 11185// skipCorrelationLookup - this param disables the search of CorrelatedEvents information if true is passed. 11186// otherwise the CorrelationEvents get processed and HasCorrelatedEvents field in every FabricEvent gets 11187// populated. 11188func (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) { 11189 if tracing.IsEnabled() { 11190 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetPartitionReplicaEventList") 11191 defer func() { 11192 sc := -1 11193 if result.Response.Response != nil { 11194 sc = result.Response.Response.StatusCode 11195 } 11196 tracing.EndSpan(ctx, sc, err) 11197 }() 11198 } 11199 if err := validation.Validate([]validation.Validation{ 11200 {TargetValue: timeout, 11201 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 11202 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 11203 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 11204 }}}}}); err != nil { 11205 return result, validation.NewError("servicefabric.BaseClient", "GetPartitionReplicaEventList", err.Error()) 11206 } 11207 11208 req, err := client.GetPartitionReplicaEventListPreparer(ctx, partitionID, replicaID, startTimeUtc, endTimeUtc, timeout, eventsTypesFilter, excludeAnalysisEvents, skipCorrelationLookup) 11209 if err != nil { 11210 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionReplicaEventList", nil, "Failure preparing request") 11211 return 11212 } 11213 11214 resp, err := client.GetPartitionReplicaEventListSender(req) 11215 if err != nil { 11216 result.Response = autorest.Response{Response: resp} 11217 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionReplicaEventList", resp, "Failure sending request") 11218 return 11219 } 11220 11221 result, err = client.GetPartitionReplicaEventListResponder(resp) 11222 if err != nil { 11223 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionReplicaEventList", resp, "Failure responding to request") 11224 return 11225 } 11226 11227 return 11228} 11229 11230// GetPartitionReplicaEventListPreparer prepares the GetPartitionReplicaEventList request. 11231func (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) { 11232 pathParameters := map[string]interface{}{ 11233 "partitionId": partitionID, 11234 "replicaId": replicaID, 11235 } 11236 11237 const APIVersion = "6.4" 11238 queryParameters := map[string]interface{}{ 11239 "api-version": APIVersion, 11240 "EndTimeUtc": autorest.Encode("query", endTimeUtc), 11241 "StartTimeUtc": autorest.Encode("query", startTimeUtc), 11242 } 11243 if timeout != nil { 11244 queryParameters["timeout"] = autorest.Encode("query", *timeout) 11245 } else { 11246 queryParameters["timeout"] = autorest.Encode("query", 60) 11247 } 11248 if len(eventsTypesFilter) > 0 { 11249 queryParameters["EventsTypesFilter"] = autorest.Encode("query", eventsTypesFilter) 11250 } 11251 if excludeAnalysisEvents != nil { 11252 queryParameters["ExcludeAnalysisEvents"] = autorest.Encode("query", *excludeAnalysisEvents) 11253 } 11254 if skipCorrelationLookup != nil { 11255 queryParameters["SkipCorrelationLookup"] = autorest.Encode("query", *skipCorrelationLookup) 11256 } 11257 11258 preparer := autorest.CreatePreparer( 11259 autorest.AsGet(), 11260 autorest.WithBaseURL(client.BaseURI), 11261 autorest.WithPathParameters("/EventsStore/Partitions/{partitionId}/$/Replicas/{replicaId}/$/Events", pathParameters), 11262 autorest.WithQueryParameters(queryParameters)) 11263 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 11264} 11265 11266// GetPartitionReplicaEventListSender sends the GetPartitionReplicaEventList request. The method will close the 11267// http.Response Body if it receives an error. 11268func (client BaseClient) GetPartitionReplicaEventListSender(req *http.Request) (*http.Response, error) { 11269 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 11270} 11271 11272// GetPartitionReplicaEventListResponder handles the response to the GetPartitionReplicaEventList request. The method always 11273// closes the http.Response Body. 11274func (client BaseClient) GetPartitionReplicaEventListResponder(resp *http.Response) (result ListReplicaEvent, err error) { 11275 err = autorest.Respond( 11276 resp, 11277 azure.WithErrorUnlessStatusCode(http.StatusOK), 11278 autorest.ByUnmarshallingJSON(&result), 11279 autorest.ByClosing()) 11280 result.Response = autorest.Response{Response: resp} 11281 return 11282} 11283 11284// GetPartitionReplicasEventList the response is list of ReplicaEvent objects. 11285// Parameters: 11286// partitionID - the identity of the partition. 11287// startTimeUtc - the start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. 11288// endTimeUtc - the end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. 11289// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 11290// duration that the client is willing to wait for the requested operation to complete. The default value for 11291// this parameter is 60 seconds. 11292// eventsTypesFilter - this is a comma separated string specifying the types of FabricEvents that should only 11293// be included in the response. 11294// excludeAnalysisEvents - this param disables the retrieval of AnalysisEvents if true is passed. 11295// skipCorrelationLookup - this param disables the search of CorrelatedEvents information if true is passed. 11296// otherwise the CorrelationEvents get processed and HasCorrelatedEvents field in every FabricEvent gets 11297// populated. 11298func (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) { 11299 if tracing.IsEnabled() { 11300 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetPartitionReplicasEventList") 11301 defer func() { 11302 sc := -1 11303 if result.Response.Response != nil { 11304 sc = result.Response.Response.StatusCode 11305 } 11306 tracing.EndSpan(ctx, sc, err) 11307 }() 11308 } 11309 if err := validation.Validate([]validation.Validation{ 11310 {TargetValue: timeout, 11311 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 11312 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 11313 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 11314 }}}}}); err != nil { 11315 return result, validation.NewError("servicefabric.BaseClient", "GetPartitionReplicasEventList", err.Error()) 11316 } 11317 11318 req, err := client.GetPartitionReplicasEventListPreparer(ctx, partitionID, startTimeUtc, endTimeUtc, timeout, eventsTypesFilter, excludeAnalysisEvents, skipCorrelationLookup) 11319 if err != nil { 11320 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionReplicasEventList", nil, "Failure preparing request") 11321 return 11322 } 11323 11324 resp, err := client.GetPartitionReplicasEventListSender(req) 11325 if err != nil { 11326 result.Response = autorest.Response{Response: resp} 11327 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionReplicasEventList", resp, "Failure sending request") 11328 return 11329 } 11330 11331 result, err = client.GetPartitionReplicasEventListResponder(resp) 11332 if err != nil { 11333 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionReplicasEventList", resp, "Failure responding to request") 11334 return 11335 } 11336 11337 return 11338} 11339 11340// GetPartitionReplicasEventListPreparer prepares the GetPartitionReplicasEventList request. 11341func (client BaseClient) GetPartitionReplicasEventListPreparer(ctx context.Context, partitionID uuid.UUID, startTimeUtc string, endTimeUtc string, timeout *int64, eventsTypesFilter string, excludeAnalysisEvents *bool, skipCorrelationLookup *bool) (*http.Request, error) { 11342 pathParameters := map[string]interface{}{ 11343 "partitionId": partitionID, 11344 } 11345 11346 const APIVersion = "6.4" 11347 queryParameters := map[string]interface{}{ 11348 "api-version": APIVersion, 11349 "EndTimeUtc": autorest.Encode("query", endTimeUtc), 11350 "StartTimeUtc": autorest.Encode("query", startTimeUtc), 11351 } 11352 if timeout != nil { 11353 queryParameters["timeout"] = autorest.Encode("query", *timeout) 11354 } else { 11355 queryParameters["timeout"] = autorest.Encode("query", 60) 11356 } 11357 if len(eventsTypesFilter) > 0 { 11358 queryParameters["EventsTypesFilter"] = autorest.Encode("query", eventsTypesFilter) 11359 } 11360 if excludeAnalysisEvents != nil { 11361 queryParameters["ExcludeAnalysisEvents"] = autorest.Encode("query", *excludeAnalysisEvents) 11362 } 11363 if skipCorrelationLookup != nil { 11364 queryParameters["SkipCorrelationLookup"] = autorest.Encode("query", *skipCorrelationLookup) 11365 } 11366 11367 preparer := autorest.CreatePreparer( 11368 autorest.AsGet(), 11369 autorest.WithBaseURL(client.BaseURI), 11370 autorest.WithPathParameters("/EventsStore/Partitions/{partitionId}/$/Replicas/Events", pathParameters), 11371 autorest.WithQueryParameters(queryParameters)) 11372 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 11373} 11374 11375// GetPartitionReplicasEventListSender sends the GetPartitionReplicasEventList request. The method will close the 11376// http.Response Body if it receives an error. 11377func (client BaseClient) GetPartitionReplicasEventListSender(req *http.Request) (*http.Response, error) { 11378 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 11379} 11380 11381// GetPartitionReplicasEventListResponder handles the response to the GetPartitionReplicasEventList request. The method always 11382// closes the http.Response Body. 11383func (client BaseClient) GetPartitionReplicasEventListResponder(resp *http.Response) (result ListReplicaEvent, err error) { 11384 err = autorest.Respond( 11385 resp, 11386 azure.WithErrorUnlessStatusCode(http.StatusOK), 11387 autorest.ByUnmarshallingJSON(&result), 11388 autorest.ByClosing()) 11389 result.Response = autorest.Response{Response: resp} 11390 return 11391} 11392 11393// GetPartitionRestartProgress gets the progress of a PartitionRestart started with StartPartitionRestart using the 11394// provided OperationId. 11395// Parameters: 11396// serviceID - the identity of the service. This ID is typically the full name of the service without the 11397// 'fabric:' URI scheme. 11398// Starting from version 6.0, hierarchical names are delimited with the "~" character. 11399// For example, if the service name is "fabric:/myapp/app1/svc1", the service identity would be 11400// "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in previous versions. 11401// partitionID - the identity of the partition. 11402// operationID - a GUID that identifies a call of this API. This is passed into the corresponding GetProgress 11403// API 11404// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 11405// duration that the client is willing to wait for the requested operation to complete. The default value for 11406// this parameter is 60 seconds. 11407func (client BaseClient) GetPartitionRestartProgress(ctx context.Context, serviceID string, partitionID uuid.UUID, operationID uuid.UUID, timeout *int64) (result PartitionRestartProgress, err error) { 11408 if tracing.IsEnabled() { 11409 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetPartitionRestartProgress") 11410 defer func() { 11411 sc := -1 11412 if result.Response.Response != nil { 11413 sc = result.Response.Response.StatusCode 11414 } 11415 tracing.EndSpan(ctx, sc, err) 11416 }() 11417 } 11418 if err := validation.Validate([]validation.Validation{ 11419 {TargetValue: timeout, 11420 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 11421 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 11422 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 11423 }}}}}); err != nil { 11424 return result, validation.NewError("servicefabric.BaseClient", "GetPartitionRestartProgress", err.Error()) 11425 } 11426 11427 req, err := client.GetPartitionRestartProgressPreparer(ctx, serviceID, partitionID, operationID, timeout) 11428 if err != nil { 11429 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionRestartProgress", nil, "Failure preparing request") 11430 return 11431 } 11432 11433 resp, err := client.GetPartitionRestartProgressSender(req) 11434 if err != nil { 11435 result.Response = autorest.Response{Response: resp} 11436 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionRestartProgress", resp, "Failure sending request") 11437 return 11438 } 11439 11440 result, err = client.GetPartitionRestartProgressResponder(resp) 11441 if err != nil { 11442 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionRestartProgress", resp, "Failure responding to request") 11443 return 11444 } 11445 11446 return 11447} 11448 11449// GetPartitionRestartProgressPreparer prepares the GetPartitionRestartProgress request. 11450func (client BaseClient) GetPartitionRestartProgressPreparer(ctx context.Context, serviceID string, partitionID uuid.UUID, operationID uuid.UUID, timeout *int64) (*http.Request, error) { 11451 pathParameters := map[string]interface{}{ 11452 "partitionId": partitionID, 11453 "serviceId": serviceID, 11454 } 11455 11456 const APIVersion = "6.0" 11457 queryParameters := map[string]interface{}{ 11458 "api-version": APIVersion, 11459 "OperationId": autorest.Encode("query", operationID), 11460 } 11461 if timeout != nil { 11462 queryParameters["timeout"] = autorest.Encode("query", *timeout) 11463 } else { 11464 queryParameters["timeout"] = autorest.Encode("query", 60) 11465 } 11466 11467 preparer := autorest.CreatePreparer( 11468 autorest.AsGet(), 11469 autorest.WithBaseURL(client.BaseURI), 11470 autorest.WithPathParameters("/Faults/Services/{serviceId}/$/GetPartitions/{partitionId}/$/GetRestartProgress", pathParameters), 11471 autorest.WithQueryParameters(queryParameters)) 11472 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 11473} 11474 11475// GetPartitionRestartProgressSender sends the GetPartitionRestartProgress request. The method will close the 11476// http.Response Body if it receives an error. 11477func (client BaseClient) GetPartitionRestartProgressSender(req *http.Request) (*http.Response, error) { 11478 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 11479} 11480 11481// GetPartitionRestartProgressResponder handles the response to the GetPartitionRestartProgress request. The method always 11482// closes the http.Response Body. 11483func (client BaseClient) GetPartitionRestartProgressResponder(resp *http.Response) (result PartitionRestartProgress, err error) { 11484 err = autorest.Respond( 11485 resp, 11486 azure.WithErrorUnlessStatusCode(http.StatusOK), 11487 autorest.ByUnmarshallingJSON(&result), 11488 autorest.ByClosing()) 11489 result.Response = autorest.Response{Response: resp} 11490 return 11491} 11492 11493// GetPartitionRestoreProgress returns information about the state of the latest restore operation along with details 11494// or failure reason in case of completion. 11495// Parameters: 11496// partitionID - the identity of the partition. 11497// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 11498// duration that the client is willing to wait for the requested operation to complete. The default value for 11499// this parameter is 60 seconds. 11500func (client BaseClient) GetPartitionRestoreProgress(ctx context.Context, partitionID uuid.UUID, timeout *int64) (result RestoreProgressInfo, err error) { 11501 if tracing.IsEnabled() { 11502 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetPartitionRestoreProgress") 11503 defer func() { 11504 sc := -1 11505 if result.Response.Response != nil { 11506 sc = result.Response.Response.StatusCode 11507 } 11508 tracing.EndSpan(ctx, sc, err) 11509 }() 11510 } 11511 if err := validation.Validate([]validation.Validation{ 11512 {TargetValue: timeout, 11513 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 11514 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 11515 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 11516 }}}}}); err != nil { 11517 return result, validation.NewError("servicefabric.BaseClient", "GetPartitionRestoreProgress", err.Error()) 11518 } 11519 11520 req, err := client.GetPartitionRestoreProgressPreparer(ctx, partitionID, timeout) 11521 if err != nil { 11522 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionRestoreProgress", nil, "Failure preparing request") 11523 return 11524 } 11525 11526 resp, err := client.GetPartitionRestoreProgressSender(req) 11527 if err != nil { 11528 result.Response = autorest.Response{Response: resp} 11529 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionRestoreProgress", resp, "Failure sending request") 11530 return 11531 } 11532 11533 result, err = client.GetPartitionRestoreProgressResponder(resp) 11534 if err != nil { 11535 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionRestoreProgress", resp, "Failure responding to request") 11536 return 11537 } 11538 11539 return 11540} 11541 11542// GetPartitionRestoreProgressPreparer prepares the GetPartitionRestoreProgress request. 11543func (client BaseClient) GetPartitionRestoreProgressPreparer(ctx context.Context, partitionID uuid.UUID, timeout *int64) (*http.Request, error) { 11544 pathParameters := map[string]interface{}{ 11545 "partitionId": partitionID, 11546 } 11547 11548 const APIVersion = "6.4" 11549 queryParameters := map[string]interface{}{ 11550 "api-version": APIVersion, 11551 } 11552 if timeout != nil { 11553 queryParameters["timeout"] = autorest.Encode("query", *timeout) 11554 } else { 11555 queryParameters["timeout"] = autorest.Encode("query", 60) 11556 } 11557 11558 preparer := autorest.CreatePreparer( 11559 autorest.AsGet(), 11560 autorest.WithBaseURL(client.BaseURI), 11561 autorest.WithPathParameters("/Partitions/{partitionId}/$/GetRestoreProgress", pathParameters), 11562 autorest.WithQueryParameters(queryParameters)) 11563 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 11564} 11565 11566// GetPartitionRestoreProgressSender sends the GetPartitionRestoreProgress request. The method will close the 11567// http.Response Body if it receives an error. 11568func (client BaseClient) GetPartitionRestoreProgressSender(req *http.Request) (*http.Response, error) { 11569 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 11570} 11571 11572// GetPartitionRestoreProgressResponder handles the response to the GetPartitionRestoreProgress request. The method always 11573// closes the http.Response Body. 11574func (client BaseClient) GetPartitionRestoreProgressResponder(resp *http.Response) (result RestoreProgressInfo, err error) { 11575 err = autorest.Respond( 11576 resp, 11577 azure.WithErrorUnlessStatusCode(http.StatusOK), 11578 autorest.ByUnmarshallingJSON(&result), 11579 autorest.ByClosing()) 11580 result.Response = autorest.Response{Response: resp} 11581 return 11582} 11583 11584// GetPartitionsEventList the response is list of PartitionEvent objects. 11585// Parameters: 11586// startTimeUtc - the start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. 11587// endTimeUtc - the end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. 11588// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 11589// duration that the client is willing to wait for the requested operation to complete. The default value for 11590// this parameter is 60 seconds. 11591// eventsTypesFilter - this is a comma separated string specifying the types of FabricEvents that should only 11592// be included in the response. 11593// excludeAnalysisEvents - this param disables the retrieval of AnalysisEvents if true is passed. 11594// skipCorrelationLookup - this param disables the search of CorrelatedEvents information if true is passed. 11595// otherwise the CorrelationEvents get processed and HasCorrelatedEvents field in every FabricEvent gets 11596// populated. 11597func (client BaseClient) GetPartitionsEventList(ctx context.Context, startTimeUtc string, endTimeUtc string, timeout *int64, eventsTypesFilter string, excludeAnalysisEvents *bool, skipCorrelationLookup *bool) (result ListPartitionEvent, err error) { 11598 if tracing.IsEnabled() { 11599 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetPartitionsEventList") 11600 defer func() { 11601 sc := -1 11602 if result.Response.Response != nil { 11603 sc = result.Response.Response.StatusCode 11604 } 11605 tracing.EndSpan(ctx, sc, err) 11606 }() 11607 } 11608 if err := validation.Validate([]validation.Validation{ 11609 {TargetValue: timeout, 11610 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 11611 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 11612 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 11613 }}}}}); err != nil { 11614 return result, validation.NewError("servicefabric.BaseClient", "GetPartitionsEventList", err.Error()) 11615 } 11616 11617 req, err := client.GetPartitionsEventListPreparer(ctx, startTimeUtc, endTimeUtc, timeout, eventsTypesFilter, excludeAnalysisEvents, skipCorrelationLookup) 11618 if err != nil { 11619 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionsEventList", nil, "Failure preparing request") 11620 return 11621 } 11622 11623 resp, err := client.GetPartitionsEventListSender(req) 11624 if err != nil { 11625 result.Response = autorest.Response{Response: resp} 11626 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionsEventList", resp, "Failure sending request") 11627 return 11628 } 11629 11630 result, err = client.GetPartitionsEventListResponder(resp) 11631 if err != nil { 11632 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPartitionsEventList", resp, "Failure responding to request") 11633 return 11634 } 11635 11636 return 11637} 11638 11639// GetPartitionsEventListPreparer prepares the GetPartitionsEventList request. 11640func (client BaseClient) GetPartitionsEventListPreparer(ctx context.Context, startTimeUtc string, endTimeUtc string, timeout *int64, eventsTypesFilter string, excludeAnalysisEvents *bool, skipCorrelationLookup *bool) (*http.Request, error) { 11641 const APIVersion = "6.4" 11642 queryParameters := map[string]interface{}{ 11643 "api-version": APIVersion, 11644 "EndTimeUtc": autorest.Encode("query", endTimeUtc), 11645 "StartTimeUtc": autorest.Encode("query", startTimeUtc), 11646 } 11647 if timeout != nil { 11648 queryParameters["timeout"] = autorest.Encode("query", *timeout) 11649 } else { 11650 queryParameters["timeout"] = autorest.Encode("query", 60) 11651 } 11652 if len(eventsTypesFilter) > 0 { 11653 queryParameters["EventsTypesFilter"] = autorest.Encode("query", eventsTypesFilter) 11654 } 11655 if excludeAnalysisEvents != nil { 11656 queryParameters["ExcludeAnalysisEvents"] = autorest.Encode("query", *excludeAnalysisEvents) 11657 } 11658 if skipCorrelationLookup != nil { 11659 queryParameters["SkipCorrelationLookup"] = autorest.Encode("query", *skipCorrelationLookup) 11660 } 11661 11662 preparer := autorest.CreatePreparer( 11663 autorest.AsGet(), 11664 autorest.WithBaseURL(client.BaseURI), 11665 autorest.WithPath("/EventsStore/Partitions/Events"), 11666 autorest.WithQueryParameters(queryParameters)) 11667 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 11668} 11669 11670// GetPartitionsEventListSender sends the GetPartitionsEventList request. The method will close the 11671// http.Response Body if it receives an error. 11672func (client BaseClient) GetPartitionsEventListSender(req *http.Request) (*http.Response, error) { 11673 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 11674} 11675 11676// GetPartitionsEventListResponder handles the response to the GetPartitionsEventList request. The method always 11677// closes the http.Response Body. 11678func (client BaseClient) GetPartitionsEventListResponder(resp *http.Response) (result ListPartitionEvent, err error) { 11679 err = autorest.Respond( 11680 resp, 11681 azure.WithErrorUnlessStatusCode(http.StatusOK), 11682 autorest.ByUnmarshallingJSON(&result), 11683 autorest.ByClosing()) 11684 result.Response = autorest.Response{Response: resp} 11685 return 11686} 11687 11688// GetPropertyInfo gets the specified Service Fabric property under a given name. This will always return both value 11689// and metadata. 11690// Parameters: 11691// nameID - the Service Fabric name, without the 'fabric:' URI scheme. 11692// propertyName - specifies the name of the property to get. 11693// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 11694// duration that the client is willing to wait for the requested operation to complete. The default value for 11695// this parameter is 60 seconds. 11696func (client BaseClient) GetPropertyInfo(ctx context.Context, nameID string, propertyName string, timeout *int64) (result PropertyInfo, err error) { 11697 if tracing.IsEnabled() { 11698 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetPropertyInfo") 11699 defer func() { 11700 sc := -1 11701 if result.Response.Response != nil { 11702 sc = result.Response.Response.StatusCode 11703 } 11704 tracing.EndSpan(ctx, sc, err) 11705 }() 11706 } 11707 if err := validation.Validate([]validation.Validation{ 11708 {TargetValue: timeout, 11709 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 11710 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 11711 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 11712 }}}}}); err != nil { 11713 return result, validation.NewError("servicefabric.BaseClient", "GetPropertyInfo", err.Error()) 11714 } 11715 11716 req, err := client.GetPropertyInfoPreparer(ctx, nameID, propertyName, timeout) 11717 if err != nil { 11718 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPropertyInfo", nil, "Failure preparing request") 11719 return 11720 } 11721 11722 resp, err := client.GetPropertyInfoSender(req) 11723 if err != nil { 11724 result.Response = autorest.Response{Response: resp} 11725 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPropertyInfo", resp, "Failure sending request") 11726 return 11727 } 11728 11729 result, err = client.GetPropertyInfoResponder(resp) 11730 if err != nil { 11731 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPropertyInfo", resp, "Failure responding to request") 11732 return 11733 } 11734 11735 return 11736} 11737 11738// GetPropertyInfoPreparer prepares the GetPropertyInfo request. 11739func (client BaseClient) GetPropertyInfoPreparer(ctx context.Context, nameID string, propertyName string, timeout *int64) (*http.Request, error) { 11740 pathParameters := map[string]interface{}{ 11741 "nameId": nameID, 11742 } 11743 11744 const APIVersion = "6.0" 11745 queryParameters := map[string]interface{}{ 11746 "api-version": APIVersion, 11747 "PropertyName": autorest.Encode("query", propertyName), 11748 } 11749 if timeout != nil { 11750 queryParameters["timeout"] = autorest.Encode("query", *timeout) 11751 } else { 11752 queryParameters["timeout"] = autorest.Encode("query", 60) 11753 } 11754 11755 preparer := autorest.CreatePreparer( 11756 autorest.AsGet(), 11757 autorest.WithBaseURL(client.BaseURI), 11758 autorest.WithPathParameters("/Names/{nameId}/$/GetProperty", pathParameters), 11759 autorest.WithQueryParameters(queryParameters)) 11760 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 11761} 11762 11763// GetPropertyInfoSender sends the GetPropertyInfo request. The method will close the 11764// http.Response Body if it receives an error. 11765func (client BaseClient) GetPropertyInfoSender(req *http.Request) (*http.Response, error) { 11766 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 11767} 11768 11769// GetPropertyInfoResponder handles the response to the GetPropertyInfo request. The method always 11770// closes the http.Response Body. 11771func (client BaseClient) GetPropertyInfoResponder(resp *http.Response) (result PropertyInfo, err error) { 11772 err = autorest.Respond( 11773 resp, 11774 azure.WithErrorUnlessStatusCode(http.StatusOK), 11775 autorest.ByUnmarshallingJSON(&result), 11776 autorest.ByClosing()) 11777 result.Response = autorest.Response{Response: resp} 11778 return 11779} 11780 11781// GetPropertyInfoList a Service Fabric name can have one or more named properties that store custom information. This 11782// operation gets the information about these properties in a paged list. The information includes name, value, and 11783// metadata about each of the properties. 11784// Parameters: 11785// nameID - the Service Fabric name, without the 'fabric:' URI scheme. 11786// includeValues - allows specifying whether to include the values of the properties returned. True if values 11787// should be returned with the metadata; False to return only property metadata. 11788// continuationToken - the continuation token parameter is used to obtain next set of results. A continuation 11789// token with a non-empty value is included in the response of the API when the results from the system do not 11790// fit in a single response. When this value is passed to the next API call, the API returns next set of 11791// results. If there are no further results, then the continuation token does not contain a value. The value of 11792// this parameter should not be URL encoded. 11793// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 11794// duration that the client is willing to wait for the requested operation to complete. The default value for 11795// this parameter is 60 seconds. 11796func (client BaseClient) GetPropertyInfoList(ctx context.Context, nameID string, includeValues *bool, continuationToken string, timeout *int64) (result PagedPropertyInfoList, err error) { 11797 if tracing.IsEnabled() { 11798 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetPropertyInfoList") 11799 defer func() { 11800 sc := -1 11801 if result.Response.Response != nil { 11802 sc = result.Response.Response.StatusCode 11803 } 11804 tracing.EndSpan(ctx, sc, err) 11805 }() 11806 } 11807 if err := validation.Validate([]validation.Validation{ 11808 {TargetValue: timeout, 11809 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 11810 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 11811 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 11812 }}}}}); err != nil { 11813 return result, validation.NewError("servicefabric.BaseClient", "GetPropertyInfoList", err.Error()) 11814 } 11815 11816 req, err := client.GetPropertyInfoListPreparer(ctx, nameID, includeValues, continuationToken, timeout) 11817 if err != nil { 11818 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPropertyInfoList", nil, "Failure preparing request") 11819 return 11820 } 11821 11822 resp, err := client.GetPropertyInfoListSender(req) 11823 if err != nil { 11824 result.Response = autorest.Response{Response: resp} 11825 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPropertyInfoList", resp, "Failure sending request") 11826 return 11827 } 11828 11829 result, err = client.GetPropertyInfoListResponder(resp) 11830 if err != nil { 11831 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetPropertyInfoList", resp, "Failure responding to request") 11832 return 11833 } 11834 11835 return 11836} 11837 11838// GetPropertyInfoListPreparer prepares the GetPropertyInfoList request. 11839func (client BaseClient) GetPropertyInfoListPreparer(ctx context.Context, nameID string, includeValues *bool, continuationToken string, timeout *int64) (*http.Request, error) { 11840 pathParameters := map[string]interface{}{ 11841 "nameId": nameID, 11842 } 11843 11844 const APIVersion = "6.0" 11845 queryParameters := map[string]interface{}{ 11846 "api-version": APIVersion, 11847 } 11848 if includeValues != nil { 11849 queryParameters["IncludeValues"] = autorest.Encode("query", *includeValues) 11850 } else { 11851 queryParameters["IncludeValues"] = autorest.Encode("query", false) 11852 } 11853 if len(continuationToken) > 0 { 11854 queryParameters["ContinuationToken"] = continuationToken 11855 } 11856 if timeout != nil { 11857 queryParameters["timeout"] = autorest.Encode("query", *timeout) 11858 } else { 11859 queryParameters["timeout"] = autorest.Encode("query", 60) 11860 } 11861 11862 preparer := autorest.CreatePreparer( 11863 autorest.AsGet(), 11864 autorest.WithBaseURL(client.BaseURI), 11865 autorest.WithPathParameters("/Names/{nameId}/$/GetProperties", pathParameters), 11866 autorest.WithQueryParameters(queryParameters)) 11867 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 11868} 11869 11870// GetPropertyInfoListSender sends the GetPropertyInfoList request. The method will close the 11871// http.Response Body if it receives an error. 11872func (client BaseClient) GetPropertyInfoListSender(req *http.Request) (*http.Response, error) { 11873 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 11874} 11875 11876// GetPropertyInfoListResponder handles the response to the GetPropertyInfoList request. The method always 11877// closes the http.Response Body. 11878func (client BaseClient) GetPropertyInfoListResponder(resp *http.Response) (result PagedPropertyInfoList, err error) { 11879 err = autorest.Respond( 11880 resp, 11881 azure.WithErrorUnlessStatusCode(http.StatusOK), 11882 autorest.ByUnmarshallingJSON(&result), 11883 autorest.ByClosing()) 11884 result.Response = autorest.Response{Response: resp} 11885 return 11886} 11887 11888// GetProvisionedFabricCodeVersionInfoList gets a list of information about fabric code versions that are provisioned 11889// in the cluster. The parameter CodeVersion can be used to optionally filter the output to only that particular 11890// version. 11891// Parameters: 11892// codeVersion - the product version of Service Fabric. 11893// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 11894// duration that the client is willing to wait for the requested operation to complete. The default value for 11895// this parameter is 60 seconds. 11896func (client BaseClient) GetProvisionedFabricCodeVersionInfoList(ctx context.Context, codeVersion string, timeout *int64) (result ListFabricCodeVersionInfo, err error) { 11897 if tracing.IsEnabled() { 11898 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetProvisionedFabricCodeVersionInfoList") 11899 defer func() { 11900 sc := -1 11901 if result.Response.Response != nil { 11902 sc = result.Response.Response.StatusCode 11903 } 11904 tracing.EndSpan(ctx, sc, err) 11905 }() 11906 } 11907 if err := validation.Validate([]validation.Validation{ 11908 {TargetValue: timeout, 11909 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 11910 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 11911 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 11912 }}}}}); err != nil { 11913 return result, validation.NewError("servicefabric.BaseClient", "GetProvisionedFabricCodeVersionInfoList", err.Error()) 11914 } 11915 11916 req, err := client.GetProvisionedFabricCodeVersionInfoListPreparer(ctx, codeVersion, timeout) 11917 if err != nil { 11918 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetProvisionedFabricCodeVersionInfoList", nil, "Failure preparing request") 11919 return 11920 } 11921 11922 resp, err := client.GetProvisionedFabricCodeVersionInfoListSender(req) 11923 if err != nil { 11924 result.Response = autorest.Response{Response: resp} 11925 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetProvisionedFabricCodeVersionInfoList", resp, "Failure sending request") 11926 return 11927 } 11928 11929 result, err = client.GetProvisionedFabricCodeVersionInfoListResponder(resp) 11930 if err != nil { 11931 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetProvisionedFabricCodeVersionInfoList", resp, "Failure responding to request") 11932 return 11933 } 11934 11935 return 11936} 11937 11938// GetProvisionedFabricCodeVersionInfoListPreparer prepares the GetProvisionedFabricCodeVersionInfoList request. 11939func (client BaseClient) GetProvisionedFabricCodeVersionInfoListPreparer(ctx context.Context, codeVersion string, timeout *int64) (*http.Request, error) { 11940 const APIVersion = "6.0" 11941 queryParameters := map[string]interface{}{ 11942 "api-version": APIVersion, 11943 } 11944 if len(codeVersion) > 0 { 11945 queryParameters["CodeVersion"] = autorest.Encode("query", codeVersion) 11946 } 11947 if timeout != nil { 11948 queryParameters["timeout"] = autorest.Encode("query", *timeout) 11949 } else { 11950 queryParameters["timeout"] = autorest.Encode("query", 60) 11951 } 11952 11953 preparer := autorest.CreatePreparer( 11954 autorest.AsGet(), 11955 autorest.WithBaseURL(client.BaseURI), 11956 autorest.WithPath("/$/GetProvisionedCodeVersions"), 11957 autorest.WithQueryParameters(queryParameters)) 11958 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 11959} 11960 11961// GetProvisionedFabricCodeVersionInfoListSender sends the GetProvisionedFabricCodeVersionInfoList request. The method will close the 11962// http.Response Body if it receives an error. 11963func (client BaseClient) GetProvisionedFabricCodeVersionInfoListSender(req *http.Request) (*http.Response, error) { 11964 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 11965} 11966 11967// GetProvisionedFabricCodeVersionInfoListResponder handles the response to the GetProvisionedFabricCodeVersionInfoList request. The method always 11968// closes the http.Response Body. 11969func (client BaseClient) GetProvisionedFabricCodeVersionInfoListResponder(resp *http.Response) (result ListFabricCodeVersionInfo, err error) { 11970 err = autorest.Respond( 11971 resp, 11972 azure.WithErrorUnlessStatusCode(http.StatusOK), 11973 autorest.ByUnmarshallingJSON(&result.Value), 11974 autorest.ByClosing()) 11975 result.Response = autorest.Response{Response: resp} 11976 return 11977} 11978 11979// GetProvisionedFabricConfigVersionInfoList gets a list of information about fabric config versions that are 11980// provisioned in the cluster. The parameter ConfigVersion can be used to optionally filter the output to only that 11981// particular version. 11982// Parameters: 11983// configVersion - the config version of Service Fabric. 11984// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 11985// duration that the client is willing to wait for the requested operation to complete. The default value for 11986// this parameter is 60 seconds. 11987func (client BaseClient) GetProvisionedFabricConfigVersionInfoList(ctx context.Context, configVersion string, timeout *int64) (result ListFabricConfigVersionInfo, err error) { 11988 if tracing.IsEnabled() { 11989 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetProvisionedFabricConfigVersionInfoList") 11990 defer func() { 11991 sc := -1 11992 if result.Response.Response != nil { 11993 sc = result.Response.Response.StatusCode 11994 } 11995 tracing.EndSpan(ctx, sc, err) 11996 }() 11997 } 11998 if err := validation.Validate([]validation.Validation{ 11999 {TargetValue: timeout, 12000 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 12001 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 12002 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 12003 }}}}}); err != nil { 12004 return result, validation.NewError("servicefabric.BaseClient", "GetProvisionedFabricConfigVersionInfoList", err.Error()) 12005 } 12006 12007 req, err := client.GetProvisionedFabricConfigVersionInfoListPreparer(ctx, configVersion, timeout) 12008 if err != nil { 12009 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetProvisionedFabricConfigVersionInfoList", nil, "Failure preparing request") 12010 return 12011 } 12012 12013 resp, err := client.GetProvisionedFabricConfigVersionInfoListSender(req) 12014 if err != nil { 12015 result.Response = autorest.Response{Response: resp} 12016 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetProvisionedFabricConfigVersionInfoList", resp, "Failure sending request") 12017 return 12018 } 12019 12020 result, err = client.GetProvisionedFabricConfigVersionInfoListResponder(resp) 12021 if err != nil { 12022 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetProvisionedFabricConfigVersionInfoList", resp, "Failure responding to request") 12023 return 12024 } 12025 12026 return 12027} 12028 12029// GetProvisionedFabricConfigVersionInfoListPreparer prepares the GetProvisionedFabricConfigVersionInfoList request. 12030func (client BaseClient) GetProvisionedFabricConfigVersionInfoListPreparer(ctx context.Context, configVersion string, timeout *int64) (*http.Request, error) { 12031 const APIVersion = "6.0" 12032 queryParameters := map[string]interface{}{ 12033 "api-version": APIVersion, 12034 } 12035 if len(configVersion) > 0 { 12036 queryParameters["ConfigVersion"] = autorest.Encode("query", configVersion) 12037 } 12038 if timeout != nil { 12039 queryParameters["timeout"] = autorest.Encode("query", *timeout) 12040 } else { 12041 queryParameters["timeout"] = autorest.Encode("query", 60) 12042 } 12043 12044 preparer := autorest.CreatePreparer( 12045 autorest.AsGet(), 12046 autorest.WithBaseURL(client.BaseURI), 12047 autorest.WithPath("/$/GetProvisionedConfigVersions"), 12048 autorest.WithQueryParameters(queryParameters)) 12049 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 12050} 12051 12052// GetProvisionedFabricConfigVersionInfoListSender sends the GetProvisionedFabricConfigVersionInfoList request. The method will close the 12053// http.Response Body if it receives an error. 12054func (client BaseClient) GetProvisionedFabricConfigVersionInfoListSender(req *http.Request) (*http.Response, error) { 12055 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 12056} 12057 12058// GetProvisionedFabricConfigVersionInfoListResponder handles the response to the GetProvisionedFabricConfigVersionInfoList request. The method always 12059// closes the http.Response Body. 12060func (client BaseClient) GetProvisionedFabricConfigVersionInfoListResponder(resp *http.Response) (result ListFabricConfigVersionInfo, err error) { 12061 err = autorest.Respond( 12062 resp, 12063 azure.WithErrorUnlessStatusCode(http.StatusOK), 12064 autorest.ByUnmarshallingJSON(&result.Value), 12065 autorest.ByClosing()) 12066 result.Response = autorest.Response{Response: resp} 12067 return 12068} 12069 12070// GetQuorumLossProgress gets the progress of a quorum loss operation started with StartQuorumLoss, using the provided 12071// OperationId. 12072// Parameters: 12073// serviceID - the identity of the service. This ID is typically the full name of the service without the 12074// 'fabric:' URI scheme. 12075// Starting from version 6.0, hierarchical names are delimited with the "~" character. 12076// For example, if the service name is "fabric:/myapp/app1/svc1", the service identity would be 12077// "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in previous versions. 12078// partitionID - the identity of the partition. 12079// operationID - a GUID that identifies a call of this API. This is passed into the corresponding GetProgress 12080// API 12081// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 12082// duration that the client is willing to wait for the requested operation to complete. The default value for 12083// this parameter is 60 seconds. 12084func (client BaseClient) GetQuorumLossProgress(ctx context.Context, serviceID string, partitionID uuid.UUID, operationID uuid.UUID, timeout *int64) (result PartitionQuorumLossProgress, err error) { 12085 if tracing.IsEnabled() { 12086 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetQuorumLossProgress") 12087 defer func() { 12088 sc := -1 12089 if result.Response.Response != nil { 12090 sc = result.Response.Response.StatusCode 12091 } 12092 tracing.EndSpan(ctx, sc, err) 12093 }() 12094 } 12095 if err := validation.Validate([]validation.Validation{ 12096 {TargetValue: timeout, 12097 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 12098 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 12099 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 12100 }}}}}); err != nil { 12101 return result, validation.NewError("servicefabric.BaseClient", "GetQuorumLossProgress", err.Error()) 12102 } 12103 12104 req, err := client.GetQuorumLossProgressPreparer(ctx, serviceID, partitionID, operationID, timeout) 12105 if err != nil { 12106 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetQuorumLossProgress", nil, "Failure preparing request") 12107 return 12108 } 12109 12110 resp, err := client.GetQuorumLossProgressSender(req) 12111 if err != nil { 12112 result.Response = autorest.Response{Response: resp} 12113 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetQuorumLossProgress", resp, "Failure sending request") 12114 return 12115 } 12116 12117 result, err = client.GetQuorumLossProgressResponder(resp) 12118 if err != nil { 12119 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetQuorumLossProgress", resp, "Failure responding to request") 12120 return 12121 } 12122 12123 return 12124} 12125 12126// GetQuorumLossProgressPreparer prepares the GetQuorumLossProgress request. 12127func (client BaseClient) GetQuorumLossProgressPreparer(ctx context.Context, serviceID string, partitionID uuid.UUID, operationID uuid.UUID, timeout *int64) (*http.Request, error) { 12128 pathParameters := map[string]interface{}{ 12129 "partitionId": partitionID, 12130 "serviceId": serviceID, 12131 } 12132 12133 const APIVersion = "6.0" 12134 queryParameters := map[string]interface{}{ 12135 "api-version": APIVersion, 12136 "OperationId": autorest.Encode("query", operationID), 12137 } 12138 if timeout != nil { 12139 queryParameters["timeout"] = autorest.Encode("query", *timeout) 12140 } else { 12141 queryParameters["timeout"] = autorest.Encode("query", 60) 12142 } 12143 12144 preparer := autorest.CreatePreparer( 12145 autorest.AsGet(), 12146 autorest.WithBaseURL(client.BaseURI), 12147 autorest.WithPathParameters("/Faults/Services/{serviceId}/$/GetPartitions/{partitionId}/$/GetQuorumLossProgress", pathParameters), 12148 autorest.WithQueryParameters(queryParameters)) 12149 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 12150} 12151 12152// GetQuorumLossProgressSender sends the GetQuorumLossProgress request. The method will close the 12153// http.Response Body if it receives an error. 12154func (client BaseClient) GetQuorumLossProgressSender(req *http.Request) (*http.Response, error) { 12155 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 12156} 12157 12158// GetQuorumLossProgressResponder handles the response to the GetQuorumLossProgress request. The method always 12159// closes the http.Response Body. 12160func (client BaseClient) GetQuorumLossProgressResponder(resp *http.Response) (result PartitionQuorumLossProgress, err error) { 12161 err = autorest.Respond( 12162 resp, 12163 azure.WithErrorUnlessStatusCode(http.StatusOK), 12164 autorest.ByUnmarshallingJSON(&result), 12165 autorest.ByClosing()) 12166 result.Response = autorest.Response{Response: resp} 12167 return 12168} 12169 12170// GetRepairTaskList this API supports the Service Fabric platform; it is not meant to be used directly from your code. 12171// Parameters: 12172// taskIDFilter - the repair task ID prefix to be matched. 12173// stateFilter - a bitwise-OR of the following values, specifying which task states should be included in the 12174// result list. 12175// 12176// - 1 - Created 12177// - 2 - Claimed 12178// - 4 - Preparing 12179// - 8 - Approved 12180// - 16 - Executing 12181// - 32 - Restoring 12182// - 64 - Completed 12183// executorFilter - the name of the repair executor whose claimed tasks should be included in the list. 12184func (client BaseClient) GetRepairTaskList(ctx context.Context, taskIDFilter string, stateFilter *int32, executorFilter string) (result ListRepairTask, err error) { 12185 if tracing.IsEnabled() { 12186 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetRepairTaskList") 12187 defer func() { 12188 sc := -1 12189 if result.Response.Response != nil { 12190 sc = result.Response.Response.StatusCode 12191 } 12192 tracing.EndSpan(ctx, sc, err) 12193 }() 12194 } 12195 req, err := client.GetRepairTaskListPreparer(ctx, taskIDFilter, stateFilter, executorFilter) 12196 if err != nil { 12197 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetRepairTaskList", nil, "Failure preparing request") 12198 return 12199 } 12200 12201 resp, err := client.GetRepairTaskListSender(req) 12202 if err != nil { 12203 result.Response = autorest.Response{Response: resp} 12204 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetRepairTaskList", resp, "Failure sending request") 12205 return 12206 } 12207 12208 result, err = client.GetRepairTaskListResponder(resp) 12209 if err != nil { 12210 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetRepairTaskList", resp, "Failure responding to request") 12211 return 12212 } 12213 12214 return 12215} 12216 12217// GetRepairTaskListPreparer prepares the GetRepairTaskList request. 12218func (client BaseClient) GetRepairTaskListPreparer(ctx context.Context, taskIDFilter string, stateFilter *int32, executorFilter string) (*http.Request, error) { 12219 const APIVersion = "6.0" 12220 queryParameters := map[string]interface{}{ 12221 "api-version": APIVersion, 12222 } 12223 if len(taskIDFilter) > 0 { 12224 queryParameters["TaskIdFilter"] = autorest.Encode("query", taskIDFilter) 12225 } 12226 if stateFilter != nil { 12227 queryParameters["StateFilter"] = autorest.Encode("query", *stateFilter) 12228 } 12229 if len(executorFilter) > 0 { 12230 queryParameters["ExecutorFilter"] = autorest.Encode("query", executorFilter) 12231 } 12232 12233 preparer := autorest.CreatePreparer( 12234 autorest.AsGet(), 12235 autorest.WithBaseURL(client.BaseURI), 12236 autorest.WithPath("/$/GetRepairTaskList"), 12237 autorest.WithQueryParameters(queryParameters)) 12238 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 12239} 12240 12241// GetRepairTaskListSender sends the GetRepairTaskList request. The method will close the 12242// http.Response Body if it receives an error. 12243func (client BaseClient) GetRepairTaskListSender(req *http.Request) (*http.Response, error) { 12244 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 12245} 12246 12247// GetRepairTaskListResponder handles the response to the GetRepairTaskList request. The method always 12248// closes the http.Response Body. 12249func (client BaseClient) GetRepairTaskListResponder(resp *http.Response) (result ListRepairTask, err error) { 12250 err = autorest.Respond( 12251 resp, 12252 azure.WithErrorUnlessStatusCode(http.StatusOK), 12253 autorest.ByUnmarshallingJSON(&result.Value), 12254 autorest.ByClosing()) 12255 result.Response = autorest.Response{Response: resp} 12256 return 12257} 12258 12259// GetReplicaHealth gets the health of a Service Fabric replica. 12260// Use EventsHealthStateFilter to filter the collection of health events reported on the replica based on the health 12261// state. 12262// Parameters: 12263// partitionID - the identity of the partition. 12264// replicaID - the identifier of the replica. 12265// eventsHealthStateFilter - allows filtering the collection of HealthEvent objects returned based on health 12266// state. 12267// The possible values for this parameter include integer value of one of the following health states. 12268// Only events that match the filter are returned. All events are used to evaluate the aggregated health state. 12269// If not specified, all entries are returned. The state values are flag-based enumeration, so the value could 12270// be a combination of these values, obtained using the bitwise 'OR' operator. For example, If the provided 12271// value is 6 then all of the events with HealthState value of OK (2) and Warning (4) are returned. 12272// 12273// - Default - Default value. Matches any HealthState. The value is zero. 12274// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given 12275// collection of states. The value is 1. 12276// - Ok - Filter that matches input with HealthState value Ok. The value is 2. 12277// - Warning - Filter that matches input with HealthState value Warning. The value is 4. 12278// - Error - Filter that matches input with HealthState value Error. The value is 8. 12279// - All - Filter that matches input with any HealthState value. The value is 65535. 12280// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 12281// duration that the client is willing to wait for the requested operation to complete. The default value for 12282// this parameter is 60 seconds. 12283func (client BaseClient) GetReplicaHealth(ctx context.Context, partitionID uuid.UUID, replicaID string, eventsHealthStateFilter *int32, timeout *int64) (result ReplicaHealthModel, err error) { 12284 if tracing.IsEnabled() { 12285 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetReplicaHealth") 12286 defer func() { 12287 sc := -1 12288 if result.Response.Response != nil { 12289 sc = result.Response.Response.StatusCode 12290 } 12291 tracing.EndSpan(ctx, sc, err) 12292 }() 12293 } 12294 if err := validation.Validate([]validation.Validation{ 12295 {TargetValue: timeout, 12296 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 12297 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 12298 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 12299 }}}}}); err != nil { 12300 return result, validation.NewError("servicefabric.BaseClient", "GetReplicaHealth", err.Error()) 12301 } 12302 12303 req, err := client.GetReplicaHealthPreparer(ctx, partitionID, replicaID, eventsHealthStateFilter, timeout) 12304 if err != nil { 12305 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetReplicaHealth", nil, "Failure preparing request") 12306 return 12307 } 12308 12309 resp, err := client.GetReplicaHealthSender(req) 12310 if err != nil { 12311 result.Response = autorest.Response{Response: resp} 12312 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetReplicaHealth", resp, "Failure sending request") 12313 return 12314 } 12315 12316 result, err = client.GetReplicaHealthResponder(resp) 12317 if err != nil { 12318 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetReplicaHealth", resp, "Failure responding to request") 12319 return 12320 } 12321 12322 return 12323} 12324 12325// GetReplicaHealthPreparer prepares the GetReplicaHealth request. 12326func (client BaseClient) GetReplicaHealthPreparer(ctx context.Context, partitionID uuid.UUID, replicaID string, eventsHealthStateFilter *int32, timeout *int64) (*http.Request, error) { 12327 pathParameters := map[string]interface{}{ 12328 "partitionId": partitionID, 12329 "replicaId": replicaID, 12330 } 12331 12332 const APIVersion = "6.0" 12333 queryParameters := map[string]interface{}{ 12334 "api-version": APIVersion, 12335 } 12336 if eventsHealthStateFilter != nil { 12337 queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", *eventsHealthStateFilter) 12338 } else { 12339 queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", 0) 12340 } 12341 if timeout != nil { 12342 queryParameters["timeout"] = autorest.Encode("query", *timeout) 12343 } else { 12344 queryParameters["timeout"] = autorest.Encode("query", 60) 12345 } 12346 12347 preparer := autorest.CreatePreparer( 12348 autorest.AsGet(), 12349 autorest.WithBaseURL(client.BaseURI), 12350 autorest.WithPathParameters("/Partitions/{partitionId}/$/GetReplicas/{replicaId}/$/GetHealth", pathParameters), 12351 autorest.WithQueryParameters(queryParameters)) 12352 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 12353} 12354 12355// GetReplicaHealthSender sends the GetReplicaHealth request. The method will close the 12356// http.Response Body if it receives an error. 12357func (client BaseClient) GetReplicaHealthSender(req *http.Request) (*http.Response, error) { 12358 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 12359} 12360 12361// GetReplicaHealthResponder handles the response to the GetReplicaHealth request. The method always 12362// closes the http.Response Body. 12363func (client BaseClient) GetReplicaHealthResponder(resp *http.Response) (result ReplicaHealthModel, err error) { 12364 err = autorest.Respond( 12365 resp, 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 values, obtained using the bitwise 'OR' operator. For example, If the provided 12389// value is 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: int64(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 return 12442 } 12443 12444 return 12445} 12446 12447// GetReplicaHealthUsingPolicyPreparer prepares the GetReplicaHealthUsingPolicy request. 12448func (client BaseClient) GetReplicaHealthUsingPolicyPreparer(ctx context.Context, partitionID uuid.UUID, replicaID string, eventsHealthStateFilter *int32, applicationHealthPolicy *ApplicationHealthPolicy, timeout *int64) (*http.Request, error) { 12449 pathParameters := map[string]interface{}{ 12450 "partitionId": partitionID, 12451 "replicaId": replicaID, 12452 } 12453 12454 const APIVersion = "6.0" 12455 queryParameters := map[string]interface{}{ 12456 "api-version": APIVersion, 12457 } 12458 if eventsHealthStateFilter != nil { 12459 queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", *eventsHealthStateFilter) 12460 } else { 12461 queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", 0) 12462 } 12463 if timeout != nil { 12464 queryParameters["timeout"] = autorest.Encode("query", *timeout) 12465 } else { 12466 queryParameters["timeout"] = autorest.Encode("query", 60) 12467 } 12468 12469 preparer := autorest.CreatePreparer( 12470 autorest.AsContentType("application/json; charset=utf-8"), 12471 autorest.AsPost(), 12472 autorest.WithBaseURL(client.BaseURI), 12473 autorest.WithPathParameters("/Partitions/{partitionId}/$/GetReplicas/{replicaId}/$/GetHealth", pathParameters), 12474 autorest.WithQueryParameters(queryParameters)) 12475 if applicationHealthPolicy != nil { 12476 preparer = autorest.DecoratePreparer(preparer, 12477 autorest.WithJSON(applicationHealthPolicy)) 12478 } 12479 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 12480} 12481 12482// GetReplicaHealthUsingPolicySender sends the GetReplicaHealthUsingPolicy request. The method will close the 12483// http.Response Body if it receives an error. 12484func (client BaseClient) GetReplicaHealthUsingPolicySender(req *http.Request) (*http.Response, error) { 12485 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 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 azure.WithErrorUnlessStatusCode(http.StatusOK), 12494 autorest.ByUnmarshallingJSON(&result), 12495 autorest.ByClosing()) 12496 result.Response = autorest.Response{Response: resp} 12497 return 12498} 12499 12500// GetReplicaInfo the response includes the ID, role, status, health, node name, uptime, and other details about the 12501// replica. 12502// Parameters: 12503// partitionID - the identity of the partition. 12504// replicaID - the identifier of the replica. 12505// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 12506// duration that the client is willing to wait for the requested operation to complete. The default value for 12507// this parameter is 60 seconds. 12508func (client BaseClient) GetReplicaInfo(ctx context.Context, partitionID uuid.UUID, replicaID string, timeout *int64) (result ReplicaInfoModel, err error) { 12509 if tracing.IsEnabled() { 12510 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetReplicaInfo") 12511 defer func() { 12512 sc := -1 12513 if result.Response.Response != nil { 12514 sc = result.Response.Response.StatusCode 12515 } 12516 tracing.EndSpan(ctx, sc, err) 12517 }() 12518 } 12519 if err := validation.Validate([]validation.Validation{ 12520 {TargetValue: timeout, 12521 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 12522 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 12523 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 12524 }}}}}); err != nil { 12525 return result, validation.NewError("servicefabric.BaseClient", "GetReplicaInfo", err.Error()) 12526 } 12527 12528 req, err := client.GetReplicaInfoPreparer(ctx, partitionID, replicaID, timeout) 12529 if err != nil { 12530 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetReplicaInfo", nil, "Failure preparing request") 12531 return 12532 } 12533 12534 resp, err := client.GetReplicaInfoSender(req) 12535 if err != nil { 12536 result.Response = autorest.Response{Response: resp} 12537 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetReplicaInfo", resp, "Failure sending request") 12538 return 12539 } 12540 12541 result, err = client.GetReplicaInfoResponder(resp) 12542 if err != nil { 12543 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetReplicaInfo", resp, "Failure responding to request") 12544 return 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 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 12579} 12580 12581// GetReplicaInfoResponder handles the response to the GetReplicaInfo request. The method always 12582// closes the http.Response Body. 12583func (client BaseClient) GetReplicaInfoResponder(resp *http.Response) (result ReplicaInfoModel, err error) { 12584 err = autorest.Respond( 12585 resp, 12586 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), 12587 autorest.ByUnmarshallingJSON(&result), 12588 autorest.ByClosing()) 12589 result.Response = autorest.Response{Response: resp} 12590 return 12591} 12592 12593// GetReplicaInfoList the GetReplicas endpoint returns information about the replicas of the specified partition. The 12594// response includes the ID, role, status, health, node name, uptime, and other details about the replica. 12595// Parameters: 12596// partitionID - the identity of the partition. 12597// continuationToken - the continuation token parameter is used to obtain next set of results. A continuation 12598// token with a non-empty value is included in the response of the API when the results from the system do not 12599// fit in a single response. When this value is passed to the next API call, the API returns next set of 12600// results. If there are no further results, then the continuation token does not contain a value. The value of 12601// this parameter should not be URL encoded. 12602// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 12603// duration that the client is willing to wait for the requested operation to complete. The default value for 12604// this parameter is 60 seconds. 12605func (client BaseClient) GetReplicaInfoList(ctx context.Context, partitionID uuid.UUID, continuationToken string, timeout *int64) (result PagedReplicaInfoList, err error) { 12606 if tracing.IsEnabled() { 12607 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetReplicaInfoList") 12608 defer func() { 12609 sc := -1 12610 if result.Response.Response != nil { 12611 sc = result.Response.Response.StatusCode 12612 } 12613 tracing.EndSpan(ctx, sc, err) 12614 }() 12615 } 12616 if err := validation.Validate([]validation.Validation{ 12617 {TargetValue: timeout, 12618 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 12619 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 12620 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 12621 }}}}}); err != nil { 12622 return result, validation.NewError("servicefabric.BaseClient", "GetReplicaInfoList", err.Error()) 12623 } 12624 12625 req, err := client.GetReplicaInfoListPreparer(ctx, partitionID, continuationToken, timeout) 12626 if err != nil { 12627 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetReplicaInfoList", nil, "Failure preparing request") 12628 return 12629 } 12630 12631 resp, err := client.GetReplicaInfoListSender(req) 12632 if err != nil { 12633 result.Response = autorest.Response{Response: resp} 12634 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetReplicaInfoList", resp, "Failure sending request") 12635 return 12636 } 12637 12638 result, err = client.GetReplicaInfoListResponder(resp) 12639 if err != nil { 12640 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetReplicaInfoList", resp, "Failure responding to request") 12641 return 12642 } 12643 12644 return 12645} 12646 12647// GetReplicaInfoListPreparer prepares the GetReplicaInfoList request. 12648func (client BaseClient) GetReplicaInfoListPreparer(ctx context.Context, partitionID uuid.UUID, continuationToken string, timeout *int64) (*http.Request, error) { 12649 pathParameters := map[string]interface{}{ 12650 "partitionId": partitionID, 12651 } 12652 12653 const APIVersion = "6.0" 12654 queryParameters := map[string]interface{}{ 12655 "api-version": APIVersion, 12656 } 12657 if len(continuationToken) > 0 { 12658 queryParameters["ContinuationToken"] = continuationToken 12659 } 12660 if timeout != nil { 12661 queryParameters["timeout"] = autorest.Encode("query", *timeout) 12662 } else { 12663 queryParameters["timeout"] = autorest.Encode("query", 60) 12664 } 12665 12666 preparer := autorest.CreatePreparer( 12667 autorest.AsGet(), 12668 autorest.WithBaseURL(client.BaseURI), 12669 autorest.WithPathParameters("/Partitions/{partitionId}/$/GetReplicas", pathParameters), 12670 autorest.WithQueryParameters(queryParameters)) 12671 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 12672} 12673 12674// GetReplicaInfoListSender sends the GetReplicaInfoList request. The method will close the 12675// http.Response Body if it receives an error. 12676func (client BaseClient) GetReplicaInfoListSender(req *http.Request) (*http.Response, error) { 12677 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 12678} 12679 12680// GetReplicaInfoListResponder handles the response to the GetReplicaInfoList request. The method always 12681// closes the http.Response Body. 12682func (client BaseClient) GetReplicaInfoListResponder(resp *http.Response) (result PagedReplicaInfoList, err error) { 12683 err = autorest.Respond( 12684 resp, 12685 azure.WithErrorUnlessStatusCode(http.StatusOK), 12686 autorest.ByUnmarshallingJSON(&result), 12687 autorest.ByClosing()) 12688 result.Response = autorest.Response{Response: resp} 12689 return 12690} 12691 12692// GetServiceBackupConfigurationInfo gets the Service Fabric backup configuration information for the service and the 12693// partitions under this service. 12694// Parameters: 12695// serviceID - the identity of the service. This ID is typically the full name of the service without the 12696// 'fabric:' URI scheme. 12697// Starting from version 6.0, hierarchical names are delimited with the "~" character. 12698// For example, if the service name is "fabric:/myapp/app1/svc1", the service identity would be 12699// "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in previous versions. 12700// continuationToken - the continuation token parameter is used to obtain next set of results. A continuation 12701// token with a non-empty value is included in the response of the API when the results from the system do not 12702// fit in a single response. When this value is passed to the next API call, the API returns next set of 12703// results. If there are no further results, then the continuation token does not contain a value. The value of 12704// this parameter should not be URL encoded. 12705// maxResults - the maximum number of results to be returned as part of the paged queries. This parameter 12706// defines the upper bound on the number of results returned. The results returned can be less than the 12707// specified maximum results if they do not fit in the message as per the max message size restrictions defined 12708// in the configuration. If this parameter is zero or not specified, the paged query includes as many results 12709// as possible that fit in the return message. 12710// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 12711// duration that the client is willing to wait for the requested operation to complete. The default value for 12712// this parameter is 60 seconds. 12713func (client BaseClient) GetServiceBackupConfigurationInfo(ctx context.Context, serviceID string, continuationToken string, maxResults *int64, timeout *int64) (result PagedBackupConfigurationInfoList, err error) { 12714 if tracing.IsEnabled() { 12715 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetServiceBackupConfigurationInfo") 12716 defer func() { 12717 sc := -1 12718 if result.Response.Response != nil { 12719 sc = result.Response.Response.StatusCode 12720 } 12721 tracing.EndSpan(ctx, sc, err) 12722 }() 12723 } 12724 if err := validation.Validate([]validation.Validation{ 12725 {TargetValue: maxResults, 12726 Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false, 12727 Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}}}}}, 12728 {TargetValue: timeout, 12729 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 12730 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 12731 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 12732 }}}}}); err != nil { 12733 return result, validation.NewError("servicefabric.BaseClient", "GetServiceBackupConfigurationInfo", err.Error()) 12734 } 12735 12736 req, err := client.GetServiceBackupConfigurationInfoPreparer(ctx, serviceID, continuationToken, maxResults, timeout) 12737 if err != nil { 12738 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceBackupConfigurationInfo", nil, "Failure preparing request") 12739 return 12740 } 12741 12742 resp, err := client.GetServiceBackupConfigurationInfoSender(req) 12743 if err != nil { 12744 result.Response = autorest.Response{Response: resp} 12745 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceBackupConfigurationInfo", resp, "Failure sending request") 12746 return 12747 } 12748 12749 result, err = client.GetServiceBackupConfigurationInfoResponder(resp) 12750 if err != nil { 12751 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceBackupConfigurationInfo", resp, "Failure responding to request") 12752 return 12753 } 12754 12755 return 12756} 12757 12758// GetServiceBackupConfigurationInfoPreparer prepares the GetServiceBackupConfigurationInfo request. 12759func (client BaseClient) GetServiceBackupConfigurationInfoPreparer(ctx context.Context, serviceID string, continuationToken string, maxResults *int64, timeout *int64) (*http.Request, error) { 12760 pathParameters := map[string]interface{}{ 12761 "serviceId": serviceID, 12762 } 12763 12764 const APIVersion = "6.4" 12765 queryParameters := map[string]interface{}{ 12766 "api-version": APIVersion, 12767 } 12768 if len(continuationToken) > 0 { 12769 queryParameters["ContinuationToken"] = continuationToken 12770 } 12771 if maxResults != nil { 12772 queryParameters["MaxResults"] = autorest.Encode("query", *maxResults) 12773 } else { 12774 queryParameters["MaxResults"] = autorest.Encode("query", 0) 12775 } 12776 if timeout != nil { 12777 queryParameters["timeout"] = autorest.Encode("query", *timeout) 12778 } else { 12779 queryParameters["timeout"] = autorest.Encode("query", 60) 12780 } 12781 12782 preparer := autorest.CreatePreparer( 12783 autorest.AsGet(), 12784 autorest.WithBaseURL(client.BaseURI), 12785 autorest.WithPathParameters("/Services/{serviceId}/$/GetBackupConfigurationInfo", pathParameters), 12786 autorest.WithQueryParameters(queryParameters)) 12787 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 12788} 12789 12790// GetServiceBackupConfigurationInfoSender sends the GetServiceBackupConfigurationInfo request. The method will close the 12791// http.Response Body if it receives an error. 12792func (client BaseClient) GetServiceBackupConfigurationInfoSender(req *http.Request) (*http.Response, error) { 12793 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 12794} 12795 12796// GetServiceBackupConfigurationInfoResponder handles the response to the GetServiceBackupConfigurationInfo request. The method always 12797// closes the http.Response Body. 12798func (client BaseClient) GetServiceBackupConfigurationInfoResponder(resp *http.Response) (result PagedBackupConfigurationInfoList, err error) { 12799 err = autorest.Respond( 12800 resp, 12801 azure.WithErrorUnlessStatusCode(http.StatusOK), 12802 autorest.ByUnmarshallingJSON(&result), 12803 autorest.ByClosing()) 12804 result.Response = autorest.Response{Response: resp} 12805 return 12806} 12807 12808// GetServiceBackupList returns a list of backups available for every partition in this Service Fabric service. The 12809// server enumerates all the backups available in the backup store configured in the backup policy. It also allows 12810// filtering of the result based on start and end datetime or just fetching the latest available backup for every 12811// partition. 12812// Parameters: 12813// serviceID - the identity of the service. This ID is typically the full name of the service without the 12814// 'fabric:' URI scheme. 12815// Starting from version 6.0, hierarchical names are delimited with the "~" character. 12816// For example, if the service name is "fabric:/myapp/app1/svc1", the service identity would be 12817// "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in previous versions. 12818// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 12819// duration that the client is willing to wait for the requested operation to complete. The default value for 12820// this parameter is 60 seconds. 12821// latest - specifies whether to get only the most recent backup available for a partition for the specified 12822// time range. 12823// startDateTimeFilter - specify the start date time from which to enumerate backups, in datetime format. The 12824// date time must be specified in ISO8601 format. This is an optional parameter. If not specified, all backups 12825// from the beginning are enumerated. 12826// endDateTimeFilter - specify the end date time till which to enumerate backups, in datetime format. The date 12827// time must be specified in ISO8601 format. This is an optional parameter. If not specified, enumeration is 12828// done till the most recent backup. 12829// continuationToken - the continuation token parameter is used to obtain next set of results. A continuation 12830// token with a non-empty value is included in the response of the API when the results from the system do not 12831// fit in a single response. When this value is passed to the next API call, the API returns next set of 12832// results. If there are no further results, then the continuation token does not contain a value. The value of 12833// this parameter should not be URL encoded. 12834// maxResults - the maximum number of results to be returned as part of the paged queries. This parameter 12835// defines the upper bound on the number of results returned. The results returned can be less than the 12836// specified maximum results if they do not fit in the message as per the max message size restrictions defined 12837// in the configuration. If this parameter is zero or not specified, the paged query includes as many results 12838// as possible that fit in the return message. 12839func (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) { 12840 if tracing.IsEnabled() { 12841 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetServiceBackupList") 12842 defer func() { 12843 sc := -1 12844 if result.Response.Response != nil { 12845 sc = result.Response.Response.StatusCode 12846 } 12847 tracing.EndSpan(ctx, sc, err) 12848 }() 12849 } 12850 if err := validation.Validate([]validation.Validation{ 12851 {TargetValue: timeout, 12852 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 12853 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 12854 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 12855 }}}}, 12856 {TargetValue: maxResults, 12857 Constraints: []validation.Constraint{{Target: "maxResults", Name: validation.Null, Rule: false, 12858 Chain: []validation.Constraint{{Target: "maxResults", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}}}}}}); err != nil { 12859 return result, validation.NewError("servicefabric.BaseClient", "GetServiceBackupList", err.Error()) 12860 } 12861 12862 req, err := client.GetServiceBackupListPreparer(ctx, serviceID, timeout, latest, startDateTimeFilter, endDateTimeFilter, continuationToken, maxResults) 12863 if err != nil { 12864 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceBackupList", nil, "Failure preparing request") 12865 return 12866 } 12867 12868 resp, err := client.GetServiceBackupListSender(req) 12869 if err != nil { 12870 result.Response = autorest.Response{Response: resp} 12871 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceBackupList", resp, "Failure sending request") 12872 return 12873 } 12874 12875 result, err = client.GetServiceBackupListResponder(resp) 12876 if err != nil { 12877 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceBackupList", resp, "Failure responding to request") 12878 return 12879 } 12880 12881 return 12882} 12883 12884// GetServiceBackupListPreparer prepares the GetServiceBackupList request. 12885func (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) { 12886 pathParameters := map[string]interface{}{ 12887 "serviceId": serviceID, 12888 } 12889 12890 const APIVersion = "6.4" 12891 queryParameters := map[string]interface{}{ 12892 "api-version": APIVersion, 12893 } 12894 if timeout != nil { 12895 queryParameters["timeout"] = autorest.Encode("query", *timeout) 12896 } else { 12897 queryParameters["timeout"] = autorest.Encode("query", 60) 12898 } 12899 if latest != nil { 12900 queryParameters["Latest"] = autorest.Encode("query", *latest) 12901 } else { 12902 queryParameters["Latest"] = autorest.Encode("query", false) 12903 } 12904 if startDateTimeFilter != nil { 12905 queryParameters["StartDateTimeFilter"] = autorest.Encode("query", *startDateTimeFilter) 12906 } 12907 if endDateTimeFilter != nil { 12908 queryParameters["EndDateTimeFilter"] = autorest.Encode("query", *endDateTimeFilter) 12909 } 12910 if len(continuationToken) > 0 { 12911 queryParameters["ContinuationToken"] = continuationToken 12912 } 12913 if maxResults != nil { 12914 queryParameters["MaxResults"] = autorest.Encode("query", *maxResults) 12915 } else { 12916 queryParameters["MaxResults"] = autorest.Encode("query", 0) 12917 } 12918 12919 preparer := autorest.CreatePreparer( 12920 autorest.AsGet(), 12921 autorest.WithBaseURL(client.BaseURI), 12922 autorest.WithPathParameters("/Services/{serviceId}/$/GetBackups", pathParameters), 12923 autorest.WithQueryParameters(queryParameters)) 12924 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 12925} 12926 12927// GetServiceBackupListSender sends the GetServiceBackupList request. The method will close the 12928// http.Response Body if it receives an error. 12929func (client BaseClient) GetServiceBackupListSender(req *http.Request) (*http.Response, error) { 12930 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 12931} 12932 12933// GetServiceBackupListResponder handles the response to the GetServiceBackupList request. The method always 12934// closes the http.Response Body. 12935func (client BaseClient) GetServiceBackupListResponder(resp *http.Response) (result PagedBackupInfoList, err error) { 12936 err = autorest.Respond( 12937 resp, 12938 azure.WithErrorUnlessStatusCode(http.StatusOK), 12939 autorest.ByUnmarshallingJSON(&result), 12940 autorest.ByClosing()) 12941 result.Response = autorest.Response{Response: resp} 12942 return 12943} 12944 12945// GetServiceDescription gets the description of an existing Service Fabric service. A service must be created before 12946// its description can be obtained. 12947// Parameters: 12948// serviceID - the identity of the service. This ID is typically the full name of the service without the 12949// 'fabric:' URI scheme. 12950// Starting from version 6.0, hierarchical names are delimited with the "~" character. 12951// For example, if the service name is "fabric:/myapp/app1/svc1", the service identity would be 12952// "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in previous versions. 12953// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 12954// duration that the client is willing to wait for the requested operation to complete. The default value for 12955// this parameter is 60 seconds. 12956func (client BaseClient) GetServiceDescription(ctx context.Context, serviceID string, timeout *int64) (result ServiceDescriptionModel, err error) { 12957 if tracing.IsEnabled() { 12958 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetServiceDescription") 12959 defer func() { 12960 sc := -1 12961 if result.Response.Response != nil { 12962 sc = result.Response.Response.StatusCode 12963 } 12964 tracing.EndSpan(ctx, sc, err) 12965 }() 12966 } 12967 if err := validation.Validate([]validation.Validation{ 12968 {TargetValue: timeout, 12969 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 12970 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 12971 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 12972 }}}}}); err != nil { 12973 return result, validation.NewError("servicefabric.BaseClient", "GetServiceDescription", err.Error()) 12974 } 12975 12976 req, err := client.GetServiceDescriptionPreparer(ctx, serviceID, timeout) 12977 if err != nil { 12978 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceDescription", nil, "Failure preparing request") 12979 return 12980 } 12981 12982 resp, err := client.GetServiceDescriptionSender(req) 12983 if err != nil { 12984 result.Response = autorest.Response{Response: resp} 12985 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceDescription", resp, "Failure sending request") 12986 return 12987 } 12988 12989 result, err = client.GetServiceDescriptionResponder(resp) 12990 if err != nil { 12991 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceDescription", resp, "Failure responding to request") 12992 return 12993 } 12994 12995 return 12996} 12997 12998// GetServiceDescriptionPreparer prepares the GetServiceDescription request. 12999func (client BaseClient) GetServiceDescriptionPreparer(ctx context.Context, serviceID string, timeout *int64) (*http.Request, error) { 13000 pathParameters := map[string]interface{}{ 13001 "serviceId": serviceID, 13002 } 13003 13004 const APIVersion = "6.0" 13005 queryParameters := map[string]interface{}{ 13006 "api-version": APIVersion, 13007 } 13008 if timeout != nil { 13009 queryParameters["timeout"] = autorest.Encode("query", *timeout) 13010 } else { 13011 queryParameters["timeout"] = autorest.Encode("query", 60) 13012 } 13013 13014 preparer := autorest.CreatePreparer( 13015 autorest.AsGet(), 13016 autorest.WithBaseURL(client.BaseURI), 13017 autorest.WithPathParameters("/Services/{serviceId}/$/GetDescription", pathParameters), 13018 autorest.WithQueryParameters(queryParameters)) 13019 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 13020} 13021 13022// GetServiceDescriptionSender sends the GetServiceDescription request. The method will close the 13023// http.Response Body if it receives an error. 13024func (client BaseClient) GetServiceDescriptionSender(req *http.Request) (*http.Response, error) { 13025 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 13026} 13027 13028// GetServiceDescriptionResponder handles the response to the GetServiceDescription request. The method always 13029// closes the http.Response Body. 13030func (client BaseClient) GetServiceDescriptionResponder(resp *http.Response) (result ServiceDescriptionModel, err error) { 13031 err = autorest.Respond( 13032 resp, 13033 azure.WithErrorUnlessStatusCode(http.StatusOK), 13034 autorest.ByUnmarshallingJSON(&result), 13035 autorest.ByClosing()) 13036 result.Response = autorest.Response{Response: resp} 13037 return 13038} 13039 13040// GetServiceEventList the response is list of ServiceEvent objects. 13041// Parameters: 13042// serviceID - the identity of the service. This ID is typically the full name of the service without the 13043// 'fabric:' URI scheme. 13044// Starting from version 6.0, hierarchical names are delimited with the "~" character. 13045// For example, if the service name is "fabric:/myapp/app1/svc1", the service identity would be 13046// "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in previous versions. 13047// startTimeUtc - the start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. 13048// endTimeUtc - the end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. 13049// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 13050// duration that the client is willing to wait for the requested operation to complete. The default value for 13051// this parameter is 60 seconds. 13052// eventsTypesFilter - this is a comma separated string specifying the types of FabricEvents that should only 13053// be included in the response. 13054// excludeAnalysisEvents - this param disables the retrieval of AnalysisEvents if true is passed. 13055// skipCorrelationLookup - this param disables the search of CorrelatedEvents information if true is passed. 13056// otherwise the CorrelationEvents get processed and HasCorrelatedEvents field in every FabricEvent gets 13057// populated. 13058func (client BaseClient) GetServiceEventList(ctx context.Context, serviceID string, startTimeUtc string, endTimeUtc string, timeout *int64, eventsTypesFilter string, excludeAnalysisEvents *bool, skipCorrelationLookup *bool) (result ListServiceEvent, err error) { 13059 if tracing.IsEnabled() { 13060 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetServiceEventList") 13061 defer func() { 13062 sc := -1 13063 if result.Response.Response != nil { 13064 sc = result.Response.Response.StatusCode 13065 } 13066 tracing.EndSpan(ctx, sc, err) 13067 }() 13068 } 13069 if err := validation.Validate([]validation.Validation{ 13070 {TargetValue: timeout, 13071 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 13072 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 13073 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 13074 }}}}}); err != nil { 13075 return result, validation.NewError("servicefabric.BaseClient", "GetServiceEventList", err.Error()) 13076 } 13077 13078 req, err := client.GetServiceEventListPreparer(ctx, serviceID, startTimeUtc, endTimeUtc, timeout, eventsTypesFilter, excludeAnalysisEvents, skipCorrelationLookup) 13079 if err != nil { 13080 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceEventList", nil, "Failure preparing request") 13081 return 13082 } 13083 13084 resp, err := client.GetServiceEventListSender(req) 13085 if err != nil { 13086 result.Response = autorest.Response{Response: resp} 13087 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceEventList", resp, "Failure sending request") 13088 return 13089 } 13090 13091 result, err = client.GetServiceEventListResponder(resp) 13092 if err != nil { 13093 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceEventList", resp, "Failure responding to request") 13094 return 13095 } 13096 13097 return 13098} 13099 13100// GetServiceEventListPreparer prepares the GetServiceEventList request. 13101func (client BaseClient) GetServiceEventListPreparer(ctx context.Context, serviceID string, startTimeUtc string, endTimeUtc string, timeout *int64, eventsTypesFilter string, excludeAnalysisEvents *bool, skipCorrelationLookup *bool) (*http.Request, error) { 13102 pathParameters := map[string]interface{}{ 13103 "serviceId": serviceID, 13104 } 13105 13106 const APIVersion = "6.4" 13107 queryParameters := map[string]interface{}{ 13108 "api-version": APIVersion, 13109 "EndTimeUtc": autorest.Encode("query", endTimeUtc), 13110 "StartTimeUtc": autorest.Encode("query", startTimeUtc), 13111 } 13112 if timeout != nil { 13113 queryParameters["timeout"] = autorest.Encode("query", *timeout) 13114 } else { 13115 queryParameters["timeout"] = autorest.Encode("query", 60) 13116 } 13117 if len(eventsTypesFilter) > 0 { 13118 queryParameters["EventsTypesFilter"] = autorest.Encode("query", eventsTypesFilter) 13119 } 13120 if excludeAnalysisEvents != nil { 13121 queryParameters["ExcludeAnalysisEvents"] = autorest.Encode("query", *excludeAnalysisEvents) 13122 } 13123 if skipCorrelationLookup != nil { 13124 queryParameters["SkipCorrelationLookup"] = autorest.Encode("query", *skipCorrelationLookup) 13125 } 13126 13127 preparer := autorest.CreatePreparer( 13128 autorest.AsGet(), 13129 autorest.WithBaseURL(client.BaseURI), 13130 autorest.WithPathParameters("/EventsStore/Services/{serviceId}/$/Events", pathParameters), 13131 autorest.WithQueryParameters(queryParameters)) 13132 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 13133} 13134 13135// GetServiceEventListSender sends the GetServiceEventList request. The method will close the 13136// http.Response Body if it receives an error. 13137func (client BaseClient) GetServiceEventListSender(req *http.Request) (*http.Response, error) { 13138 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 13139} 13140 13141// GetServiceEventListResponder handles the response to the GetServiceEventList request. The method always 13142// closes the http.Response Body. 13143func (client BaseClient) GetServiceEventListResponder(resp *http.Response) (result ListServiceEvent, err error) { 13144 err = autorest.Respond( 13145 resp, 13146 azure.WithErrorUnlessStatusCode(http.StatusOK), 13147 autorest.ByUnmarshallingJSON(&result), 13148 autorest.ByClosing()) 13149 result.Response = autorest.Response{Response: resp} 13150 return 13151} 13152 13153// GetServiceHealth gets the health information of the specified service. 13154// Use EventsHealthStateFilter to filter the collection of health events reported on the service based on the health 13155// state. 13156// Use PartitionsHealthStateFilter to filter the collection of partitions returned. 13157// If you specify a service that does not exist in the health store, this request returns an error. 13158// Parameters: 13159// serviceID - the identity of the service. This ID is typically the full name of the service without the 13160// 'fabric:' URI scheme. 13161// Starting from version 6.0, hierarchical names are delimited with the "~" character. 13162// For example, if the service name is "fabric:/myapp/app1/svc1", the service identity would be 13163// "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in previous versions. 13164// eventsHealthStateFilter - allows filtering the collection of HealthEvent objects returned based on health 13165// state. 13166// The possible values for this parameter include integer value of one of the following health states. 13167// Only events that match the filter are returned. All events are used to evaluate the aggregated health state. 13168// If not specified, all entries are returned. The state values are flag-based enumeration, so the value could 13169// be a combination of these values, obtained using the bitwise 'OR' operator. For example, If the provided 13170// value is 6 then all of the events with HealthState value of OK (2) and Warning (4) are returned. 13171// 13172// - Default - Default value. Matches any HealthState. The value is zero. 13173// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given 13174// collection of states. The value is 1. 13175// - Ok - Filter that matches input with HealthState value Ok. The value is 2. 13176// - Warning - Filter that matches input with HealthState value Warning. The value is 4. 13177// - Error - Filter that matches input with HealthState value Error. The value is 8. 13178// - All - Filter that matches input with any HealthState value. The value is 65535. 13179// partitionsHealthStateFilter - allows filtering of the partitions health state objects returned in the result 13180// of service health query based on their health state. 13181// The possible values for this parameter include integer value of one of the following health states. 13182// Only partitions that match the filter are returned. All partitions are used to evaluate the aggregated 13183// health state. 13184// If not specified, all entries are returned. The state values are flag-based enumeration, so the value could 13185// be a combination of these value 13186// obtained using bitwise 'OR' operator. For example, if the provided value is 6 then health state of 13187// partitions with HealthState value of OK (2) and Warning (4) will be returned. 13188// 13189// - Default - Default value. Matches any HealthState. The value is zero. 13190// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given 13191// collection of states. The value is 1. 13192// - Ok - Filter that matches input with HealthState value Ok. The value is 2. 13193// - Warning - Filter that matches input with HealthState value Warning. The value is 4. 13194// - Error - Filter that matches input with HealthState value Error. The value is 8. 13195// - All - Filter that matches input with any HealthState value. The value is 65535. 13196// excludeHealthStatistics - indicates whether the health statistics should be returned as part of the query 13197// result. False by default. 13198// The statistics show the number of children entities in health state Ok, Warning, and Error. 13199// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 13200// duration that the client is willing to wait for the requested operation to complete. The default value for 13201// this parameter is 60 seconds. 13202func (client BaseClient) GetServiceHealth(ctx context.Context, serviceID string, eventsHealthStateFilter *int32, partitionsHealthStateFilter *int32, excludeHealthStatistics *bool, timeout *int64) (result ServiceHealth, err error) { 13203 if tracing.IsEnabled() { 13204 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetServiceHealth") 13205 defer func() { 13206 sc := -1 13207 if result.Response.Response != nil { 13208 sc = result.Response.Response.StatusCode 13209 } 13210 tracing.EndSpan(ctx, sc, err) 13211 }() 13212 } 13213 if err := validation.Validate([]validation.Validation{ 13214 {TargetValue: timeout, 13215 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 13216 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 13217 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 13218 }}}}}); err != nil { 13219 return result, validation.NewError("servicefabric.BaseClient", "GetServiceHealth", err.Error()) 13220 } 13221 13222 req, err := client.GetServiceHealthPreparer(ctx, serviceID, eventsHealthStateFilter, partitionsHealthStateFilter, excludeHealthStatistics, timeout) 13223 if err != nil { 13224 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceHealth", nil, "Failure preparing request") 13225 return 13226 } 13227 13228 resp, err := client.GetServiceHealthSender(req) 13229 if err != nil { 13230 result.Response = autorest.Response{Response: resp} 13231 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceHealth", resp, "Failure sending request") 13232 return 13233 } 13234 13235 result, err = client.GetServiceHealthResponder(resp) 13236 if err != nil { 13237 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceHealth", resp, "Failure responding to request") 13238 return 13239 } 13240 13241 return 13242} 13243 13244// GetServiceHealthPreparer prepares the GetServiceHealth request. 13245func (client BaseClient) GetServiceHealthPreparer(ctx context.Context, serviceID string, eventsHealthStateFilter *int32, partitionsHealthStateFilter *int32, excludeHealthStatistics *bool, timeout *int64) (*http.Request, error) { 13246 pathParameters := map[string]interface{}{ 13247 "serviceId": serviceID, 13248 } 13249 13250 const APIVersion = "6.0" 13251 queryParameters := map[string]interface{}{ 13252 "api-version": APIVersion, 13253 } 13254 if eventsHealthStateFilter != nil { 13255 queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", *eventsHealthStateFilter) 13256 } else { 13257 queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", 0) 13258 } 13259 if partitionsHealthStateFilter != nil { 13260 queryParameters["PartitionsHealthStateFilter"] = autorest.Encode("query", *partitionsHealthStateFilter) 13261 } else { 13262 queryParameters["PartitionsHealthStateFilter"] = autorest.Encode("query", 0) 13263 } 13264 if excludeHealthStatistics != nil { 13265 queryParameters["ExcludeHealthStatistics"] = autorest.Encode("query", *excludeHealthStatistics) 13266 } else { 13267 queryParameters["ExcludeHealthStatistics"] = autorest.Encode("query", false) 13268 } 13269 if timeout != nil { 13270 queryParameters["timeout"] = autorest.Encode("query", *timeout) 13271 } else { 13272 queryParameters["timeout"] = autorest.Encode("query", 60) 13273 } 13274 13275 preparer := autorest.CreatePreparer( 13276 autorest.AsGet(), 13277 autorest.WithBaseURL(client.BaseURI), 13278 autorest.WithPathParameters("/Services/{serviceId}/$/GetHealth", pathParameters), 13279 autorest.WithQueryParameters(queryParameters)) 13280 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 13281} 13282 13283// GetServiceHealthSender sends the GetServiceHealth request. The method will close the 13284// http.Response Body if it receives an error. 13285func (client BaseClient) GetServiceHealthSender(req *http.Request) (*http.Response, error) { 13286 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 13287} 13288 13289// GetServiceHealthResponder handles the response to the GetServiceHealth request. The method always 13290// closes the http.Response Body. 13291func (client BaseClient) GetServiceHealthResponder(resp *http.Response) (result ServiceHealth, err error) { 13292 err = autorest.Respond( 13293 resp, 13294 azure.WithErrorUnlessStatusCode(http.StatusOK), 13295 autorest.ByUnmarshallingJSON(&result), 13296 autorest.ByClosing()) 13297 result.Response = autorest.Response{Response: resp} 13298 return 13299} 13300 13301// GetServiceHealthUsingPolicy gets the health information of the specified service. 13302// If the application health policy is specified, the health evaluation uses it to get the aggregated health state. 13303// If the policy is not specified, the health evaluation uses the application health policy defined in the application 13304// manifest, or the default health policy, if no policy is defined in the manifest. 13305// Use EventsHealthStateFilter to filter the collection of health events reported on the service based on the health 13306// state. 13307// Use PartitionsHealthStateFilter to filter the collection of partitions returned. 13308// If you specify a service that does not exist in the health store, this request returns an error. 13309// Parameters: 13310// serviceID - the identity of the service. This ID is typically the full name of the service without the 13311// 'fabric:' URI scheme. 13312// Starting from version 6.0, hierarchical names are delimited with the "~" character. 13313// For example, if the service name is "fabric:/myapp/app1/svc1", the service identity would be 13314// "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in previous versions. 13315// eventsHealthStateFilter - allows filtering the collection of HealthEvent objects returned based on health 13316// state. 13317// The possible values for this parameter include integer value of one of the following health states. 13318// Only events that match the filter are returned. All events are used to evaluate the aggregated health state. 13319// If not specified, all entries are returned. The state values are flag-based enumeration, so the value could 13320// be a combination of these values, obtained using the bitwise 'OR' operator. For example, If the provided 13321// value is 6 then all of the events with HealthState value of OK (2) and Warning (4) are returned. 13322// 13323// - Default - Default value. Matches any HealthState. The value is zero. 13324// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given 13325// collection of states. The value is 1. 13326// - Ok - Filter that matches input with HealthState value Ok. The value is 2. 13327// - Warning - Filter that matches input with HealthState value Warning. The value is 4. 13328// - Error - Filter that matches input with HealthState value Error. The value is 8. 13329// - All - Filter that matches input with any HealthState value. The value is 65535. 13330// partitionsHealthStateFilter - allows filtering of the partitions health state objects returned in the result 13331// of service health query based on their health state. 13332// The possible values for this parameter include integer value of one of the following health states. 13333// Only partitions that match the filter are returned. All partitions are used to evaluate the aggregated 13334// health state. 13335// If not specified, all entries are returned. The state values are flag-based enumeration, so the value could 13336// be a combination of these value 13337// obtained using bitwise 'OR' operator. For example, if the provided value is 6 then health state of 13338// partitions with HealthState value of OK (2) and Warning (4) will be returned. 13339// 13340// - Default - Default value. Matches any HealthState. The value is zero. 13341// - None - Filter that doesn't match any HealthState value. Used in order to return no results on a given 13342// collection of states. The value is 1. 13343// - Ok - Filter that matches input with HealthState value Ok. The value is 2. 13344// - Warning - Filter that matches input with HealthState value Warning. The value is 4. 13345// - Error - Filter that matches input with HealthState value Error. The value is 8. 13346// - All - Filter that matches input with any HealthState value. The value is 65535. 13347// applicationHealthPolicy - describes the health policies used to evaluate the health of an application or one 13348// of its children. 13349// If not present, the health evaluation uses the health policy from application manifest or the default health 13350// policy. 13351// excludeHealthStatistics - indicates whether the health statistics should be returned as part of the query 13352// result. False by default. 13353// The statistics show the number of children entities in health state Ok, Warning, and Error. 13354// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 13355// duration that the client is willing to wait for the requested operation to complete. The default value for 13356// this parameter is 60 seconds. 13357func (client BaseClient) GetServiceHealthUsingPolicy(ctx context.Context, serviceID string, eventsHealthStateFilter *int32, partitionsHealthStateFilter *int32, applicationHealthPolicy *ApplicationHealthPolicy, excludeHealthStatistics *bool, timeout *int64) (result ServiceHealth, err error) { 13358 if tracing.IsEnabled() { 13359 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetServiceHealthUsingPolicy") 13360 defer func() { 13361 sc := -1 13362 if result.Response.Response != nil { 13363 sc = result.Response.Response.StatusCode 13364 } 13365 tracing.EndSpan(ctx, sc, err) 13366 }() 13367 } 13368 if err := validation.Validate([]validation.Validation{ 13369 {TargetValue: timeout, 13370 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 13371 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 13372 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 13373 }}}}}); err != nil { 13374 return result, validation.NewError("servicefabric.BaseClient", "GetServiceHealthUsingPolicy", err.Error()) 13375 } 13376 13377 req, err := client.GetServiceHealthUsingPolicyPreparer(ctx, serviceID, eventsHealthStateFilter, partitionsHealthStateFilter, applicationHealthPolicy, excludeHealthStatistics, timeout) 13378 if err != nil { 13379 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceHealthUsingPolicy", nil, "Failure preparing request") 13380 return 13381 } 13382 13383 resp, err := client.GetServiceHealthUsingPolicySender(req) 13384 if err != nil { 13385 result.Response = autorest.Response{Response: resp} 13386 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceHealthUsingPolicy", resp, "Failure sending request") 13387 return 13388 } 13389 13390 result, err = client.GetServiceHealthUsingPolicyResponder(resp) 13391 if err != nil { 13392 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceHealthUsingPolicy", resp, "Failure responding to request") 13393 return 13394 } 13395 13396 return 13397} 13398 13399// GetServiceHealthUsingPolicyPreparer prepares the GetServiceHealthUsingPolicy request. 13400func (client BaseClient) GetServiceHealthUsingPolicyPreparer(ctx context.Context, serviceID string, eventsHealthStateFilter *int32, partitionsHealthStateFilter *int32, applicationHealthPolicy *ApplicationHealthPolicy, excludeHealthStatistics *bool, timeout *int64) (*http.Request, error) { 13401 pathParameters := map[string]interface{}{ 13402 "serviceId": serviceID, 13403 } 13404 13405 const APIVersion = "6.0" 13406 queryParameters := map[string]interface{}{ 13407 "api-version": APIVersion, 13408 } 13409 if eventsHealthStateFilter != nil { 13410 queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", *eventsHealthStateFilter) 13411 } else { 13412 queryParameters["EventsHealthStateFilter"] = autorest.Encode("query", 0) 13413 } 13414 if partitionsHealthStateFilter != nil { 13415 queryParameters["PartitionsHealthStateFilter"] = autorest.Encode("query", *partitionsHealthStateFilter) 13416 } else { 13417 queryParameters["PartitionsHealthStateFilter"] = autorest.Encode("query", 0) 13418 } 13419 if excludeHealthStatistics != nil { 13420 queryParameters["ExcludeHealthStatistics"] = autorest.Encode("query", *excludeHealthStatistics) 13421 } else { 13422 queryParameters["ExcludeHealthStatistics"] = autorest.Encode("query", false) 13423 } 13424 if timeout != nil { 13425 queryParameters["timeout"] = autorest.Encode("query", *timeout) 13426 } else { 13427 queryParameters["timeout"] = autorest.Encode("query", 60) 13428 } 13429 13430 preparer := autorest.CreatePreparer( 13431 autorest.AsContentType("application/json; charset=utf-8"), 13432 autorest.AsPost(), 13433 autorest.WithBaseURL(client.BaseURI), 13434 autorest.WithPathParameters("/Services/{serviceId}/$/GetHealth", pathParameters), 13435 autorest.WithQueryParameters(queryParameters)) 13436 if applicationHealthPolicy != nil { 13437 preparer = autorest.DecoratePreparer(preparer, 13438 autorest.WithJSON(applicationHealthPolicy)) 13439 } 13440 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 13441} 13442 13443// GetServiceHealthUsingPolicySender sends the GetServiceHealthUsingPolicy request. The method will close the 13444// http.Response Body if it receives an error. 13445func (client BaseClient) GetServiceHealthUsingPolicySender(req *http.Request) (*http.Response, error) { 13446 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 13447} 13448 13449// GetServiceHealthUsingPolicyResponder handles the response to the GetServiceHealthUsingPolicy request. The method always 13450// closes the http.Response Body. 13451func (client BaseClient) GetServiceHealthUsingPolicyResponder(resp *http.Response) (result ServiceHealth, err error) { 13452 err = autorest.Respond( 13453 resp, 13454 azure.WithErrorUnlessStatusCode(http.StatusOK), 13455 autorest.ByUnmarshallingJSON(&result), 13456 autorest.ByClosing()) 13457 result.Response = autorest.Response{Response: resp} 13458 return 13459} 13460 13461// GetServiceInfo returns the information about the specified service belonging to the specified Service Fabric 13462// application. 13463// Parameters: 13464// applicationID - the identity of the application. This is typically the full name of the application without 13465// the 'fabric:' URI scheme. 13466// Starting from version 6.0, hierarchical names are delimited with the "~" character. 13467// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" 13468// in 6.0+ and "myapp/app1" in previous versions. 13469// serviceID - the identity of the service. This ID is typically the full name of the service without the 13470// 'fabric:' URI scheme. 13471// Starting from version 6.0, hierarchical names are delimited with the "~" character. 13472// For example, if the service name is "fabric:/myapp/app1/svc1", the service identity would be 13473// "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in previous versions. 13474// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 13475// duration that the client is willing to wait for the requested operation to complete. The default value for 13476// this parameter is 60 seconds. 13477func (client BaseClient) GetServiceInfo(ctx context.Context, applicationID string, serviceID string, timeout *int64) (result ServiceInfoModel, err error) { 13478 if tracing.IsEnabled() { 13479 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetServiceInfo") 13480 defer func() { 13481 sc := -1 13482 if result.Response.Response != nil { 13483 sc = result.Response.Response.StatusCode 13484 } 13485 tracing.EndSpan(ctx, sc, err) 13486 }() 13487 } 13488 if err := validation.Validate([]validation.Validation{ 13489 {TargetValue: timeout, 13490 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 13491 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 13492 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 13493 }}}}}); err != nil { 13494 return result, validation.NewError("servicefabric.BaseClient", "GetServiceInfo", err.Error()) 13495 } 13496 13497 req, err := client.GetServiceInfoPreparer(ctx, applicationID, serviceID, timeout) 13498 if err != nil { 13499 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceInfo", nil, "Failure preparing request") 13500 return 13501 } 13502 13503 resp, err := client.GetServiceInfoSender(req) 13504 if err != nil { 13505 result.Response = autorest.Response{Response: resp} 13506 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceInfo", resp, "Failure sending request") 13507 return 13508 } 13509 13510 result, err = client.GetServiceInfoResponder(resp) 13511 if err != nil { 13512 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceInfo", resp, "Failure responding to request") 13513 return 13514 } 13515 13516 return 13517} 13518 13519// GetServiceInfoPreparer prepares the GetServiceInfo request. 13520func (client BaseClient) GetServiceInfoPreparer(ctx context.Context, applicationID string, serviceID string, timeout *int64) (*http.Request, error) { 13521 pathParameters := map[string]interface{}{ 13522 "applicationId": applicationID, 13523 "serviceId": serviceID, 13524 } 13525 13526 const APIVersion = "6.0" 13527 queryParameters := map[string]interface{}{ 13528 "api-version": APIVersion, 13529 } 13530 if timeout != nil { 13531 queryParameters["timeout"] = autorest.Encode("query", *timeout) 13532 } else { 13533 queryParameters["timeout"] = autorest.Encode("query", 60) 13534 } 13535 13536 preparer := autorest.CreatePreparer( 13537 autorest.AsGet(), 13538 autorest.WithBaseURL(client.BaseURI), 13539 autorest.WithPathParameters("/Applications/{applicationId}/$/GetServices/{serviceId}", pathParameters), 13540 autorest.WithQueryParameters(queryParameters)) 13541 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 13542} 13543 13544// GetServiceInfoSender sends the GetServiceInfo request. The method will close the 13545// http.Response Body if it receives an error. 13546func (client BaseClient) GetServiceInfoSender(req *http.Request) (*http.Response, error) { 13547 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 13548} 13549 13550// GetServiceInfoResponder handles the response to the GetServiceInfo request. The method always 13551// closes the http.Response Body. 13552func (client BaseClient) GetServiceInfoResponder(resp *http.Response) (result ServiceInfoModel, err error) { 13553 err = autorest.Respond( 13554 resp, 13555 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), 13556 autorest.ByUnmarshallingJSON(&result), 13557 autorest.ByClosing()) 13558 result.Response = autorest.Response{Response: resp} 13559 return 13560} 13561 13562// GetServiceInfoList returns the information about all services belonging to the application specified by the 13563// application ID. 13564// Parameters: 13565// applicationID - the identity of the application. This is typically the full name of the application without 13566// the 'fabric:' URI scheme. 13567// Starting from version 6.0, hierarchical names are delimited with the "~" character. 13568// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" 13569// in 6.0+ and "myapp/app1" in previous versions. 13570// serviceTypeName - the service type name used to filter the services to query for. 13571// continuationToken - the continuation token parameter is used to obtain next set of results. A continuation 13572// token with a non-empty value is included in the response of the API when the results from the system do not 13573// fit in a single response. When this value is passed to the next API call, the API returns next set of 13574// results. If there are no further results, then the continuation token does not contain a value. The value of 13575// this parameter should not be URL encoded. 13576// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 13577// duration that the client is willing to wait for the requested operation to complete. The default value for 13578// this parameter is 60 seconds. 13579func (client BaseClient) GetServiceInfoList(ctx context.Context, applicationID string, serviceTypeName string, continuationToken string, timeout *int64) (result PagedServiceInfoList, err error) { 13580 if tracing.IsEnabled() { 13581 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetServiceInfoList") 13582 defer func() { 13583 sc := -1 13584 if result.Response.Response != nil { 13585 sc = result.Response.Response.StatusCode 13586 } 13587 tracing.EndSpan(ctx, sc, err) 13588 }() 13589 } 13590 if err := validation.Validate([]validation.Validation{ 13591 {TargetValue: timeout, 13592 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 13593 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 13594 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 13595 }}}}}); err != nil { 13596 return result, validation.NewError("servicefabric.BaseClient", "GetServiceInfoList", err.Error()) 13597 } 13598 13599 req, err := client.GetServiceInfoListPreparer(ctx, applicationID, serviceTypeName, continuationToken, timeout) 13600 if err != nil { 13601 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceInfoList", nil, "Failure preparing request") 13602 return 13603 } 13604 13605 resp, err := client.GetServiceInfoListSender(req) 13606 if err != nil { 13607 result.Response = autorest.Response{Response: resp} 13608 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceInfoList", resp, "Failure sending request") 13609 return 13610 } 13611 13612 result, err = client.GetServiceInfoListResponder(resp) 13613 if err != nil { 13614 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceInfoList", resp, "Failure responding to request") 13615 return 13616 } 13617 13618 return 13619} 13620 13621// GetServiceInfoListPreparer prepares the GetServiceInfoList request. 13622func (client BaseClient) GetServiceInfoListPreparer(ctx context.Context, applicationID string, serviceTypeName string, continuationToken string, timeout *int64) (*http.Request, error) { 13623 pathParameters := map[string]interface{}{ 13624 "applicationId": applicationID, 13625 } 13626 13627 const APIVersion = "6.0" 13628 queryParameters := map[string]interface{}{ 13629 "api-version": APIVersion, 13630 } 13631 if len(serviceTypeName) > 0 { 13632 queryParameters["ServiceTypeName"] = autorest.Encode("query", serviceTypeName) 13633 } 13634 if len(continuationToken) > 0 { 13635 queryParameters["ContinuationToken"] = continuationToken 13636 } 13637 if timeout != nil { 13638 queryParameters["timeout"] = autorest.Encode("query", *timeout) 13639 } else { 13640 queryParameters["timeout"] = autorest.Encode("query", 60) 13641 } 13642 13643 preparer := autorest.CreatePreparer( 13644 autorest.AsGet(), 13645 autorest.WithBaseURL(client.BaseURI), 13646 autorest.WithPathParameters("/Applications/{applicationId}/$/GetServices", pathParameters), 13647 autorest.WithQueryParameters(queryParameters)) 13648 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 13649} 13650 13651// GetServiceInfoListSender sends the GetServiceInfoList request. The method will close the 13652// http.Response Body if it receives an error. 13653func (client BaseClient) GetServiceInfoListSender(req *http.Request) (*http.Response, error) { 13654 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 13655} 13656 13657// GetServiceInfoListResponder handles the response to the GetServiceInfoList request. The method always 13658// closes the http.Response Body. 13659func (client BaseClient) GetServiceInfoListResponder(resp *http.Response) (result PagedServiceInfoList, err error) { 13660 err = autorest.Respond( 13661 resp, 13662 azure.WithErrorUnlessStatusCode(http.StatusOK), 13663 autorest.ByUnmarshallingJSON(&result), 13664 autorest.ByClosing()) 13665 result.Response = autorest.Response{Response: resp} 13666 return 13667} 13668 13669// GetServiceManifest gets the manifest describing a service type. The response contains the service manifest XML as a 13670// string. 13671// Parameters: 13672// applicationTypeName - the name of the application type. 13673// applicationTypeVersion - the version of the application type. 13674// serviceManifestName - the name of a service manifest registered as part of an application type in a Service 13675// Fabric cluster. 13676// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 13677// duration that the client is willing to wait for the requested operation to complete. The default value for 13678// this parameter is 60 seconds. 13679func (client BaseClient) GetServiceManifest(ctx context.Context, applicationTypeName string, applicationTypeVersion string, serviceManifestName string, timeout *int64) (result ServiceTypeManifest, err error) { 13680 if tracing.IsEnabled() { 13681 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetServiceManifest") 13682 defer func() { 13683 sc := -1 13684 if result.Response.Response != nil { 13685 sc = result.Response.Response.StatusCode 13686 } 13687 tracing.EndSpan(ctx, sc, err) 13688 }() 13689 } 13690 if err := validation.Validate([]validation.Validation{ 13691 {TargetValue: timeout, 13692 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 13693 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 13694 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 13695 }}}}}); err != nil { 13696 return result, validation.NewError("servicefabric.BaseClient", "GetServiceManifest", err.Error()) 13697 } 13698 13699 req, err := client.GetServiceManifestPreparer(ctx, applicationTypeName, applicationTypeVersion, serviceManifestName, timeout) 13700 if err != nil { 13701 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceManifest", nil, "Failure preparing request") 13702 return 13703 } 13704 13705 resp, err := client.GetServiceManifestSender(req) 13706 if err != nil { 13707 result.Response = autorest.Response{Response: resp} 13708 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceManifest", resp, "Failure sending request") 13709 return 13710 } 13711 13712 result, err = client.GetServiceManifestResponder(resp) 13713 if err != nil { 13714 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceManifest", resp, "Failure responding to request") 13715 return 13716 } 13717 13718 return 13719} 13720 13721// GetServiceManifestPreparer prepares the GetServiceManifest request. 13722func (client BaseClient) GetServiceManifestPreparer(ctx context.Context, applicationTypeName string, applicationTypeVersion string, serviceManifestName string, timeout *int64) (*http.Request, error) { 13723 pathParameters := map[string]interface{}{ 13724 "applicationTypeName": autorest.Encode("path", applicationTypeName), 13725 } 13726 13727 const APIVersion = "6.0" 13728 queryParameters := map[string]interface{}{ 13729 "api-version": APIVersion, 13730 "ApplicationTypeVersion": autorest.Encode("query", applicationTypeVersion), 13731 "ServiceManifestName": autorest.Encode("query", serviceManifestName), 13732 } 13733 if timeout != nil { 13734 queryParameters["timeout"] = autorest.Encode("query", *timeout) 13735 } else { 13736 queryParameters["timeout"] = autorest.Encode("query", 60) 13737 } 13738 13739 preparer := autorest.CreatePreparer( 13740 autorest.AsGet(), 13741 autorest.WithBaseURL(client.BaseURI), 13742 autorest.WithPathParameters("/ApplicationTypes/{applicationTypeName}/$/GetServiceManifest", pathParameters), 13743 autorest.WithQueryParameters(queryParameters)) 13744 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 13745} 13746 13747// GetServiceManifestSender sends the GetServiceManifest request. The method will close the 13748// http.Response Body if it receives an error. 13749func (client BaseClient) GetServiceManifestSender(req *http.Request) (*http.Response, error) { 13750 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 13751} 13752 13753// GetServiceManifestResponder handles the response to the GetServiceManifest request. The method always 13754// closes the http.Response Body. 13755func (client BaseClient) GetServiceManifestResponder(resp *http.Response) (result ServiceTypeManifest, err error) { 13756 err = autorest.Respond( 13757 resp, 13758 azure.WithErrorUnlessStatusCode(http.StatusOK), 13759 autorest.ByUnmarshallingJSON(&result), 13760 autorest.ByClosing()) 13761 result.Response = autorest.Response{Response: resp} 13762 return 13763} 13764 13765// GetServiceNameInfo gets name of the service for the specified partition. A 404 error is returned if the partition ID 13766// does not exist in the cluster. 13767// Parameters: 13768// partitionID - the identity of the partition. 13769// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 13770// duration that the client is willing to wait for the requested operation to complete. The default value for 13771// this parameter is 60 seconds. 13772func (client BaseClient) GetServiceNameInfo(ctx context.Context, partitionID uuid.UUID, timeout *int64) (result ServiceNameInfo, err error) { 13773 if tracing.IsEnabled() { 13774 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetServiceNameInfo") 13775 defer func() { 13776 sc := -1 13777 if result.Response.Response != nil { 13778 sc = result.Response.Response.StatusCode 13779 } 13780 tracing.EndSpan(ctx, sc, err) 13781 }() 13782 } 13783 if err := validation.Validate([]validation.Validation{ 13784 {TargetValue: timeout, 13785 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 13786 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 13787 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 13788 }}}}}); err != nil { 13789 return result, validation.NewError("servicefabric.BaseClient", "GetServiceNameInfo", err.Error()) 13790 } 13791 13792 req, err := client.GetServiceNameInfoPreparer(ctx, partitionID, timeout) 13793 if err != nil { 13794 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceNameInfo", nil, "Failure preparing request") 13795 return 13796 } 13797 13798 resp, err := client.GetServiceNameInfoSender(req) 13799 if err != nil { 13800 result.Response = autorest.Response{Response: resp} 13801 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceNameInfo", resp, "Failure sending request") 13802 return 13803 } 13804 13805 result, err = client.GetServiceNameInfoResponder(resp) 13806 if err != nil { 13807 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceNameInfo", resp, "Failure responding to request") 13808 return 13809 } 13810 13811 return 13812} 13813 13814// GetServiceNameInfoPreparer prepares the GetServiceNameInfo request. 13815func (client BaseClient) GetServiceNameInfoPreparer(ctx context.Context, partitionID uuid.UUID, timeout *int64) (*http.Request, error) { 13816 pathParameters := map[string]interface{}{ 13817 "partitionId": partitionID, 13818 } 13819 13820 const APIVersion = "6.0" 13821 queryParameters := map[string]interface{}{ 13822 "api-version": APIVersion, 13823 } 13824 if timeout != nil { 13825 queryParameters["timeout"] = autorest.Encode("query", *timeout) 13826 } else { 13827 queryParameters["timeout"] = autorest.Encode("query", 60) 13828 } 13829 13830 preparer := autorest.CreatePreparer( 13831 autorest.AsGet(), 13832 autorest.WithBaseURL(client.BaseURI), 13833 autorest.WithPathParameters("/Partitions/{partitionId}/$/GetServiceName", pathParameters), 13834 autorest.WithQueryParameters(queryParameters)) 13835 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 13836} 13837 13838// GetServiceNameInfoSender sends the GetServiceNameInfo request. The method will close the 13839// http.Response Body if it receives an error. 13840func (client BaseClient) GetServiceNameInfoSender(req *http.Request) (*http.Response, error) { 13841 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 13842} 13843 13844// GetServiceNameInfoResponder handles the response to the GetServiceNameInfo request. The method always 13845// closes the http.Response Body. 13846func (client BaseClient) GetServiceNameInfoResponder(resp *http.Response) (result ServiceNameInfo, err error) { 13847 err = autorest.Respond( 13848 resp, 13849 azure.WithErrorUnlessStatusCode(http.StatusOK), 13850 autorest.ByUnmarshallingJSON(&result), 13851 autorest.ByClosing()) 13852 result.Response = autorest.Response{Response: resp} 13853 return 13854} 13855 13856// GetServicesEventList the response is list of ServiceEvent objects. 13857// Parameters: 13858// startTimeUtc - the start time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. 13859// endTimeUtc - the end time of a lookup query in ISO UTC yyyy-MM-ddTHH:mm:ssZ. 13860// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 13861// duration that the client is willing to wait for the requested operation to complete. The default value for 13862// this parameter is 60 seconds. 13863// eventsTypesFilter - this is a comma separated string specifying the types of FabricEvents that should only 13864// be included in the response. 13865// excludeAnalysisEvents - this param disables the retrieval of AnalysisEvents if true is passed. 13866// skipCorrelationLookup - this param disables the search of CorrelatedEvents information if true is passed. 13867// otherwise the CorrelationEvents get processed and HasCorrelatedEvents field in every FabricEvent gets 13868// populated. 13869func (client BaseClient) GetServicesEventList(ctx context.Context, startTimeUtc string, endTimeUtc string, timeout *int64, eventsTypesFilter string, excludeAnalysisEvents *bool, skipCorrelationLookup *bool) (result ListServiceEvent, err error) { 13870 if tracing.IsEnabled() { 13871 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetServicesEventList") 13872 defer func() { 13873 sc := -1 13874 if result.Response.Response != nil { 13875 sc = result.Response.Response.StatusCode 13876 } 13877 tracing.EndSpan(ctx, sc, err) 13878 }() 13879 } 13880 if err := validation.Validate([]validation.Validation{ 13881 {TargetValue: timeout, 13882 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 13883 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 13884 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 13885 }}}}}); err != nil { 13886 return result, validation.NewError("servicefabric.BaseClient", "GetServicesEventList", err.Error()) 13887 } 13888 13889 req, err := client.GetServicesEventListPreparer(ctx, startTimeUtc, endTimeUtc, timeout, eventsTypesFilter, excludeAnalysisEvents, skipCorrelationLookup) 13890 if err != nil { 13891 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServicesEventList", nil, "Failure preparing request") 13892 return 13893 } 13894 13895 resp, err := client.GetServicesEventListSender(req) 13896 if err != nil { 13897 result.Response = autorest.Response{Response: resp} 13898 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServicesEventList", resp, "Failure sending request") 13899 return 13900 } 13901 13902 result, err = client.GetServicesEventListResponder(resp) 13903 if err != nil { 13904 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServicesEventList", resp, "Failure responding to request") 13905 return 13906 } 13907 13908 return 13909} 13910 13911// GetServicesEventListPreparer prepares the GetServicesEventList request. 13912func (client BaseClient) GetServicesEventListPreparer(ctx context.Context, startTimeUtc string, endTimeUtc string, timeout *int64, eventsTypesFilter string, excludeAnalysisEvents *bool, skipCorrelationLookup *bool) (*http.Request, error) { 13913 const APIVersion = "6.4" 13914 queryParameters := map[string]interface{}{ 13915 "api-version": APIVersion, 13916 "EndTimeUtc": autorest.Encode("query", endTimeUtc), 13917 "StartTimeUtc": autorest.Encode("query", startTimeUtc), 13918 } 13919 if timeout != nil { 13920 queryParameters["timeout"] = autorest.Encode("query", *timeout) 13921 } else { 13922 queryParameters["timeout"] = autorest.Encode("query", 60) 13923 } 13924 if len(eventsTypesFilter) > 0 { 13925 queryParameters["EventsTypesFilter"] = autorest.Encode("query", eventsTypesFilter) 13926 } 13927 if excludeAnalysisEvents != nil { 13928 queryParameters["ExcludeAnalysisEvents"] = autorest.Encode("query", *excludeAnalysisEvents) 13929 } 13930 if skipCorrelationLookup != nil { 13931 queryParameters["SkipCorrelationLookup"] = autorest.Encode("query", *skipCorrelationLookup) 13932 } 13933 13934 preparer := autorest.CreatePreparer( 13935 autorest.AsGet(), 13936 autorest.WithBaseURL(client.BaseURI), 13937 autorest.WithPath("/EventsStore/Services/Events"), 13938 autorest.WithQueryParameters(queryParameters)) 13939 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 13940} 13941 13942// GetServicesEventListSender sends the GetServicesEventList request. The method will close the 13943// http.Response Body if it receives an error. 13944func (client BaseClient) GetServicesEventListSender(req *http.Request) (*http.Response, error) { 13945 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 13946} 13947 13948// GetServicesEventListResponder handles the response to the GetServicesEventList request. The method always 13949// closes the http.Response Body. 13950func (client BaseClient) GetServicesEventListResponder(resp *http.Response) (result ListServiceEvent, err error) { 13951 err = autorest.Respond( 13952 resp, 13953 azure.WithErrorUnlessStatusCode(http.StatusOK), 13954 autorest.ByUnmarshallingJSON(&result), 13955 autorest.ByClosing()) 13956 result.Response = autorest.Response{Response: resp} 13957 return 13958} 13959 13960// GetServiceTypeInfoByName gets the information about a specific service type that is supported by a provisioned 13961// application type in a Service Fabric cluster. The provided application type must exist. Otherwise, a 404 status is 13962// returned. A 204 response is returned if the specified service type is not found in the cluster. 13963// Parameters: 13964// applicationTypeName - the name of the application type. 13965// applicationTypeVersion - the version of the application type. 13966// serviceTypeName - specifies the name of a Service Fabric service type. 13967// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 13968// duration that the client is willing to wait for the requested operation to complete. The default value for 13969// this parameter is 60 seconds. 13970func (client BaseClient) GetServiceTypeInfoByName(ctx context.Context, applicationTypeName string, applicationTypeVersion string, serviceTypeName string, timeout *int64) (result ServiceTypeInfo, err error) { 13971 if tracing.IsEnabled() { 13972 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetServiceTypeInfoByName") 13973 defer func() { 13974 sc := -1 13975 if result.Response.Response != nil { 13976 sc = result.Response.Response.StatusCode 13977 } 13978 tracing.EndSpan(ctx, sc, err) 13979 }() 13980 } 13981 if err := validation.Validate([]validation.Validation{ 13982 {TargetValue: timeout, 13983 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 13984 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 13985 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 13986 }}}}}); err != nil { 13987 return result, validation.NewError("servicefabric.BaseClient", "GetServiceTypeInfoByName", err.Error()) 13988 } 13989 13990 req, err := client.GetServiceTypeInfoByNamePreparer(ctx, applicationTypeName, applicationTypeVersion, serviceTypeName, timeout) 13991 if err != nil { 13992 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceTypeInfoByName", nil, "Failure preparing request") 13993 return 13994 } 13995 13996 resp, err := client.GetServiceTypeInfoByNameSender(req) 13997 if err != nil { 13998 result.Response = autorest.Response{Response: resp} 13999 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceTypeInfoByName", resp, "Failure sending request") 14000 return 14001 } 14002 14003 result, err = client.GetServiceTypeInfoByNameResponder(resp) 14004 if err != nil { 14005 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceTypeInfoByName", resp, "Failure responding to request") 14006 return 14007 } 14008 14009 return 14010} 14011 14012// GetServiceTypeInfoByNamePreparer prepares the GetServiceTypeInfoByName request. 14013func (client BaseClient) GetServiceTypeInfoByNamePreparer(ctx context.Context, applicationTypeName string, applicationTypeVersion string, serviceTypeName string, timeout *int64) (*http.Request, error) { 14014 pathParameters := map[string]interface{}{ 14015 "applicationTypeName": autorest.Encode("path", applicationTypeName), 14016 "serviceTypeName": serviceTypeName, 14017 } 14018 14019 const APIVersion = "6.0" 14020 queryParameters := map[string]interface{}{ 14021 "api-version": APIVersion, 14022 "ApplicationTypeVersion": autorest.Encode("query", applicationTypeVersion), 14023 } 14024 if timeout != nil { 14025 queryParameters["timeout"] = autorest.Encode("query", *timeout) 14026 } else { 14027 queryParameters["timeout"] = autorest.Encode("query", 60) 14028 } 14029 14030 preparer := autorest.CreatePreparer( 14031 autorest.AsGet(), 14032 autorest.WithBaseURL(client.BaseURI), 14033 autorest.WithPathParameters("/ApplicationTypes/{applicationTypeName}/$/GetServiceTypes/{serviceTypeName}", pathParameters), 14034 autorest.WithQueryParameters(queryParameters)) 14035 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 14036} 14037 14038// GetServiceTypeInfoByNameSender sends the GetServiceTypeInfoByName request. The method will close the 14039// http.Response Body if it receives an error. 14040func (client BaseClient) GetServiceTypeInfoByNameSender(req *http.Request) (*http.Response, error) { 14041 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 14042} 14043 14044// GetServiceTypeInfoByNameResponder handles the response to the GetServiceTypeInfoByName request. The method always 14045// closes the http.Response Body. 14046func (client BaseClient) GetServiceTypeInfoByNameResponder(resp *http.Response) (result ServiceTypeInfo, err error) { 14047 err = autorest.Respond( 14048 resp, 14049 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), 14050 autorest.ByUnmarshallingJSON(&result), 14051 autorest.ByClosing()) 14052 result.Response = autorest.Response{Response: resp} 14053 return 14054} 14055 14056// GetServiceTypeInfoList gets the list containing the information about service types that are supported by a 14057// provisioned application type in a Service Fabric cluster. The provided application type must exist. Otherwise, a 404 14058// status is returned. 14059// Parameters: 14060// applicationTypeName - the name of the application type. 14061// applicationTypeVersion - the version of the application type. 14062// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 14063// duration that the client is willing to wait for the requested operation to complete. The default value for 14064// this parameter is 60 seconds. 14065func (client BaseClient) GetServiceTypeInfoList(ctx context.Context, applicationTypeName string, applicationTypeVersion string, timeout *int64) (result ListServiceTypeInfo, err error) { 14066 if tracing.IsEnabled() { 14067 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetServiceTypeInfoList") 14068 defer func() { 14069 sc := -1 14070 if result.Response.Response != nil { 14071 sc = result.Response.Response.StatusCode 14072 } 14073 tracing.EndSpan(ctx, sc, err) 14074 }() 14075 } 14076 if err := validation.Validate([]validation.Validation{ 14077 {TargetValue: timeout, 14078 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 14079 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 14080 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 14081 }}}}}); err != nil { 14082 return result, validation.NewError("servicefabric.BaseClient", "GetServiceTypeInfoList", err.Error()) 14083 } 14084 14085 req, err := client.GetServiceTypeInfoListPreparer(ctx, applicationTypeName, applicationTypeVersion, timeout) 14086 if err != nil { 14087 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceTypeInfoList", nil, "Failure preparing request") 14088 return 14089 } 14090 14091 resp, err := client.GetServiceTypeInfoListSender(req) 14092 if err != nil { 14093 result.Response = autorest.Response{Response: resp} 14094 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceTypeInfoList", resp, "Failure sending request") 14095 return 14096 } 14097 14098 result, err = client.GetServiceTypeInfoListResponder(resp) 14099 if err != nil { 14100 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetServiceTypeInfoList", resp, "Failure responding to request") 14101 return 14102 } 14103 14104 return 14105} 14106 14107// GetServiceTypeInfoListPreparer prepares the GetServiceTypeInfoList request. 14108func (client BaseClient) GetServiceTypeInfoListPreparer(ctx context.Context, applicationTypeName string, applicationTypeVersion string, timeout *int64) (*http.Request, error) { 14109 pathParameters := map[string]interface{}{ 14110 "applicationTypeName": autorest.Encode("path", applicationTypeName), 14111 } 14112 14113 const APIVersion = "6.0" 14114 queryParameters := map[string]interface{}{ 14115 "api-version": APIVersion, 14116 "ApplicationTypeVersion": autorest.Encode("query", applicationTypeVersion), 14117 } 14118 if timeout != nil { 14119 queryParameters["timeout"] = autorest.Encode("query", *timeout) 14120 } else { 14121 queryParameters["timeout"] = autorest.Encode("query", 60) 14122 } 14123 14124 preparer := autorest.CreatePreparer( 14125 autorest.AsGet(), 14126 autorest.WithBaseURL(client.BaseURI), 14127 autorest.WithPathParameters("/ApplicationTypes/{applicationTypeName}/$/GetServiceTypes", pathParameters), 14128 autorest.WithQueryParameters(queryParameters)) 14129 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 14130} 14131 14132// GetServiceTypeInfoListSender sends the GetServiceTypeInfoList request. The method will close the 14133// http.Response Body if it receives an error. 14134func (client BaseClient) GetServiceTypeInfoListSender(req *http.Request) (*http.Response, error) { 14135 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 14136} 14137 14138// GetServiceTypeInfoListResponder handles the response to the GetServiceTypeInfoList request. The method always 14139// closes the http.Response Body. 14140func (client BaseClient) GetServiceTypeInfoListResponder(resp *http.Response) (result ListServiceTypeInfo, err error) { 14141 err = autorest.Respond( 14142 resp, 14143 azure.WithErrorUnlessStatusCode(http.StatusOK), 14144 autorest.ByUnmarshallingJSON(&result.Value), 14145 autorest.ByClosing()) 14146 result.Response = autorest.Response{Response: resp} 14147 return 14148} 14149 14150// GetSubNameInfoList enumerates all the Service Fabric names under a given name. If the subnames do not fit in a page, 14151// one page of results is returned as well as a continuation token, which can be used to get the next page. Querying a 14152// name that doesn't exist will fail. 14153// Parameters: 14154// nameID - the Service Fabric name, without the 'fabric:' URI scheme. 14155// recursive - allows specifying that the search performed should be recursive. 14156// continuationToken - the continuation token parameter is used to obtain next set of results. A continuation 14157// token with a non-empty value is included in the response of the API when the results from the system do not 14158// fit in a single response. When this value is passed to the next API call, the API returns next set of 14159// results. If there are no further results, then the continuation token does not contain a value. The value of 14160// this parameter should not be URL encoded. 14161// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 14162// duration that the client is willing to wait for the requested operation to complete. The default value for 14163// this parameter is 60 seconds. 14164func (client BaseClient) GetSubNameInfoList(ctx context.Context, nameID string, recursive *bool, continuationToken string, timeout *int64) (result PagedSubNameInfoList, err error) { 14165 if tracing.IsEnabled() { 14166 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetSubNameInfoList") 14167 defer func() { 14168 sc := -1 14169 if result.Response.Response != nil { 14170 sc = result.Response.Response.StatusCode 14171 } 14172 tracing.EndSpan(ctx, sc, err) 14173 }() 14174 } 14175 if err := validation.Validate([]validation.Validation{ 14176 {TargetValue: timeout, 14177 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 14178 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 14179 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 14180 }}}}}); err != nil { 14181 return result, validation.NewError("servicefabric.BaseClient", "GetSubNameInfoList", err.Error()) 14182 } 14183 14184 req, err := client.GetSubNameInfoListPreparer(ctx, nameID, recursive, continuationToken, timeout) 14185 if err != nil { 14186 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetSubNameInfoList", nil, "Failure preparing request") 14187 return 14188 } 14189 14190 resp, err := client.GetSubNameInfoListSender(req) 14191 if err != nil { 14192 result.Response = autorest.Response{Response: resp} 14193 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetSubNameInfoList", resp, "Failure sending request") 14194 return 14195 } 14196 14197 result, err = client.GetSubNameInfoListResponder(resp) 14198 if err != nil { 14199 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetSubNameInfoList", resp, "Failure responding to request") 14200 return 14201 } 14202 14203 return 14204} 14205 14206// GetSubNameInfoListPreparer prepares the GetSubNameInfoList request. 14207func (client BaseClient) GetSubNameInfoListPreparer(ctx context.Context, nameID string, recursive *bool, continuationToken string, timeout *int64) (*http.Request, error) { 14208 pathParameters := map[string]interface{}{ 14209 "nameId": nameID, 14210 } 14211 14212 const APIVersion = "6.0" 14213 queryParameters := map[string]interface{}{ 14214 "api-version": APIVersion, 14215 } 14216 if recursive != nil { 14217 queryParameters["Recursive"] = autorest.Encode("query", *recursive) 14218 } else { 14219 queryParameters["Recursive"] = autorest.Encode("query", false) 14220 } 14221 if len(continuationToken) > 0 { 14222 queryParameters["ContinuationToken"] = continuationToken 14223 } 14224 if timeout != nil { 14225 queryParameters["timeout"] = autorest.Encode("query", *timeout) 14226 } else { 14227 queryParameters["timeout"] = autorest.Encode("query", 60) 14228 } 14229 14230 preparer := autorest.CreatePreparer( 14231 autorest.AsGet(), 14232 autorest.WithBaseURL(client.BaseURI), 14233 autorest.WithPathParameters("/Names/{nameId}/$/GetSubNames", pathParameters), 14234 autorest.WithQueryParameters(queryParameters)) 14235 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 14236} 14237 14238// GetSubNameInfoListSender sends the GetSubNameInfoList request. The method will close the 14239// http.Response Body if it receives an error. 14240func (client BaseClient) GetSubNameInfoListSender(req *http.Request) (*http.Response, error) { 14241 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 14242} 14243 14244// GetSubNameInfoListResponder handles the response to the GetSubNameInfoList request. The method always 14245// closes the http.Response Body. 14246func (client BaseClient) GetSubNameInfoListResponder(resp *http.Response) (result PagedSubNameInfoList, err error) { 14247 err = autorest.Respond( 14248 resp, 14249 azure.WithErrorUnlessStatusCode(http.StatusOK), 14250 autorest.ByUnmarshallingJSON(&result), 14251 autorest.ByClosing()) 14252 result.Response = autorest.Response{Response: resp} 14253 return 14254} 14255 14256// GetUpgradeOrchestrationServiceState get the service state of Service Fabric Upgrade Orchestration Service. This API 14257// is internally used for support purposes. 14258// Parameters: 14259// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 14260// duration that the client is willing to wait for the requested operation to complete. The default value for 14261// this parameter is 60 seconds. 14262func (client BaseClient) GetUpgradeOrchestrationServiceState(ctx context.Context, timeout *int64) (result UpgradeOrchestrationServiceState, err error) { 14263 if tracing.IsEnabled() { 14264 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetUpgradeOrchestrationServiceState") 14265 defer func() { 14266 sc := -1 14267 if result.Response.Response != nil { 14268 sc = result.Response.Response.StatusCode 14269 } 14270 tracing.EndSpan(ctx, sc, err) 14271 }() 14272 } 14273 if err := validation.Validate([]validation.Validation{ 14274 {TargetValue: timeout, 14275 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 14276 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 14277 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 14278 }}}}}); err != nil { 14279 return result, validation.NewError("servicefabric.BaseClient", "GetUpgradeOrchestrationServiceState", err.Error()) 14280 } 14281 14282 req, err := client.GetUpgradeOrchestrationServiceStatePreparer(ctx, timeout) 14283 if err != nil { 14284 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetUpgradeOrchestrationServiceState", nil, "Failure preparing request") 14285 return 14286 } 14287 14288 resp, err := client.GetUpgradeOrchestrationServiceStateSender(req) 14289 if err != nil { 14290 result.Response = autorest.Response{Response: resp} 14291 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetUpgradeOrchestrationServiceState", resp, "Failure sending request") 14292 return 14293 } 14294 14295 result, err = client.GetUpgradeOrchestrationServiceStateResponder(resp) 14296 if err != nil { 14297 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "GetUpgradeOrchestrationServiceState", resp, "Failure responding to request") 14298 return 14299 } 14300 14301 return 14302} 14303 14304// GetUpgradeOrchestrationServiceStatePreparer prepares the GetUpgradeOrchestrationServiceState request. 14305func (client BaseClient) GetUpgradeOrchestrationServiceStatePreparer(ctx context.Context, timeout *int64) (*http.Request, error) { 14306 const APIVersion = "6.0" 14307 queryParameters := map[string]interface{}{ 14308 "api-version": APIVersion, 14309 } 14310 if timeout != nil { 14311 queryParameters["timeout"] = autorest.Encode("query", *timeout) 14312 } else { 14313 queryParameters["timeout"] = autorest.Encode("query", 60) 14314 } 14315 14316 preparer := autorest.CreatePreparer( 14317 autorest.AsGet(), 14318 autorest.WithBaseURL(client.BaseURI), 14319 autorest.WithPath("/$/GetUpgradeOrchestrationServiceState"), 14320 autorest.WithQueryParameters(queryParameters)) 14321 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 14322} 14323 14324// GetUpgradeOrchestrationServiceStateSender sends the GetUpgradeOrchestrationServiceState request. The method will close the 14325// http.Response Body if it receives an error. 14326func (client BaseClient) GetUpgradeOrchestrationServiceStateSender(req *http.Request) (*http.Response, error) { 14327 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 14328} 14329 14330// GetUpgradeOrchestrationServiceStateResponder handles the response to the GetUpgradeOrchestrationServiceState request. The method always 14331// closes the http.Response Body. 14332func (client BaseClient) GetUpgradeOrchestrationServiceStateResponder(resp *http.Response) (result UpgradeOrchestrationServiceState, err error) { 14333 err = autorest.Respond( 14334 resp, 14335 azure.WithErrorUnlessStatusCode(http.StatusOK), 14336 autorest.ByUnmarshallingJSON(&result), 14337 autorest.ByClosing()) 14338 result.Response = autorest.Response{Response: resp} 14339 return 14340} 14341 14342// InvokeContainerAPI invoke container API on a container deployed on a Service Fabric node for the given code package. 14343// Parameters: 14344// nodeName - the name of the node. 14345// applicationID - the identity of the application. This is typically the full name of the application without 14346// the 'fabric:' URI scheme. 14347// Starting from version 6.0, hierarchical names are delimited with the "~" character. 14348// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" 14349// in 6.0+ and "myapp/app1" in previous versions. 14350// serviceManifestName - the name of a service manifest registered as part of an application type in a Service 14351// Fabric cluster. 14352// codePackageName - the name of code package specified in service manifest registered as part of an 14353// application type in a Service Fabric cluster. 14354// codePackageInstanceID - ID that uniquely identifies a code package instance deployed on a service fabric 14355// node. 14356// containerAPIRequestBody - parameters for making container API call 14357// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 14358// duration that the client is willing to wait for the requested operation to complete. The default value for 14359// this parameter is 60 seconds. 14360func (client BaseClient) InvokeContainerAPI(ctx context.Context, nodeName string, applicationID string, serviceManifestName string, codePackageName string, codePackageInstanceID string, containerAPIRequestBody ContainerAPIRequestBody, timeout *int64) (result ContainerAPIResponse, err error) { 14361 if tracing.IsEnabled() { 14362 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.InvokeContainerAPI") 14363 defer func() { 14364 sc := -1 14365 if result.Response.Response != nil { 14366 sc = result.Response.Response.StatusCode 14367 } 14368 tracing.EndSpan(ctx, sc, err) 14369 }() 14370 } 14371 if err := validation.Validate([]validation.Validation{ 14372 {TargetValue: timeout, 14373 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 14374 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 14375 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 14376 }}}}, 14377 {TargetValue: containerAPIRequestBody, 14378 Constraints: []validation.Constraint{{Target: "containerAPIRequestBody.URIPath", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { 14379 return result, validation.NewError("servicefabric.BaseClient", "InvokeContainerAPI", err.Error()) 14380 } 14381 14382 req, err := client.InvokeContainerAPIPreparer(ctx, nodeName, applicationID, serviceManifestName, codePackageName, codePackageInstanceID, containerAPIRequestBody, timeout) 14383 if err != nil { 14384 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "InvokeContainerAPI", nil, "Failure preparing request") 14385 return 14386 } 14387 14388 resp, err := client.InvokeContainerAPISender(req) 14389 if err != nil { 14390 result.Response = autorest.Response{Response: resp} 14391 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "InvokeContainerAPI", resp, "Failure sending request") 14392 return 14393 } 14394 14395 result, err = client.InvokeContainerAPIResponder(resp) 14396 if err != nil { 14397 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "InvokeContainerAPI", resp, "Failure responding to request") 14398 return 14399 } 14400 14401 return 14402} 14403 14404// InvokeContainerAPIPreparer prepares the InvokeContainerAPI request. 14405func (client BaseClient) InvokeContainerAPIPreparer(ctx context.Context, nodeName string, applicationID string, serviceManifestName string, codePackageName string, codePackageInstanceID string, containerAPIRequestBody ContainerAPIRequestBody, timeout *int64) (*http.Request, error) { 14406 pathParameters := map[string]interface{}{ 14407 "applicationId": applicationID, 14408 "nodeName": autorest.Encode("path", nodeName), 14409 } 14410 14411 const APIVersion = "6.2" 14412 queryParameters := map[string]interface{}{ 14413 "api-version": APIVersion, 14414 "CodePackageInstanceId": autorest.Encode("query", codePackageInstanceID), 14415 "CodePackageName": autorest.Encode("query", codePackageName), 14416 "ServiceManifestName": autorest.Encode("query", serviceManifestName), 14417 } 14418 if timeout != nil { 14419 queryParameters["timeout"] = autorest.Encode("query", *timeout) 14420 } else { 14421 queryParameters["timeout"] = autorest.Encode("query", 60) 14422 } 14423 14424 preparer := autorest.CreatePreparer( 14425 autorest.AsContentType("application/json; charset=utf-8"), 14426 autorest.AsPost(), 14427 autorest.WithBaseURL(client.BaseURI), 14428 autorest.WithPathParameters("/Nodes/{nodeName}/$/GetApplications/{applicationId}/$/GetCodePackages/$/ContainerApi", pathParameters), 14429 autorest.WithJSON(containerAPIRequestBody), 14430 autorest.WithQueryParameters(queryParameters)) 14431 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 14432} 14433 14434// InvokeContainerAPISender sends the InvokeContainerAPI request. The method will close the 14435// http.Response Body if it receives an error. 14436func (client BaseClient) InvokeContainerAPISender(req *http.Request) (*http.Response, error) { 14437 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 14438} 14439 14440// InvokeContainerAPIResponder handles the response to the InvokeContainerAPI request. The method always 14441// closes the http.Response Body. 14442func (client BaseClient) InvokeContainerAPIResponder(resp *http.Response) (result ContainerAPIResponse, err error) { 14443 err = autorest.Respond( 14444 resp, 14445 azure.WithErrorUnlessStatusCode(http.StatusOK), 14446 autorest.ByUnmarshallingJSON(&result), 14447 autorest.ByClosing()) 14448 result.Response = autorest.Response{Response: resp} 14449 return 14450} 14451 14452// InvokeInfrastructureCommand for clusters that have one or more instances of the Infrastructure Service configured, 14453// this API provides a way to send infrastructure-specific commands to a particular 14454// instance of the Infrastructure Service. 14455// 14456// Available commands and their corresponding response formats vary depending upon 14457// the infrastructure on which the cluster is running. 14458// 14459// This API supports the Service Fabric platform; it is not meant to be used directly from your code. 14460// Parameters: 14461// command - the text of the command to be invoked. The content of the command is infrastructure-specific. 14462// serviceID - the identity of the infrastructure service. This is the full name of the infrastructure service 14463// without the 'fabric:' URI scheme. This parameter required only for the cluster that has more than one 14464// instance of infrastructure service running. 14465// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 14466// duration that the client is willing to wait for the requested operation to complete. The default value for 14467// this parameter is 60 seconds. 14468func (client BaseClient) InvokeInfrastructureCommand(ctx context.Context, command string, serviceID string, timeout *int64) (result String, err error) { 14469 if tracing.IsEnabled() { 14470 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.InvokeInfrastructureCommand") 14471 defer func() { 14472 sc := -1 14473 if result.Response.Response != nil { 14474 sc = result.Response.Response.StatusCode 14475 } 14476 tracing.EndSpan(ctx, sc, err) 14477 }() 14478 } 14479 if err := validation.Validate([]validation.Validation{ 14480 {TargetValue: timeout, 14481 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 14482 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 14483 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 14484 }}}}}); err != nil { 14485 return result, validation.NewError("servicefabric.BaseClient", "InvokeInfrastructureCommand", err.Error()) 14486 } 14487 14488 req, err := client.InvokeInfrastructureCommandPreparer(ctx, command, serviceID, timeout) 14489 if err != nil { 14490 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "InvokeInfrastructureCommand", nil, "Failure preparing request") 14491 return 14492 } 14493 14494 resp, err := client.InvokeInfrastructureCommandSender(req) 14495 if err != nil { 14496 result.Response = autorest.Response{Response: resp} 14497 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "InvokeInfrastructureCommand", resp, "Failure sending request") 14498 return 14499 } 14500 14501 result, err = client.InvokeInfrastructureCommandResponder(resp) 14502 if err != nil { 14503 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "InvokeInfrastructureCommand", resp, "Failure responding to request") 14504 return 14505 } 14506 14507 return 14508} 14509 14510// InvokeInfrastructureCommandPreparer prepares the InvokeInfrastructureCommand request. 14511func (client BaseClient) InvokeInfrastructureCommandPreparer(ctx context.Context, command string, serviceID string, timeout *int64) (*http.Request, error) { 14512 const APIVersion = "6.0" 14513 queryParameters := map[string]interface{}{ 14514 "api-version": APIVersion, 14515 "Command": autorest.Encode("query", command), 14516 } 14517 if len(serviceID) > 0 { 14518 queryParameters["ServiceId"] = autorest.Encode("query", serviceID) 14519 } 14520 if timeout != nil { 14521 queryParameters["timeout"] = autorest.Encode("query", *timeout) 14522 } else { 14523 queryParameters["timeout"] = autorest.Encode("query", 60) 14524 } 14525 14526 preparer := autorest.CreatePreparer( 14527 autorest.AsPost(), 14528 autorest.WithBaseURL(client.BaseURI), 14529 autorest.WithPath("/$/InvokeInfrastructureCommand"), 14530 autorest.WithQueryParameters(queryParameters)) 14531 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 14532} 14533 14534// InvokeInfrastructureCommandSender sends the InvokeInfrastructureCommand request. The method will close the 14535// http.Response Body if it receives an error. 14536func (client BaseClient) InvokeInfrastructureCommandSender(req *http.Request) (*http.Response, error) { 14537 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 14538} 14539 14540// InvokeInfrastructureCommandResponder handles the response to the InvokeInfrastructureCommand request. The method always 14541// closes the http.Response Body. 14542func (client BaseClient) InvokeInfrastructureCommandResponder(resp *http.Response) (result String, err error) { 14543 err = autorest.Respond( 14544 resp, 14545 azure.WithErrorUnlessStatusCode(http.StatusOK), 14546 autorest.ByUnmarshallingJSON(&result.Value), 14547 autorest.ByClosing()) 14548 result.Response = autorest.Response{Response: resp} 14549 return 14550} 14551 14552// InvokeInfrastructureQuery for clusters that have one or more instances of the Infrastructure Service configured, 14553// this API provides a way to send infrastructure-specific queries to a particular 14554// instance of the Infrastructure Service. 14555// 14556// Available commands and their corresponding response formats vary depending upon 14557// the infrastructure on which the cluster is running. 14558// 14559// This API supports the Service Fabric platform; it is not meant to be used directly from your code. 14560// Parameters: 14561// command - the text of the command to be invoked. The content of the command is infrastructure-specific. 14562// serviceID - the identity of the infrastructure service. This is the full name of the infrastructure service 14563// without the 'fabric:' URI scheme. This parameter required only for the cluster that has more than one 14564// instance of infrastructure service running. 14565// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 14566// duration that the client is willing to wait for the requested operation to complete. The default value for 14567// this parameter is 60 seconds. 14568func (client BaseClient) InvokeInfrastructureQuery(ctx context.Context, command string, serviceID string, timeout *int64) (result String, err error) { 14569 if tracing.IsEnabled() { 14570 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.InvokeInfrastructureQuery") 14571 defer func() { 14572 sc := -1 14573 if result.Response.Response != nil { 14574 sc = result.Response.Response.StatusCode 14575 } 14576 tracing.EndSpan(ctx, sc, err) 14577 }() 14578 } 14579 if err := validation.Validate([]validation.Validation{ 14580 {TargetValue: timeout, 14581 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 14582 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 14583 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 14584 }}}}}); err != nil { 14585 return result, validation.NewError("servicefabric.BaseClient", "InvokeInfrastructureQuery", err.Error()) 14586 } 14587 14588 req, err := client.InvokeInfrastructureQueryPreparer(ctx, command, serviceID, timeout) 14589 if err != nil { 14590 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "InvokeInfrastructureQuery", nil, "Failure preparing request") 14591 return 14592 } 14593 14594 resp, err := client.InvokeInfrastructureQuerySender(req) 14595 if err != nil { 14596 result.Response = autorest.Response{Response: resp} 14597 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "InvokeInfrastructureQuery", resp, "Failure sending request") 14598 return 14599 } 14600 14601 result, err = client.InvokeInfrastructureQueryResponder(resp) 14602 if err != nil { 14603 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "InvokeInfrastructureQuery", resp, "Failure responding to request") 14604 return 14605 } 14606 14607 return 14608} 14609 14610// InvokeInfrastructureQueryPreparer prepares the InvokeInfrastructureQuery request. 14611func (client BaseClient) InvokeInfrastructureQueryPreparer(ctx context.Context, command string, serviceID string, timeout *int64) (*http.Request, error) { 14612 const APIVersion = "6.0" 14613 queryParameters := map[string]interface{}{ 14614 "api-version": APIVersion, 14615 "Command": autorest.Encode("query", command), 14616 } 14617 if len(serviceID) > 0 { 14618 queryParameters["ServiceId"] = autorest.Encode("query", serviceID) 14619 } 14620 if timeout != nil { 14621 queryParameters["timeout"] = autorest.Encode("query", *timeout) 14622 } else { 14623 queryParameters["timeout"] = autorest.Encode("query", 60) 14624 } 14625 14626 preparer := autorest.CreatePreparer( 14627 autorest.AsGet(), 14628 autorest.WithBaseURL(client.BaseURI), 14629 autorest.WithPath("/$/InvokeInfrastructureQuery"), 14630 autorest.WithQueryParameters(queryParameters)) 14631 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 14632} 14633 14634// InvokeInfrastructureQuerySender sends the InvokeInfrastructureQuery request. The method will close the 14635// http.Response Body if it receives an error. 14636func (client BaseClient) InvokeInfrastructureQuerySender(req *http.Request) (*http.Response, error) { 14637 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 14638} 14639 14640// InvokeInfrastructureQueryResponder handles the response to the InvokeInfrastructureQuery request. The method always 14641// closes the http.Response Body. 14642func (client BaseClient) InvokeInfrastructureQueryResponder(resp *http.Response) (result String, err error) { 14643 err = autorest.Respond( 14644 resp, 14645 azure.WithErrorUnlessStatusCode(http.StatusOK), 14646 autorest.ByUnmarshallingJSON(&result.Value), 14647 autorest.ByClosing()) 14648 result.Response = autorest.Response{Response: resp} 14649 return 14650} 14651 14652// PostChaosSchedule chaos will automatically schedule runs based on the Chaos Schedule. 14653// The Chaos Schedule will be updated if the provided version matches the version on the server. 14654// When updating the Chaos Schedule, the version on the server is incremented by 1. 14655// The version on the server will wrap back to 0 after reaching a large number. 14656// If Chaos is running when this call is made, the call will fail. 14657// Parameters: 14658// chaosSchedule - describes the schedule used by Chaos. 14659// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 14660// duration that the client is willing to wait for the requested operation to complete. The default value for 14661// this parameter is 60 seconds. 14662func (client BaseClient) PostChaosSchedule(ctx context.Context, chaosSchedule ChaosScheduleDescription, timeout *int64) (result autorest.Response, err error) { 14663 if tracing.IsEnabled() { 14664 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.PostChaosSchedule") 14665 defer func() { 14666 sc := -1 14667 if result.Response != nil { 14668 sc = result.Response.StatusCode 14669 } 14670 tracing.EndSpan(ctx, sc, err) 14671 }() 14672 } 14673 if err := validation.Validate([]validation.Validation{ 14674 {TargetValue: timeout, 14675 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 14676 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 14677 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 14678 }}}}, 14679 {TargetValue: chaosSchedule, 14680 Constraints: []validation.Constraint{{Target: "chaosSchedule.Version", Name: validation.Null, Rule: false, 14681 Chain: []validation.Constraint{{Target: "chaosSchedule.Version", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}}}}}}); err != nil { 14682 return result, validation.NewError("servicefabric.BaseClient", "PostChaosSchedule", err.Error()) 14683 } 14684 14685 req, err := client.PostChaosSchedulePreparer(ctx, chaosSchedule, timeout) 14686 if err != nil { 14687 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "PostChaosSchedule", nil, "Failure preparing request") 14688 return 14689 } 14690 14691 resp, err := client.PostChaosScheduleSender(req) 14692 if err != nil { 14693 result.Response = resp 14694 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "PostChaosSchedule", resp, "Failure sending request") 14695 return 14696 } 14697 14698 result, err = client.PostChaosScheduleResponder(resp) 14699 if err != nil { 14700 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "PostChaosSchedule", resp, "Failure responding to request") 14701 return 14702 } 14703 14704 return 14705} 14706 14707// PostChaosSchedulePreparer prepares the PostChaosSchedule request. 14708func (client BaseClient) PostChaosSchedulePreparer(ctx context.Context, chaosSchedule ChaosScheduleDescription, timeout *int64) (*http.Request, error) { 14709 const APIVersion = "6.2" 14710 queryParameters := map[string]interface{}{ 14711 "api-version": APIVersion, 14712 } 14713 if timeout != nil { 14714 queryParameters["timeout"] = autorest.Encode("query", *timeout) 14715 } else { 14716 queryParameters["timeout"] = autorest.Encode("query", 60) 14717 } 14718 14719 preparer := autorest.CreatePreparer( 14720 autorest.AsContentType("application/json; charset=utf-8"), 14721 autorest.AsPost(), 14722 autorest.WithBaseURL(client.BaseURI), 14723 autorest.WithPath("/Tools/Chaos/Schedule"), 14724 autorest.WithJSON(chaosSchedule), 14725 autorest.WithQueryParameters(queryParameters)) 14726 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 14727} 14728 14729// PostChaosScheduleSender sends the PostChaosSchedule request. The method will close the 14730// http.Response Body if it receives an error. 14731func (client BaseClient) PostChaosScheduleSender(req *http.Request) (*http.Response, error) { 14732 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 14733} 14734 14735// PostChaosScheduleResponder handles the response to the PostChaosSchedule request. The method always 14736// closes the http.Response Body. 14737func (client BaseClient) PostChaosScheduleResponder(resp *http.Response) (result autorest.Response, err error) { 14738 err = autorest.Respond( 14739 resp, 14740 azure.WithErrorUnlessStatusCode(http.StatusOK), 14741 autorest.ByClosing()) 14742 result.Response = resp 14743 return 14744} 14745 14746// ProvisionApplicationType provisions a Service Fabric application type with the cluster. The provision is required 14747// before any new applications can be instantiated. 14748// The provision operation can be performed either on the application package specified by the 14749// relativePathInImageStore, or by using the URI of the external '.sfpkg'. 14750// Parameters: 14751// provisionApplicationTypeDescriptionBaseRequiredBodyParam - the base type of provision application type 14752// description which supports either image store-based provision or external store-based provision. 14753// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 14754// duration that the client is willing to wait for the requested operation to complete. The default value for 14755// this parameter is 60 seconds. 14756func (client BaseClient) ProvisionApplicationType(ctx context.Context, provisionApplicationTypeDescriptionBaseRequiredBodyParam BasicProvisionApplicationTypeDescriptionBase, timeout *int64) (result autorest.Response, err error) { 14757 if tracing.IsEnabled() { 14758 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ProvisionApplicationType") 14759 defer func() { 14760 sc := -1 14761 if result.Response != nil { 14762 sc = result.Response.StatusCode 14763 } 14764 tracing.EndSpan(ctx, sc, err) 14765 }() 14766 } 14767 if err := validation.Validate([]validation.Validation{ 14768 {TargetValue: provisionApplicationTypeDescriptionBaseRequiredBodyParam, 14769 Constraints: []validation.Constraint{{Target: "provisionApplicationTypeDescriptionBaseRequiredBodyParam.Async", Name: validation.Null, Rule: true, Chain: nil}}}, 14770 {TargetValue: timeout, 14771 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 14772 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 14773 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 14774 }}}}}); err != nil { 14775 return result, validation.NewError("servicefabric.BaseClient", "ProvisionApplicationType", err.Error()) 14776 } 14777 14778 req, err := client.ProvisionApplicationTypePreparer(ctx, provisionApplicationTypeDescriptionBaseRequiredBodyParam, timeout) 14779 if err != nil { 14780 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ProvisionApplicationType", nil, "Failure preparing request") 14781 return 14782 } 14783 14784 resp, err := client.ProvisionApplicationTypeSender(req) 14785 if err != nil { 14786 result.Response = resp 14787 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ProvisionApplicationType", resp, "Failure sending request") 14788 return 14789 } 14790 14791 result, err = client.ProvisionApplicationTypeResponder(resp) 14792 if err != nil { 14793 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ProvisionApplicationType", resp, "Failure responding to request") 14794 return 14795 } 14796 14797 return 14798} 14799 14800// ProvisionApplicationTypePreparer prepares the ProvisionApplicationType request. 14801func (client BaseClient) ProvisionApplicationTypePreparer(ctx context.Context, provisionApplicationTypeDescriptionBaseRequiredBodyParam BasicProvisionApplicationTypeDescriptionBase, timeout *int64) (*http.Request, error) { 14802 const APIVersion = "6.2" 14803 queryParameters := map[string]interface{}{ 14804 "api-version": APIVersion, 14805 } 14806 if timeout != nil { 14807 queryParameters["timeout"] = autorest.Encode("query", *timeout) 14808 } else { 14809 queryParameters["timeout"] = autorest.Encode("query", 60) 14810 } 14811 14812 preparer := autorest.CreatePreparer( 14813 autorest.AsContentType("application/json; charset=utf-8"), 14814 autorest.AsPost(), 14815 autorest.WithBaseURL(client.BaseURI), 14816 autorest.WithPath("/ApplicationTypes/$/Provision"), 14817 autorest.WithJSON(provisionApplicationTypeDescriptionBaseRequiredBodyParam), 14818 autorest.WithQueryParameters(queryParameters)) 14819 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 14820} 14821 14822// ProvisionApplicationTypeSender sends the ProvisionApplicationType request. The method will close the 14823// http.Response Body if it receives an error. 14824func (client BaseClient) ProvisionApplicationTypeSender(req *http.Request) (*http.Response, error) { 14825 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 14826} 14827 14828// ProvisionApplicationTypeResponder handles the response to the ProvisionApplicationType request. The method always 14829// closes the http.Response Body. 14830func (client BaseClient) ProvisionApplicationTypeResponder(resp *http.Response) (result autorest.Response, err error) { 14831 err = autorest.Respond( 14832 resp, 14833 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), 14834 autorest.ByClosing()) 14835 result.Response = resp 14836 return 14837} 14838 14839// ProvisionCluster validate and provision the code or configuration packages of a Service Fabric cluster. 14840// Parameters: 14841// provisionFabricDescription - describes the parameters for provisioning a cluster. 14842// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 14843// duration that the client is willing to wait for the requested operation to complete. The default value for 14844// this parameter is 60 seconds. 14845func (client BaseClient) ProvisionCluster(ctx context.Context, provisionFabricDescription ProvisionFabricDescription, timeout *int64) (result autorest.Response, err error) { 14846 if tracing.IsEnabled() { 14847 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ProvisionCluster") 14848 defer func() { 14849 sc := -1 14850 if result.Response != nil { 14851 sc = result.Response.StatusCode 14852 } 14853 tracing.EndSpan(ctx, sc, err) 14854 }() 14855 } 14856 if err := validation.Validate([]validation.Validation{ 14857 {TargetValue: timeout, 14858 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 14859 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 14860 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 14861 }}}}}); err != nil { 14862 return result, validation.NewError("servicefabric.BaseClient", "ProvisionCluster", err.Error()) 14863 } 14864 14865 req, err := client.ProvisionClusterPreparer(ctx, provisionFabricDescription, timeout) 14866 if err != nil { 14867 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ProvisionCluster", nil, "Failure preparing request") 14868 return 14869 } 14870 14871 resp, err := client.ProvisionClusterSender(req) 14872 if err != nil { 14873 result.Response = resp 14874 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ProvisionCluster", resp, "Failure sending request") 14875 return 14876 } 14877 14878 result, err = client.ProvisionClusterResponder(resp) 14879 if err != nil { 14880 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ProvisionCluster", resp, "Failure responding to request") 14881 return 14882 } 14883 14884 return 14885} 14886 14887// ProvisionClusterPreparer prepares the ProvisionCluster request. 14888func (client BaseClient) ProvisionClusterPreparer(ctx context.Context, provisionFabricDescription ProvisionFabricDescription, timeout *int64) (*http.Request, error) { 14889 const APIVersion = "6.0" 14890 queryParameters := map[string]interface{}{ 14891 "api-version": APIVersion, 14892 } 14893 if timeout != nil { 14894 queryParameters["timeout"] = autorest.Encode("query", *timeout) 14895 } else { 14896 queryParameters["timeout"] = autorest.Encode("query", 60) 14897 } 14898 14899 preparer := autorest.CreatePreparer( 14900 autorest.AsContentType("application/json; charset=utf-8"), 14901 autorest.AsPost(), 14902 autorest.WithBaseURL(client.BaseURI), 14903 autorest.WithPath("/$/Provision"), 14904 autorest.WithJSON(provisionFabricDescription), 14905 autorest.WithQueryParameters(queryParameters)) 14906 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 14907} 14908 14909// ProvisionClusterSender sends the ProvisionCluster request. The method will close the 14910// http.Response Body if it receives an error. 14911func (client BaseClient) ProvisionClusterSender(req *http.Request) (*http.Response, error) { 14912 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 14913} 14914 14915// ProvisionClusterResponder handles the response to the ProvisionCluster request. The method always 14916// closes the http.Response Body. 14917func (client BaseClient) ProvisionClusterResponder(resp *http.Response) (result autorest.Response, err error) { 14918 err = autorest.Respond( 14919 resp, 14920 azure.WithErrorUnlessStatusCode(http.StatusOK), 14921 autorest.ByClosing()) 14922 result.Response = resp 14923 return 14924} 14925 14926// PutProperty creates or updates the specified Service Fabric property under a given name. 14927// Parameters: 14928// nameID - the Service Fabric name, without the 'fabric:' URI scheme. 14929// propertyDescription - describes the Service Fabric property to be created. 14930// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 14931// duration that the client is willing to wait for the requested operation to complete. The default value for 14932// this parameter is 60 seconds. 14933func (client BaseClient) PutProperty(ctx context.Context, nameID string, propertyDescription PropertyDescription, timeout *int64) (result autorest.Response, err error) { 14934 if tracing.IsEnabled() { 14935 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.PutProperty") 14936 defer func() { 14937 sc := -1 14938 if result.Response != nil { 14939 sc = result.Response.StatusCode 14940 } 14941 tracing.EndSpan(ctx, sc, err) 14942 }() 14943 } 14944 if err := validation.Validate([]validation.Validation{ 14945 {TargetValue: propertyDescription, 14946 Constraints: []validation.Constraint{{Target: "propertyDescription.PropertyName", Name: validation.Null, Rule: true, Chain: nil}}}, 14947 {TargetValue: timeout, 14948 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 14949 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 14950 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 14951 }}}}}); err != nil { 14952 return result, validation.NewError("servicefabric.BaseClient", "PutProperty", err.Error()) 14953 } 14954 14955 req, err := client.PutPropertyPreparer(ctx, nameID, propertyDescription, timeout) 14956 if err != nil { 14957 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "PutProperty", nil, "Failure preparing request") 14958 return 14959 } 14960 14961 resp, err := client.PutPropertySender(req) 14962 if err != nil { 14963 result.Response = resp 14964 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "PutProperty", resp, "Failure sending request") 14965 return 14966 } 14967 14968 result, err = client.PutPropertyResponder(resp) 14969 if err != nil { 14970 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "PutProperty", resp, "Failure responding to request") 14971 return 14972 } 14973 14974 return 14975} 14976 14977// PutPropertyPreparer prepares the PutProperty request. 14978func (client BaseClient) PutPropertyPreparer(ctx context.Context, nameID string, propertyDescription PropertyDescription, timeout *int64) (*http.Request, error) { 14979 pathParameters := map[string]interface{}{ 14980 "nameId": nameID, 14981 } 14982 14983 const APIVersion = "6.0" 14984 queryParameters := map[string]interface{}{ 14985 "api-version": APIVersion, 14986 } 14987 if timeout != nil { 14988 queryParameters["timeout"] = autorest.Encode("query", *timeout) 14989 } else { 14990 queryParameters["timeout"] = autorest.Encode("query", 60) 14991 } 14992 14993 preparer := autorest.CreatePreparer( 14994 autorest.AsContentType("application/json; charset=utf-8"), 14995 autorest.AsPut(), 14996 autorest.WithBaseURL(client.BaseURI), 14997 autorest.WithPathParameters("/Names/{nameId}/$/GetProperty", pathParameters), 14998 autorest.WithJSON(propertyDescription), 14999 autorest.WithQueryParameters(queryParameters)) 15000 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 15001} 15002 15003// PutPropertySender sends the PutProperty request. The method will close the 15004// http.Response Body if it receives an error. 15005func (client BaseClient) PutPropertySender(req *http.Request) (*http.Response, error) { 15006 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 15007} 15008 15009// PutPropertyResponder handles the response to the PutProperty request. The method always 15010// closes the http.Response Body. 15011func (client BaseClient) PutPropertyResponder(resp *http.Response) (result autorest.Response, err error) { 15012 err = autorest.Respond( 15013 resp, 15014 azure.WithErrorUnlessStatusCode(http.StatusOK), 15015 autorest.ByClosing()) 15016 result.Response = resp 15017 return 15018} 15019 15020// RecoverAllPartitions this operation should only be performed if it is known that the replicas that are down cannot 15021// be recovered. Incorrect use of this API can cause potential data loss. 15022// Parameters: 15023// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 15024// duration that the client is willing to wait for the requested operation to complete. The default value for 15025// this parameter is 60 seconds. 15026func (client BaseClient) RecoverAllPartitions(ctx context.Context, timeout *int64) (result autorest.Response, err error) { 15027 if tracing.IsEnabled() { 15028 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.RecoverAllPartitions") 15029 defer func() { 15030 sc := -1 15031 if result.Response != nil { 15032 sc = result.Response.StatusCode 15033 } 15034 tracing.EndSpan(ctx, sc, err) 15035 }() 15036 } 15037 if err := validation.Validate([]validation.Validation{ 15038 {TargetValue: timeout, 15039 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 15040 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 15041 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 15042 }}}}}); err != nil { 15043 return result, validation.NewError("servicefabric.BaseClient", "RecoverAllPartitions", err.Error()) 15044 } 15045 15046 req, err := client.RecoverAllPartitionsPreparer(ctx, timeout) 15047 if err != nil { 15048 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RecoverAllPartitions", nil, "Failure preparing request") 15049 return 15050 } 15051 15052 resp, err := client.RecoverAllPartitionsSender(req) 15053 if err != nil { 15054 result.Response = resp 15055 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RecoverAllPartitions", resp, "Failure sending request") 15056 return 15057 } 15058 15059 result, err = client.RecoverAllPartitionsResponder(resp) 15060 if err != nil { 15061 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RecoverAllPartitions", resp, "Failure responding to request") 15062 return 15063 } 15064 15065 return 15066} 15067 15068// RecoverAllPartitionsPreparer prepares the RecoverAllPartitions request. 15069func (client BaseClient) RecoverAllPartitionsPreparer(ctx context.Context, timeout *int64) (*http.Request, error) { 15070 const APIVersion = "6.0" 15071 queryParameters := map[string]interface{}{ 15072 "api-version": APIVersion, 15073 } 15074 if timeout != nil { 15075 queryParameters["timeout"] = autorest.Encode("query", *timeout) 15076 } else { 15077 queryParameters["timeout"] = autorest.Encode("query", 60) 15078 } 15079 15080 preparer := autorest.CreatePreparer( 15081 autorest.AsPost(), 15082 autorest.WithBaseURL(client.BaseURI), 15083 autorest.WithPath("/$/RecoverAllPartitions"), 15084 autorest.WithQueryParameters(queryParameters)) 15085 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 15086} 15087 15088// RecoverAllPartitionsSender sends the RecoverAllPartitions request. The method will close the 15089// http.Response Body if it receives an error. 15090func (client BaseClient) RecoverAllPartitionsSender(req *http.Request) (*http.Response, error) { 15091 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 15092} 15093 15094// RecoverAllPartitionsResponder handles the response to the RecoverAllPartitions request. The method always 15095// closes the http.Response Body. 15096func (client BaseClient) RecoverAllPartitionsResponder(resp *http.Response) (result autorest.Response, err error) { 15097 err = autorest.Respond( 15098 resp, 15099 azure.WithErrorUnlessStatusCode(http.StatusOK), 15100 autorest.ByClosing()) 15101 result.Response = resp 15102 return 15103} 15104 15105// RecoverPartition this operation should only be performed if it is known that the replicas that are down cannot be 15106// recovered. Incorrect use of this API can cause potential data loss. 15107// Parameters: 15108// partitionID - the identity of the partition. 15109// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 15110// duration that the client is willing to wait for the requested operation to complete. The default value for 15111// this parameter is 60 seconds. 15112func (client BaseClient) RecoverPartition(ctx context.Context, partitionID uuid.UUID, timeout *int64) (result autorest.Response, err error) { 15113 if tracing.IsEnabled() { 15114 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.RecoverPartition") 15115 defer func() { 15116 sc := -1 15117 if result.Response != nil { 15118 sc = result.Response.StatusCode 15119 } 15120 tracing.EndSpan(ctx, sc, err) 15121 }() 15122 } 15123 if err := validation.Validate([]validation.Validation{ 15124 {TargetValue: timeout, 15125 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 15126 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 15127 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 15128 }}}}}); err != nil { 15129 return result, validation.NewError("servicefabric.BaseClient", "RecoverPartition", err.Error()) 15130 } 15131 15132 req, err := client.RecoverPartitionPreparer(ctx, partitionID, timeout) 15133 if err != nil { 15134 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RecoverPartition", nil, "Failure preparing request") 15135 return 15136 } 15137 15138 resp, err := client.RecoverPartitionSender(req) 15139 if err != nil { 15140 result.Response = resp 15141 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RecoverPartition", resp, "Failure sending request") 15142 return 15143 } 15144 15145 result, err = client.RecoverPartitionResponder(resp) 15146 if err != nil { 15147 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RecoverPartition", resp, "Failure responding to request") 15148 return 15149 } 15150 15151 return 15152} 15153 15154// RecoverPartitionPreparer prepares the RecoverPartition request. 15155func (client BaseClient) RecoverPartitionPreparer(ctx context.Context, partitionID uuid.UUID, timeout *int64) (*http.Request, error) { 15156 pathParameters := map[string]interface{}{ 15157 "partitionId": partitionID, 15158 } 15159 15160 const APIVersion = "6.0" 15161 queryParameters := map[string]interface{}{ 15162 "api-version": APIVersion, 15163 } 15164 if timeout != nil { 15165 queryParameters["timeout"] = autorest.Encode("query", *timeout) 15166 } else { 15167 queryParameters["timeout"] = autorest.Encode("query", 60) 15168 } 15169 15170 preparer := autorest.CreatePreparer( 15171 autorest.AsPost(), 15172 autorest.WithBaseURL(client.BaseURI), 15173 autorest.WithPathParameters("/Partitions/{partitionId}/$/Recover", pathParameters), 15174 autorest.WithQueryParameters(queryParameters)) 15175 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 15176} 15177 15178// RecoverPartitionSender sends the RecoverPartition request. The method will close the 15179// http.Response Body if it receives an error. 15180func (client BaseClient) RecoverPartitionSender(req *http.Request) (*http.Response, error) { 15181 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 15182} 15183 15184// RecoverPartitionResponder handles the response to the RecoverPartition request. The method always 15185// closes the http.Response Body. 15186func (client BaseClient) RecoverPartitionResponder(resp *http.Response) (result autorest.Response, err error) { 15187 err = autorest.Respond( 15188 resp, 15189 azure.WithErrorUnlessStatusCode(http.StatusOK), 15190 autorest.ByClosing()) 15191 result.Response = resp 15192 return 15193} 15194 15195// RecoverServicePartitions indicates to the Service Fabric cluster that it should attempt to recover the specified 15196// service that is currently stuck in quorum loss. This operation should only be performed if it is known that the 15197// replicas that are down cannot be recovered. Incorrect use of this API can cause potential data loss. 15198// Parameters: 15199// serviceID - the identity of the service. This ID is typically the full name of the service without the 15200// 'fabric:' URI scheme. 15201// Starting from version 6.0, hierarchical names are delimited with the "~" character. 15202// For example, if the service name is "fabric:/myapp/app1/svc1", the service identity would be 15203// "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in previous versions. 15204// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 15205// duration that the client is willing to wait for the requested operation to complete. The default value for 15206// this parameter is 60 seconds. 15207func (client BaseClient) RecoverServicePartitions(ctx context.Context, serviceID string, timeout *int64) (result autorest.Response, err error) { 15208 if tracing.IsEnabled() { 15209 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.RecoverServicePartitions") 15210 defer func() { 15211 sc := -1 15212 if result.Response != nil { 15213 sc = result.Response.StatusCode 15214 } 15215 tracing.EndSpan(ctx, sc, err) 15216 }() 15217 } 15218 if err := validation.Validate([]validation.Validation{ 15219 {TargetValue: timeout, 15220 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 15221 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 15222 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 15223 }}}}}); err != nil { 15224 return result, validation.NewError("servicefabric.BaseClient", "RecoverServicePartitions", err.Error()) 15225 } 15226 15227 req, err := client.RecoverServicePartitionsPreparer(ctx, serviceID, timeout) 15228 if err != nil { 15229 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RecoverServicePartitions", nil, "Failure preparing request") 15230 return 15231 } 15232 15233 resp, err := client.RecoverServicePartitionsSender(req) 15234 if err != nil { 15235 result.Response = resp 15236 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RecoverServicePartitions", resp, "Failure sending request") 15237 return 15238 } 15239 15240 result, err = client.RecoverServicePartitionsResponder(resp) 15241 if err != nil { 15242 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RecoverServicePartitions", resp, "Failure responding to request") 15243 return 15244 } 15245 15246 return 15247} 15248 15249// RecoverServicePartitionsPreparer prepares the RecoverServicePartitions request. 15250func (client BaseClient) RecoverServicePartitionsPreparer(ctx context.Context, serviceID string, timeout *int64) (*http.Request, error) { 15251 pathParameters := map[string]interface{}{ 15252 "serviceId": serviceID, 15253 } 15254 15255 const APIVersion = "6.0" 15256 queryParameters := map[string]interface{}{ 15257 "api-version": APIVersion, 15258 } 15259 if timeout != nil { 15260 queryParameters["timeout"] = autorest.Encode("query", *timeout) 15261 } else { 15262 queryParameters["timeout"] = autorest.Encode("query", 60) 15263 } 15264 15265 preparer := autorest.CreatePreparer( 15266 autorest.AsPost(), 15267 autorest.WithBaseURL(client.BaseURI), 15268 autorest.WithPathParameters("/Services/$/{serviceId}/$/GetPartitions/$/Recover", pathParameters), 15269 autorest.WithQueryParameters(queryParameters)) 15270 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 15271} 15272 15273// RecoverServicePartitionsSender sends the RecoverServicePartitions request. The method will close the 15274// http.Response Body if it receives an error. 15275func (client BaseClient) RecoverServicePartitionsSender(req *http.Request) (*http.Response, error) { 15276 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 15277} 15278 15279// RecoverServicePartitionsResponder handles the response to the RecoverServicePartitions request. The method always 15280// closes the http.Response Body. 15281func (client BaseClient) RecoverServicePartitionsResponder(resp *http.Response) (result autorest.Response, err error) { 15282 err = autorest.Respond( 15283 resp, 15284 azure.WithErrorUnlessStatusCode(http.StatusOK), 15285 autorest.ByClosing()) 15286 result.Response = resp 15287 return 15288} 15289 15290// RecoverSystemPartitions indicates to the Service Fabric cluster that it should attempt to recover the system 15291// services that are currently stuck in quorum loss. This operation should only be performed if it is known that the 15292// replicas that are down cannot be recovered. Incorrect use of this API can cause potential data loss. 15293// Parameters: 15294// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 15295// duration that the client is willing to wait for the requested operation to complete. The default value for 15296// this parameter is 60 seconds. 15297func (client BaseClient) RecoverSystemPartitions(ctx context.Context, timeout *int64) (result autorest.Response, err error) { 15298 if tracing.IsEnabled() { 15299 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.RecoverSystemPartitions") 15300 defer func() { 15301 sc := -1 15302 if result.Response != nil { 15303 sc = result.Response.StatusCode 15304 } 15305 tracing.EndSpan(ctx, sc, err) 15306 }() 15307 } 15308 if err := validation.Validate([]validation.Validation{ 15309 {TargetValue: timeout, 15310 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 15311 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 15312 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 15313 }}}}}); err != nil { 15314 return result, validation.NewError("servicefabric.BaseClient", "RecoverSystemPartitions", err.Error()) 15315 } 15316 15317 req, err := client.RecoverSystemPartitionsPreparer(ctx, timeout) 15318 if err != nil { 15319 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RecoverSystemPartitions", nil, "Failure preparing request") 15320 return 15321 } 15322 15323 resp, err := client.RecoverSystemPartitionsSender(req) 15324 if err != nil { 15325 result.Response = resp 15326 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RecoverSystemPartitions", resp, "Failure sending request") 15327 return 15328 } 15329 15330 result, err = client.RecoverSystemPartitionsResponder(resp) 15331 if err != nil { 15332 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RecoverSystemPartitions", resp, "Failure responding to request") 15333 return 15334 } 15335 15336 return 15337} 15338 15339// RecoverSystemPartitionsPreparer prepares the RecoverSystemPartitions request. 15340func (client BaseClient) RecoverSystemPartitionsPreparer(ctx context.Context, timeout *int64) (*http.Request, error) { 15341 const APIVersion = "6.0" 15342 queryParameters := map[string]interface{}{ 15343 "api-version": APIVersion, 15344 } 15345 if timeout != nil { 15346 queryParameters["timeout"] = autorest.Encode("query", *timeout) 15347 } else { 15348 queryParameters["timeout"] = autorest.Encode("query", 60) 15349 } 15350 15351 preparer := autorest.CreatePreparer( 15352 autorest.AsPost(), 15353 autorest.WithBaseURL(client.BaseURI), 15354 autorest.WithPath("/$/RecoverSystemPartitions"), 15355 autorest.WithQueryParameters(queryParameters)) 15356 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 15357} 15358 15359// RecoverSystemPartitionsSender sends the RecoverSystemPartitions request. The method will close the 15360// http.Response Body if it receives an error. 15361func (client BaseClient) RecoverSystemPartitionsSender(req *http.Request) (*http.Response, error) { 15362 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 15363} 15364 15365// RecoverSystemPartitionsResponder handles the response to the RecoverSystemPartitions request. The method always 15366// closes the http.Response Body. 15367func (client BaseClient) RecoverSystemPartitionsResponder(resp *http.Response) (result autorest.Response, err error) { 15368 err = autorest.Respond( 15369 resp, 15370 azure.WithErrorUnlessStatusCode(http.StatusOK), 15371 autorest.ByClosing()) 15372 result.Response = resp 15373 return 15374} 15375 15376// RemoveComposeDeployment deletes an existing Service Fabric compose deployment. 15377// Parameters: 15378// deploymentName - the identity of the deployment. 15379// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 15380// duration that the client is willing to wait for the requested operation to complete. The default value for 15381// this parameter is 60 seconds. 15382func (client BaseClient) RemoveComposeDeployment(ctx context.Context, deploymentName string, timeout *int64) (result autorest.Response, err error) { 15383 if tracing.IsEnabled() { 15384 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.RemoveComposeDeployment") 15385 defer func() { 15386 sc := -1 15387 if result.Response != nil { 15388 sc = result.Response.StatusCode 15389 } 15390 tracing.EndSpan(ctx, sc, err) 15391 }() 15392 } 15393 if err := validation.Validate([]validation.Validation{ 15394 {TargetValue: timeout, 15395 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 15396 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 15397 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 15398 }}}}}); err != nil { 15399 return result, validation.NewError("servicefabric.BaseClient", "RemoveComposeDeployment", err.Error()) 15400 } 15401 15402 req, err := client.RemoveComposeDeploymentPreparer(ctx, deploymentName, timeout) 15403 if err != nil { 15404 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RemoveComposeDeployment", nil, "Failure preparing request") 15405 return 15406 } 15407 15408 resp, err := client.RemoveComposeDeploymentSender(req) 15409 if err != nil { 15410 result.Response = resp 15411 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RemoveComposeDeployment", resp, "Failure sending request") 15412 return 15413 } 15414 15415 result, err = client.RemoveComposeDeploymentResponder(resp) 15416 if err != nil { 15417 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RemoveComposeDeployment", resp, "Failure responding to request") 15418 return 15419 } 15420 15421 return 15422} 15423 15424// RemoveComposeDeploymentPreparer prepares the RemoveComposeDeployment request. 15425func (client BaseClient) RemoveComposeDeploymentPreparer(ctx context.Context, deploymentName string, timeout *int64) (*http.Request, error) { 15426 pathParameters := map[string]interface{}{ 15427 "deploymentName": deploymentName, 15428 } 15429 15430 const APIVersion = "6.0-preview" 15431 queryParameters := map[string]interface{}{ 15432 "api-version": APIVersion, 15433 } 15434 if timeout != nil { 15435 queryParameters["timeout"] = autorest.Encode("query", *timeout) 15436 } else { 15437 queryParameters["timeout"] = autorest.Encode("query", 60) 15438 } 15439 15440 preparer := autorest.CreatePreparer( 15441 autorest.AsPost(), 15442 autorest.WithBaseURL(client.BaseURI), 15443 autorest.WithPathParameters("/ComposeDeployments/{deploymentName}/$/Delete", pathParameters), 15444 autorest.WithQueryParameters(queryParameters)) 15445 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 15446} 15447 15448// RemoveComposeDeploymentSender sends the RemoveComposeDeployment request. The method will close the 15449// http.Response Body if it receives an error. 15450func (client BaseClient) RemoveComposeDeploymentSender(req *http.Request) (*http.Response, error) { 15451 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 15452} 15453 15454// RemoveComposeDeploymentResponder handles the response to the RemoveComposeDeployment request. The method always 15455// closes the http.Response Body. 15456func (client BaseClient) RemoveComposeDeploymentResponder(resp *http.Response) (result autorest.Response, err error) { 15457 err = autorest.Respond( 15458 resp, 15459 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), 15460 autorest.ByClosing()) 15461 result.Response = resp 15462 return 15463} 15464 15465// RemoveNodeState this implies that it is not possible to recover the persisted state of that node. This generally 15466// happens if a hard disk has been wiped clean, or if a hard disk crashes. The node has to be down for this operation 15467// to be successful. This operation lets Service Fabric know that the replicas on that node no longer exist, and that 15468// Service Fabric should stop waiting for those replicas to come back up. Do not run this cmdlet if the state on the 15469// node has not been removed and the node can come back up with its state intact. 15470// Parameters: 15471// nodeName - the name of the node. 15472// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 15473// duration that the client is willing to wait for the requested operation to complete. The default value for 15474// this parameter is 60 seconds. 15475func (client BaseClient) RemoveNodeState(ctx context.Context, nodeName string, timeout *int64) (result autorest.Response, err error) { 15476 if tracing.IsEnabled() { 15477 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.RemoveNodeState") 15478 defer func() { 15479 sc := -1 15480 if result.Response != nil { 15481 sc = result.Response.StatusCode 15482 } 15483 tracing.EndSpan(ctx, sc, err) 15484 }() 15485 } 15486 if err := validation.Validate([]validation.Validation{ 15487 {TargetValue: timeout, 15488 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 15489 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 15490 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 15491 }}}}}); err != nil { 15492 return result, validation.NewError("servicefabric.BaseClient", "RemoveNodeState", err.Error()) 15493 } 15494 15495 req, err := client.RemoveNodeStatePreparer(ctx, nodeName, timeout) 15496 if err != nil { 15497 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RemoveNodeState", nil, "Failure preparing request") 15498 return 15499 } 15500 15501 resp, err := client.RemoveNodeStateSender(req) 15502 if err != nil { 15503 result.Response = resp 15504 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RemoveNodeState", resp, "Failure sending request") 15505 return 15506 } 15507 15508 result, err = client.RemoveNodeStateResponder(resp) 15509 if err != nil { 15510 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RemoveNodeState", resp, "Failure responding to request") 15511 return 15512 } 15513 15514 return 15515} 15516 15517// RemoveNodeStatePreparer prepares the RemoveNodeState request. 15518func (client BaseClient) RemoveNodeStatePreparer(ctx context.Context, nodeName string, timeout *int64) (*http.Request, error) { 15519 pathParameters := map[string]interface{}{ 15520 "nodeName": autorest.Encode("path", nodeName), 15521 } 15522 15523 const APIVersion = "6.0" 15524 queryParameters := map[string]interface{}{ 15525 "api-version": APIVersion, 15526 } 15527 if timeout != nil { 15528 queryParameters["timeout"] = autorest.Encode("query", *timeout) 15529 } else { 15530 queryParameters["timeout"] = autorest.Encode("query", 60) 15531 } 15532 15533 preparer := autorest.CreatePreparer( 15534 autorest.AsPost(), 15535 autorest.WithBaseURL(client.BaseURI), 15536 autorest.WithPathParameters("/Nodes/{nodeName}/$/RemoveNodeState", pathParameters), 15537 autorest.WithQueryParameters(queryParameters)) 15538 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 15539} 15540 15541// RemoveNodeStateSender sends the RemoveNodeState request. The method will close the 15542// http.Response Body if it receives an error. 15543func (client BaseClient) RemoveNodeStateSender(req *http.Request) (*http.Response, error) { 15544 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 15545} 15546 15547// RemoveNodeStateResponder handles the response to the RemoveNodeState request. The method always 15548// closes the http.Response Body. 15549func (client BaseClient) RemoveNodeStateResponder(resp *http.Response) (result autorest.Response, err error) { 15550 err = autorest.Respond( 15551 resp, 15552 azure.WithErrorUnlessStatusCode(http.StatusOK), 15553 autorest.ByClosing()) 15554 result.Response = resp 15555 return 15556} 15557 15558// RemoveReplica this API simulates a Service Fabric replica failure by removing a replica from a Service Fabric 15559// cluster. The removal closes the replica, transitions the replica to the role None, and then removes all of the state 15560// information of the replica from the cluster. This API tests the replica state removal path, and simulates the report 15561// fault permanent path through client APIs. Warning - There are no safety checks performed when this API is used. 15562// Incorrect use of this API can lead to data loss for stateful services. In addition, the forceRemove flag impacts all 15563// other replicas hosted in the same process. 15564// Parameters: 15565// nodeName - the name of the node. 15566// partitionID - the identity of the partition. 15567// replicaID - the identifier of the replica. 15568// forceRemove - remove a Service Fabric application or service forcefully without going through the graceful 15569// shutdown sequence. This parameter can be used to forcefully delete an application or service for which 15570// delete is timing out due to issues in the service code that prevents graceful close of replicas. 15571// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 15572// duration that the client is willing to wait for the requested operation to complete. The default value for 15573// this parameter is 60 seconds. 15574func (client BaseClient) RemoveReplica(ctx context.Context, nodeName string, partitionID uuid.UUID, replicaID string, forceRemove *bool, timeout *int64) (result autorest.Response, err error) { 15575 if tracing.IsEnabled() { 15576 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.RemoveReplica") 15577 defer func() { 15578 sc := -1 15579 if result.Response != nil { 15580 sc = result.Response.StatusCode 15581 } 15582 tracing.EndSpan(ctx, sc, err) 15583 }() 15584 } 15585 if err := validation.Validate([]validation.Validation{ 15586 {TargetValue: timeout, 15587 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 15588 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 15589 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 15590 }}}}}); err != nil { 15591 return result, validation.NewError("servicefabric.BaseClient", "RemoveReplica", err.Error()) 15592 } 15593 15594 req, err := client.RemoveReplicaPreparer(ctx, nodeName, partitionID, replicaID, forceRemove, timeout) 15595 if err != nil { 15596 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RemoveReplica", nil, "Failure preparing request") 15597 return 15598 } 15599 15600 resp, err := client.RemoveReplicaSender(req) 15601 if err != nil { 15602 result.Response = resp 15603 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RemoveReplica", resp, "Failure sending request") 15604 return 15605 } 15606 15607 result, err = client.RemoveReplicaResponder(resp) 15608 if err != nil { 15609 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RemoveReplica", resp, "Failure responding to request") 15610 return 15611 } 15612 15613 return 15614} 15615 15616// RemoveReplicaPreparer prepares the RemoveReplica request. 15617func (client BaseClient) RemoveReplicaPreparer(ctx context.Context, nodeName string, partitionID uuid.UUID, replicaID string, forceRemove *bool, timeout *int64) (*http.Request, error) { 15618 pathParameters := map[string]interface{}{ 15619 "nodeName": autorest.Encode("path", nodeName), 15620 "partitionId": partitionID, 15621 "replicaId": replicaID, 15622 } 15623 15624 const APIVersion = "6.0" 15625 queryParameters := map[string]interface{}{ 15626 "api-version": APIVersion, 15627 } 15628 if forceRemove != nil { 15629 queryParameters["ForceRemove"] = autorest.Encode("query", *forceRemove) 15630 } 15631 if timeout != nil { 15632 queryParameters["timeout"] = autorest.Encode("query", *timeout) 15633 } else { 15634 queryParameters["timeout"] = autorest.Encode("query", 60) 15635 } 15636 15637 preparer := autorest.CreatePreparer( 15638 autorest.AsPost(), 15639 autorest.WithBaseURL(client.BaseURI), 15640 autorest.WithPathParameters("/Nodes/{nodeName}/$/GetPartitions/{partitionId}/$/GetReplicas/{replicaId}/$/Delete", pathParameters), 15641 autorest.WithQueryParameters(queryParameters)) 15642 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 15643} 15644 15645// RemoveReplicaSender sends the RemoveReplica request. The method will close the 15646// http.Response Body if it receives an error. 15647func (client BaseClient) RemoveReplicaSender(req *http.Request) (*http.Response, error) { 15648 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 15649} 15650 15651// RemoveReplicaResponder handles the response to the RemoveReplica request. The method always 15652// closes the http.Response Body. 15653func (client BaseClient) RemoveReplicaResponder(resp *http.Response) (result autorest.Response, err error) { 15654 err = autorest.Respond( 15655 resp, 15656 azure.WithErrorUnlessStatusCode(http.StatusOK), 15657 autorest.ByClosing()) 15658 result.Response = resp 15659 return 15660} 15661 15662// ReportApplicationHealth reports health state of the specified Service Fabric application. The report must contain 15663// the information about the source of the health report and property on which it is reported. 15664// The report is sent to a Service Fabric gateway Application, which forwards to the health store. 15665// The report may be accepted by the gateway, but rejected by the health store after extra validation. 15666// For example, the health store may reject the report because of an invalid parameter, like a stale sequence number. 15667// To see whether the report was applied in the health store, get application health and check that the report appears 15668// in the HealthEvents section. 15669// Parameters: 15670// applicationID - the identity of the application. This is typically the full name of the application without 15671// the 'fabric:' URI scheme. 15672// Starting from version 6.0, hierarchical names are delimited with the "~" character. 15673// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" 15674// in 6.0+ and "myapp/app1" in previous versions. 15675// healthInformation - describes the health information for the health report. This information needs to be 15676// present in all of the health reports sent to the health manager. 15677// immediate - a flag that indicates whether the report should be sent immediately. 15678// A health report is sent to a Service Fabric gateway Application, which forwards to the health store. 15679// If Immediate is set to true, the report is sent immediately from HTTP Gateway to the health store, 15680// regardless of the fabric client settings that the HTTP Gateway Application is using. 15681// This is useful for critical reports that should be sent as soon as possible. 15682// Depending on timing and other conditions, sending the report may still fail, for example if the HTTP Gateway 15683// is closed or the message doesn't reach the Gateway. 15684// If Immediate is set to false, the report is sent based on the health client settings from the HTTP Gateway. 15685// Therefore, it will be batched according to the HealthReportSendInterval configuration. 15686// This is the recommended setting because it allows the health client to optimize health reporting messages to 15687// health store as well as health report processing. 15688// By default, reports are not sent immediately. 15689// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 15690// duration that the client is willing to wait for the requested operation to complete. The default value for 15691// this parameter is 60 seconds. 15692func (client BaseClient) ReportApplicationHealth(ctx context.Context, applicationID string, healthInformation HealthInformation, immediate *bool, timeout *int64) (result autorest.Response, err error) { 15693 if tracing.IsEnabled() { 15694 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ReportApplicationHealth") 15695 defer func() { 15696 sc := -1 15697 if result.Response != nil { 15698 sc = result.Response.StatusCode 15699 } 15700 tracing.EndSpan(ctx, sc, err) 15701 }() 15702 } 15703 if err := validation.Validate([]validation.Validation{ 15704 {TargetValue: healthInformation, 15705 Constraints: []validation.Constraint{{Target: "healthInformation.SourceID", Name: validation.Null, Rule: true, Chain: nil}, 15706 {Target: "healthInformation.Property", Name: validation.Null, Rule: true, Chain: nil}}}, 15707 {TargetValue: timeout, 15708 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 15709 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 15710 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 15711 }}}}}); err != nil { 15712 return result, validation.NewError("servicefabric.BaseClient", "ReportApplicationHealth", err.Error()) 15713 } 15714 15715 req, err := client.ReportApplicationHealthPreparer(ctx, applicationID, healthInformation, immediate, timeout) 15716 if err != nil { 15717 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ReportApplicationHealth", nil, "Failure preparing request") 15718 return 15719 } 15720 15721 resp, err := client.ReportApplicationHealthSender(req) 15722 if err != nil { 15723 result.Response = resp 15724 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ReportApplicationHealth", resp, "Failure sending request") 15725 return 15726 } 15727 15728 result, err = client.ReportApplicationHealthResponder(resp) 15729 if err != nil { 15730 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ReportApplicationHealth", resp, "Failure responding to request") 15731 return 15732 } 15733 15734 return 15735} 15736 15737// ReportApplicationHealthPreparer prepares the ReportApplicationHealth request. 15738func (client BaseClient) ReportApplicationHealthPreparer(ctx context.Context, applicationID string, healthInformation HealthInformation, immediate *bool, timeout *int64) (*http.Request, error) { 15739 pathParameters := map[string]interface{}{ 15740 "applicationId": applicationID, 15741 } 15742 15743 const APIVersion = "6.0" 15744 queryParameters := map[string]interface{}{ 15745 "api-version": APIVersion, 15746 } 15747 if immediate != nil { 15748 queryParameters["Immediate"] = autorest.Encode("query", *immediate) 15749 } else { 15750 queryParameters["Immediate"] = autorest.Encode("query", false) 15751 } 15752 if timeout != nil { 15753 queryParameters["timeout"] = autorest.Encode("query", *timeout) 15754 } else { 15755 queryParameters["timeout"] = autorest.Encode("query", 60) 15756 } 15757 15758 preparer := autorest.CreatePreparer( 15759 autorest.AsContentType("application/json; charset=utf-8"), 15760 autorest.AsPost(), 15761 autorest.WithBaseURL(client.BaseURI), 15762 autorest.WithPathParameters("/Applications/{applicationId}/$/ReportHealth", pathParameters), 15763 autorest.WithJSON(healthInformation), 15764 autorest.WithQueryParameters(queryParameters)) 15765 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 15766} 15767 15768// ReportApplicationHealthSender sends the ReportApplicationHealth request. The method will close the 15769// http.Response Body if it receives an error. 15770func (client BaseClient) ReportApplicationHealthSender(req *http.Request) (*http.Response, error) { 15771 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 15772} 15773 15774// ReportApplicationHealthResponder handles the response to the ReportApplicationHealth request. The method always 15775// closes the http.Response Body. 15776func (client BaseClient) ReportApplicationHealthResponder(resp *http.Response) (result autorest.Response, err error) { 15777 err = autorest.Respond( 15778 resp, 15779 azure.WithErrorUnlessStatusCode(http.StatusOK), 15780 autorest.ByClosing()) 15781 result.Response = resp 15782 return 15783} 15784 15785// ReportClusterHealth sends a health report on a Service Fabric cluster. The report must contain the information about 15786// the source of the health report and property on which it is reported. 15787// The report is sent to a Service Fabric gateway node, which forwards to the health store. 15788// The report may be accepted by the gateway, but rejected by the health store after extra validation. 15789// For example, the health store may reject the report because of an invalid parameter, like a stale sequence number. 15790// To see whether the report was applied in the health store, run GetClusterHealth and check that the report appears in 15791// the HealthEvents section. 15792// Parameters: 15793// healthInformation - describes the health information for the health report. This information needs to be 15794// present in all of the health reports sent to the health manager. 15795// immediate - a flag that indicates whether the report should be sent immediately. 15796// A health report is sent to a Service Fabric gateway Application, which forwards to the health store. 15797// If Immediate is set to true, the report is sent immediately from HTTP Gateway to the health store, 15798// regardless of the fabric client settings that the HTTP Gateway Application is using. 15799// This is useful for critical reports that should be sent as soon as possible. 15800// Depending on timing and other conditions, sending the report may still fail, for example if the HTTP Gateway 15801// is closed or the message doesn't reach the Gateway. 15802// If Immediate is set to false, the report is sent based on the health client settings from the HTTP Gateway. 15803// Therefore, it will be batched according to the HealthReportSendInterval configuration. 15804// This is the recommended setting because it allows the health client to optimize health reporting messages to 15805// health store as well as health report processing. 15806// By default, reports are not sent immediately. 15807// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 15808// duration that the client is willing to wait for the requested operation to complete. The default value for 15809// this parameter is 60 seconds. 15810func (client BaseClient) ReportClusterHealth(ctx context.Context, healthInformation HealthInformation, immediate *bool, timeout *int64) (result autorest.Response, err error) { 15811 if tracing.IsEnabled() { 15812 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ReportClusterHealth") 15813 defer func() { 15814 sc := -1 15815 if result.Response != nil { 15816 sc = result.Response.StatusCode 15817 } 15818 tracing.EndSpan(ctx, sc, err) 15819 }() 15820 } 15821 if err := validation.Validate([]validation.Validation{ 15822 {TargetValue: healthInformation, 15823 Constraints: []validation.Constraint{{Target: "healthInformation.SourceID", Name: validation.Null, Rule: true, Chain: nil}, 15824 {Target: "healthInformation.Property", Name: validation.Null, Rule: true, Chain: nil}}}, 15825 {TargetValue: timeout, 15826 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 15827 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 15828 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 15829 }}}}}); err != nil { 15830 return result, validation.NewError("servicefabric.BaseClient", "ReportClusterHealth", err.Error()) 15831 } 15832 15833 req, err := client.ReportClusterHealthPreparer(ctx, healthInformation, immediate, timeout) 15834 if err != nil { 15835 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ReportClusterHealth", nil, "Failure preparing request") 15836 return 15837 } 15838 15839 resp, err := client.ReportClusterHealthSender(req) 15840 if err != nil { 15841 result.Response = resp 15842 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ReportClusterHealth", resp, "Failure sending request") 15843 return 15844 } 15845 15846 result, err = client.ReportClusterHealthResponder(resp) 15847 if err != nil { 15848 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ReportClusterHealth", resp, "Failure responding to request") 15849 return 15850 } 15851 15852 return 15853} 15854 15855// ReportClusterHealthPreparer prepares the ReportClusterHealth request. 15856func (client BaseClient) ReportClusterHealthPreparer(ctx context.Context, healthInformation HealthInformation, immediate *bool, timeout *int64) (*http.Request, error) { 15857 const APIVersion = "6.0" 15858 queryParameters := map[string]interface{}{ 15859 "api-version": APIVersion, 15860 } 15861 if immediate != nil { 15862 queryParameters["Immediate"] = autorest.Encode("query", *immediate) 15863 } else { 15864 queryParameters["Immediate"] = autorest.Encode("query", false) 15865 } 15866 if timeout != nil { 15867 queryParameters["timeout"] = autorest.Encode("query", *timeout) 15868 } else { 15869 queryParameters["timeout"] = autorest.Encode("query", 60) 15870 } 15871 15872 preparer := autorest.CreatePreparer( 15873 autorest.AsContentType("application/json; charset=utf-8"), 15874 autorest.AsPost(), 15875 autorest.WithBaseURL(client.BaseURI), 15876 autorest.WithPath("/$/ReportClusterHealth"), 15877 autorest.WithJSON(healthInformation), 15878 autorest.WithQueryParameters(queryParameters)) 15879 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 15880} 15881 15882// ReportClusterHealthSender sends the ReportClusterHealth request. The method will close the 15883// http.Response Body if it receives an error. 15884func (client BaseClient) ReportClusterHealthSender(req *http.Request) (*http.Response, error) { 15885 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 15886} 15887 15888// ReportClusterHealthResponder handles the response to the ReportClusterHealth request. The method always 15889// closes the http.Response Body. 15890func (client BaseClient) ReportClusterHealthResponder(resp *http.Response) (result autorest.Response, err error) { 15891 err = autorest.Respond( 15892 resp, 15893 azure.WithErrorUnlessStatusCode(http.StatusOK), 15894 autorest.ByClosing()) 15895 result.Response = resp 15896 return 15897} 15898 15899// ReportDeployedApplicationHealth reports health state of the application deployed on a Service Fabric node. The 15900// report must contain the information about the source of the health report and property on which it is reported. 15901// The report is sent to a Service Fabric gateway Service, which forwards to the health store. 15902// The report may be accepted by the gateway, but rejected by the health store after extra validation. 15903// For example, the health store may reject the report because of an invalid parameter, like a stale sequence number. 15904// To see whether the report was applied in the health store, get deployed application health and check that the report 15905// appears in the HealthEvents section. 15906// Parameters: 15907// nodeName - the name of the node. 15908// applicationID - the identity of the application. This is typically the full name of the application without 15909// the 'fabric:' URI scheme. 15910// Starting from version 6.0, hierarchical names are delimited with the "~" character. 15911// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" 15912// in 6.0+ and "myapp/app1" in previous versions. 15913// healthInformation - describes the health information for the health report. This information needs to be 15914// present in all of the health reports sent to the health manager. 15915// immediate - a flag that indicates whether the report should be sent immediately. 15916// A health report is sent to a Service Fabric gateway Application, which forwards to the health store. 15917// If Immediate is set to true, the report is sent immediately from HTTP Gateway to the health store, 15918// regardless of the fabric client settings that the HTTP Gateway Application is using. 15919// This is useful for critical reports that should be sent as soon as possible. 15920// Depending on timing and other conditions, sending the report may still fail, for example if the HTTP Gateway 15921// is closed or the message doesn't reach the Gateway. 15922// If Immediate is set to false, the report is sent based on the health client settings from the HTTP Gateway. 15923// Therefore, it will be batched according to the HealthReportSendInterval configuration. 15924// This is the recommended setting because it allows the health client to optimize health reporting messages to 15925// health store as well as health report processing. 15926// By default, reports are not sent immediately. 15927// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 15928// duration that the client is willing to wait for the requested operation to complete. The default value for 15929// this parameter is 60 seconds. 15930func (client BaseClient) ReportDeployedApplicationHealth(ctx context.Context, nodeName string, applicationID string, healthInformation HealthInformation, immediate *bool, timeout *int64) (result autorest.Response, err error) { 15931 if tracing.IsEnabled() { 15932 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ReportDeployedApplicationHealth") 15933 defer func() { 15934 sc := -1 15935 if result.Response != nil { 15936 sc = result.Response.StatusCode 15937 } 15938 tracing.EndSpan(ctx, sc, err) 15939 }() 15940 } 15941 if err := validation.Validate([]validation.Validation{ 15942 {TargetValue: healthInformation, 15943 Constraints: []validation.Constraint{{Target: "healthInformation.SourceID", Name: validation.Null, Rule: true, Chain: nil}, 15944 {Target: "healthInformation.Property", Name: validation.Null, Rule: true, Chain: nil}}}, 15945 {TargetValue: timeout, 15946 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 15947 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 15948 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 15949 }}}}}); err != nil { 15950 return result, validation.NewError("servicefabric.BaseClient", "ReportDeployedApplicationHealth", err.Error()) 15951 } 15952 15953 req, err := client.ReportDeployedApplicationHealthPreparer(ctx, nodeName, applicationID, healthInformation, immediate, timeout) 15954 if err != nil { 15955 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ReportDeployedApplicationHealth", nil, "Failure preparing request") 15956 return 15957 } 15958 15959 resp, err := client.ReportDeployedApplicationHealthSender(req) 15960 if err != nil { 15961 result.Response = resp 15962 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ReportDeployedApplicationHealth", resp, "Failure sending request") 15963 return 15964 } 15965 15966 result, err = client.ReportDeployedApplicationHealthResponder(resp) 15967 if err != nil { 15968 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ReportDeployedApplicationHealth", resp, "Failure responding to request") 15969 return 15970 } 15971 15972 return 15973} 15974 15975// ReportDeployedApplicationHealthPreparer prepares the ReportDeployedApplicationHealth request. 15976func (client BaseClient) ReportDeployedApplicationHealthPreparer(ctx context.Context, nodeName string, applicationID string, healthInformation HealthInformation, immediate *bool, timeout *int64) (*http.Request, error) { 15977 pathParameters := map[string]interface{}{ 15978 "applicationId": applicationID, 15979 "nodeName": autorest.Encode("path", nodeName), 15980 } 15981 15982 const APIVersion = "6.0" 15983 queryParameters := map[string]interface{}{ 15984 "api-version": APIVersion, 15985 } 15986 if immediate != nil { 15987 queryParameters["Immediate"] = autorest.Encode("query", *immediate) 15988 } else { 15989 queryParameters["Immediate"] = autorest.Encode("query", false) 15990 } 15991 if timeout != nil { 15992 queryParameters["timeout"] = autorest.Encode("query", *timeout) 15993 } else { 15994 queryParameters["timeout"] = autorest.Encode("query", 60) 15995 } 15996 15997 preparer := autorest.CreatePreparer( 15998 autorest.AsContentType("application/json; charset=utf-8"), 15999 autorest.AsPost(), 16000 autorest.WithBaseURL(client.BaseURI), 16001 autorest.WithPathParameters("/Nodes/{nodeName}/$/GetApplications/{applicationId}/$/ReportHealth", pathParameters), 16002 autorest.WithJSON(healthInformation), 16003 autorest.WithQueryParameters(queryParameters)) 16004 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 16005} 16006 16007// ReportDeployedApplicationHealthSender sends the ReportDeployedApplicationHealth request. The method will close the 16008// http.Response Body if it receives an error. 16009func (client BaseClient) ReportDeployedApplicationHealthSender(req *http.Request) (*http.Response, error) { 16010 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 16011} 16012 16013// ReportDeployedApplicationHealthResponder handles the response to the ReportDeployedApplicationHealth request. The method always 16014// closes the http.Response Body. 16015func (client BaseClient) ReportDeployedApplicationHealthResponder(resp *http.Response) (result autorest.Response, err error) { 16016 err = autorest.Respond( 16017 resp, 16018 azure.WithErrorUnlessStatusCode(http.StatusOK), 16019 autorest.ByClosing()) 16020 result.Response = resp 16021 return 16022} 16023 16024// ReportDeployedServicePackageHealth reports health state of the service package of the application deployed on a 16025// Service Fabric node. The report must contain the information about the source of the health report and property on 16026// which it is reported. 16027// The report is sent to a Service Fabric gateway Service, which forwards to the health store. 16028// The report may be accepted by the gateway, but rejected by the health store after extra validation. 16029// For example, the health store may reject the report because of an invalid parameter, like a stale sequence number. 16030// To see whether the report was applied in the health store, get deployed service package health and check that the 16031// report appears in the HealthEvents section. 16032// Parameters: 16033// nodeName - the name of the node. 16034// applicationID - the identity of the application. This is typically the full name of the application without 16035// the 'fabric:' URI scheme. 16036// Starting from version 6.0, hierarchical names are delimited with the "~" character. 16037// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" 16038// in 6.0+ and "myapp/app1" in previous versions. 16039// servicePackageName - the name of the service package. 16040// healthInformation - describes the health information for the health report. This information needs to be 16041// present in all of the health reports sent to the health manager. 16042// immediate - a flag that indicates whether the report should be sent immediately. 16043// A health report is sent to a Service Fabric gateway Application, which forwards to the health store. 16044// If Immediate is set to true, the report is sent immediately from HTTP Gateway to the health store, 16045// regardless of the fabric client settings that the HTTP Gateway Application is using. 16046// This is useful for critical reports that should be sent as soon as possible. 16047// Depending on timing and other conditions, sending the report may still fail, for example if the HTTP Gateway 16048// is closed or the message doesn't reach the Gateway. 16049// If Immediate is set to false, the report is sent based on the health client settings from the HTTP Gateway. 16050// Therefore, it will be batched according to the HealthReportSendInterval configuration. 16051// This is the recommended setting because it allows the health client to optimize health reporting messages to 16052// health store as well as health report processing. 16053// By default, reports are not sent immediately. 16054// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 16055// duration that the client is willing to wait for the requested operation to complete. The default value for 16056// this parameter is 60 seconds. 16057func (client BaseClient) ReportDeployedServicePackageHealth(ctx context.Context, nodeName string, applicationID string, servicePackageName string, healthInformation HealthInformation, immediate *bool, timeout *int64) (result autorest.Response, err error) { 16058 if tracing.IsEnabled() { 16059 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ReportDeployedServicePackageHealth") 16060 defer func() { 16061 sc := -1 16062 if result.Response != nil { 16063 sc = result.Response.StatusCode 16064 } 16065 tracing.EndSpan(ctx, sc, err) 16066 }() 16067 } 16068 if err := validation.Validate([]validation.Validation{ 16069 {TargetValue: healthInformation, 16070 Constraints: []validation.Constraint{{Target: "healthInformation.SourceID", Name: validation.Null, Rule: true, Chain: nil}, 16071 {Target: "healthInformation.Property", Name: validation.Null, Rule: true, Chain: nil}}}, 16072 {TargetValue: timeout, 16073 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 16074 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 16075 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 16076 }}}}}); err != nil { 16077 return result, validation.NewError("servicefabric.BaseClient", "ReportDeployedServicePackageHealth", err.Error()) 16078 } 16079 16080 req, err := client.ReportDeployedServicePackageHealthPreparer(ctx, nodeName, applicationID, servicePackageName, healthInformation, immediate, timeout) 16081 if err != nil { 16082 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ReportDeployedServicePackageHealth", nil, "Failure preparing request") 16083 return 16084 } 16085 16086 resp, err := client.ReportDeployedServicePackageHealthSender(req) 16087 if err != nil { 16088 result.Response = resp 16089 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ReportDeployedServicePackageHealth", resp, "Failure sending request") 16090 return 16091 } 16092 16093 result, err = client.ReportDeployedServicePackageHealthResponder(resp) 16094 if err != nil { 16095 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ReportDeployedServicePackageHealth", resp, "Failure responding to request") 16096 return 16097 } 16098 16099 return 16100} 16101 16102// ReportDeployedServicePackageHealthPreparer prepares the ReportDeployedServicePackageHealth request. 16103func (client BaseClient) ReportDeployedServicePackageHealthPreparer(ctx context.Context, nodeName string, applicationID string, servicePackageName string, healthInformation HealthInformation, immediate *bool, timeout *int64) (*http.Request, error) { 16104 pathParameters := map[string]interface{}{ 16105 "applicationId": applicationID, 16106 "nodeName": autorest.Encode("path", nodeName), 16107 "servicePackageName": servicePackageName, 16108 } 16109 16110 const APIVersion = "6.0" 16111 queryParameters := map[string]interface{}{ 16112 "api-version": APIVersion, 16113 } 16114 if immediate != nil { 16115 queryParameters["Immediate"] = autorest.Encode("query", *immediate) 16116 } else { 16117 queryParameters["Immediate"] = autorest.Encode("query", false) 16118 } 16119 if timeout != nil { 16120 queryParameters["timeout"] = autorest.Encode("query", *timeout) 16121 } else { 16122 queryParameters["timeout"] = autorest.Encode("query", 60) 16123 } 16124 16125 preparer := autorest.CreatePreparer( 16126 autorest.AsContentType("application/json; charset=utf-8"), 16127 autorest.AsPost(), 16128 autorest.WithBaseURL(client.BaseURI), 16129 autorest.WithPathParameters("/Nodes/{nodeName}/$/GetApplications/{applicationId}/$/GetServicePackages/{servicePackageName}/$/ReportHealth", pathParameters), 16130 autorest.WithJSON(healthInformation), 16131 autorest.WithQueryParameters(queryParameters)) 16132 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 16133} 16134 16135// ReportDeployedServicePackageHealthSender sends the ReportDeployedServicePackageHealth request. The method will close the 16136// http.Response Body if it receives an error. 16137func (client BaseClient) ReportDeployedServicePackageHealthSender(req *http.Request) (*http.Response, error) { 16138 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 16139} 16140 16141// ReportDeployedServicePackageHealthResponder handles the response to the ReportDeployedServicePackageHealth request. The method always 16142// closes the http.Response Body. 16143func (client BaseClient) ReportDeployedServicePackageHealthResponder(resp *http.Response) (result autorest.Response, err error) { 16144 err = autorest.Respond( 16145 resp, 16146 azure.WithErrorUnlessStatusCode(http.StatusOK), 16147 autorest.ByClosing()) 16148 result.Response = resp 16149 return 16150} 16151 16152// ReportNodeHealth reports health state of the specified Service Fabric node. The report must contain the information 16153// about the source of the health report and property on which it is reported. 16154// The report is sent to a Service Fabric gateway node, which forwards to the health store. 16155// The report may be accepted by the gateway, but rejected by the health store after extra validation. 16156// For example, the health store may reject the report because of an invalid parameter, like a stale sequence number. 16157// To see whether the report was applied in the health store, run GetNodeHealth and check that the report appears in 16158// the HealthEvents section. 16159// Parameters: 16160// nodeName - the name of the node. 16161// healthInformation - describes the health information for the health report. This information needs to be 16162// present in all of the health reports sent to the health manager. 16163// immediate - a flag that indicates whether the report should be sent immediately. 16164// A health report is sent to a Service Fabric gateway Application, which forwards to the health store. 16165// If Immediate is set to true, the report is sent immediately from HTTP Gateway to the health store, 16166// regardless of the fabric client settings that the HTTP Gateway Application is using. 16167// This is useful for critical reports that should be sent as soon as possible. 16168// Depending on timing and other conditions, sending the report may still fail, for example if the HTTP Gateway 16169// is closed or the message doesn't reach the Gateway. 16170// If Immediate is set to false, the report is sent based on the health client settings from the HTTP Gateway. 16171// Therefore, it will be batched according to the HealthReportSendInterval configuration. 16172// This is the recommended setting because it allows the health client to optimize health reporting messages to 16173// health store as well as health report processing. 16174// By default, reports are not sent immediately. 16175// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 16176// duration that the client is willing to wait for the requested operation to complete. The default value for 16177// this parameter is 60 seconds. 16178func (client BaseClient) ReportNodeHealth(ctx context.Context, nodeName string, healthInformation HealthInformation, immediate *bool, timeout *int64) (result autorest.Response, err error) { 16179 if tracing.IsEnabled() { 16180 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ReportNodeHealth") 16181 defer func() { 16182 sc := -1 16183 if result.Response != nil { 16184 sc = result.Response.StatusCode 16185 } 16186 tracing.EndSpan(ctx, sc, err) 16187 }() 16188 } 16189 if err := validation.Validate([]validation.Validation{ 16190 {TargetValue: healthInformation, 16191 Constraints: []validation.Constraint{{Target: "healthInformation.SourceID", Name: validation.Null, Rule: true, Chain: nil}, 16192 {Target: "healthInformation.Property", Name: validation.Null, Rule: true, Chain: nil}}}, 16193 {TargetValue: timeout, 16194 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 16195 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 16196 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 16197 }}}}}); err != nil { 16198 return result, validation.NewError("servicefabric.BaseClient", "ReportNodeHealth", err.Error()) 16199 } 16200 16201 req, err := client.ReportNodeHealthPreparer(ctx, nodeName, healthInformation, immediate, timeout) 16202 if err != nil { 16203 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ReportNodeHealth", nil, "Failure preparing request") 16204 return 16205 } 16206 16207 resp, err := client.ReportNodeHealthSender(req) 16208 if err != nil { 16209 result.Response = resp 16210 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ReportNodeHealth", resp, "Failure sending request") 16211 return 16212 } 16213 16214 result, err = client.ReportNodeHealthResponder(resp) 16215 if err != nil { 16216 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ReportNodeHealth", resp, "Failure responding to request") 16217 return 16218 } 16219 16220 return 16221} 16222 16223// ReportNodeHealthPreparer prepares the ReportNodeHealth request. 16224func (client BaseClient) ReportNodeHealthPreparer(ctx context.Context, nodeName string, healthInformation HealthInformation, immediate *bool, timeout *int64) (*http.Request, error) { 16225 pathParameters := map[string]interface{}{ 16226 "nodeName": autorest.Encode("path", nodeName), 16227 } 16228 16229 const APIVersion = "6.0" 16230 queryParameters := map[string]interface{}{ 16231 "api-version": APIVersion, 16232 } 16233 if immediate != nil { 16234 queryParameters["Immediate"] = autorest.Encode("query", *immediate) 16235 } else { 16236 queryParameters["Immediate"] = autorest.Encode("query", false) 16237 } 16238 if timeout != nil { 16239 queryParameters["timeout"] = autorest.Encode("query", *timeout) 16240 } else { 16241 queryParameters["timeout"] = autorest.Encode("query", 60) 16242 } 16243 16244 preparer := autorest.CreatePreparer( 16245 autorest.AsContentType("application/json; charset=utf-8"), 16246 autorest.AsPost(), 16247 autorest.WithBaseURL(client.BaseURI), 16248 autorest.WithPathParameters("/Nodes/{nodeName}/$/ReportHealth", pathParameters), 16249 autorest.WithJSON(healthInformation), 16250 autorest.WithQueryParameters(queryParameters)) 16251 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 16252} 16253 16254// ReportNodeHealthSender sends the ReportNodeHealth request. The method will close the 16255// http.Response Body if it receives an error. 16256func (client BaseClient) ReportNodeHealthSender(req *http.Request) (*http.Response, error) { 16257 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 16258} 16259 16260// ReportNodeHealthResponder handles the response to the ReportNodeHealth request. The method always 16261// closes the http.Response Body. 16262func (client BaseClient) ReportNodeHealthResponder(resp *http.Response) (result autorest.Response, err error) { 16263 err = autorest.Respond( 16264 resp, 16265 azure.WithErrorUnlessStatusCode(http.StatusOK), 16266 autorest.ByClosing()) 16267 result.Response = resp 16268 return 16269} 16270 16271// ReportPartitionHealth reports health state of the specified Service Fabric partition. The report must contain the 16272// information about the source of the health report and property on which it is reported. 16273// The report is sent to a Service Fabric gateway Partition, which forwards to the health store. 16274// The report may be accepted by the gateway, but rejected by the health store after extra validation. 16275// For example, the health store may reject the report because of an invalid parameter, like a stale sequence number. 16276// To see whether the report was applied in the health store, run GetPartitionHealth and check that the report appears 16277// in the HealthEvents section. 16278// Parameters: 16279// partitionID - the identity of the partition. 16280// healthInformation - describes the health information for the health report. This information needs to be 16281// present in all of the health reports sent to the health manager. 16282// immediate - a flag that indicates whether the report should be sent immediately. 16283// A health report is sent to a Service Fabric gateway Application, which forwards to the health store. 16284// If Immediate is set to true, the report is sent immediately from HTTP Gateway to the health store, 16285// regardless of the fabric client settings that the HTTP Gateway Application is using. 16286// This is useful for critical reports that should be sent as soon as possible. 16287// Depending on timing and other conditions, sending the report may still fail, for example if the HTTP Gateway 16288// is closed or the message doesn't reach the Gateway. 16289// If Immediate is set to false, the report is sent based on the health client settings from the HTTP Gateway. 16290// Therefore, it will be batched according to the HealthReportSendInterval configuration. 16291// This is the recommended setting because it allows the health client to optimize health reporting messages to 16292// health store as well as health report processing. 16293// By default, reports are not sent immediately. 16294// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 16295// duration that the client is willing to wait for the requested operation to complete. The default value for 16296// this parameter is 60 seconds. 16297func (client BaseClient) ReportPartitionHealth(ctx context.Context, partitionID uuid.UUID, healthInformation HealthInformation, immediate *bool, timeout *int64) (result autorest.Response, err error) { 16298 if tracing.IsEnabled() { 16299 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ReportPartitionHealth") 16300 defer func() { 16301 sc := -1 16302 if result.Response != nil { 16303 sc = result.Response.StatusCode 16304 } 16305 tracing.EndSpan(ctx, sc, err) 16306 }() 16307 } 16308 if err := validation.Validate([]validation.Validation{ 16309 {TargetValue: healthInformation, 16310 Constraints: []validation.Constraint{{Target: "healthInformation.SourceID", Name: validation.Null, Rule: true, Chain: nil}, 16311 {Target: "healthInformation.Property", Name: validation.Null, Rule: true, Chain: nil}}}, 16312 {TargetValue: timeout, 16313 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 16314 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 16315 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 16316 }}}}}); err != nil { 16317 return result, validation.NewError("servicefabric.BaseClient", "ReportPartitionHealth", err.Error()) 16318 } 16319 16320 req, err := client.ReportPartitionHealthPreparer(ctx, partitionID, healthInformation, immediate, timeout) 16321 if err != nil { 16322 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ReportPartitionHealth", nil, "Failure preparing request") 16323 return 16324 } 16325 16326 resp, err := client.ReportPartitionHealthSender(req) 16327 if err != nil { 16328 result.Response = resp 16329 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ReportPartitionHealth", resp, "Failure sending request") 16330 return 16331 } 16332 16333 result, err = client.ReportPartitionHealthResponder(resp) 16334 if err != nil { 16335 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ReportPartitionHealth", resp, "Failure responding to request") 16336 return 16337 } 16338 16339 return 16340} 16341 16342// ReportPartitionHealthPreparer prepares the ReportPartitionHealth request. 16343func (client BaseClient) ReportPartitionHealthPreparer(ctx context.Context, partitionID uuid.UUID, healthInformation HealthInformation, immediate *bool, timeout *int64) (*http.Request, error) { 16344 pathParameters := map[string]interface{}{ 16345 "partitionId": partitionID, 16346 } 16347 16348 const APIVersion = "6.0" 16349 queryParameters := map[string]interface{}{ 16350 "api-version": APIVersion, 16351 } 16352 if immediate != nil { 16353 queryParameters["Immediate"] = autorest.Encode("query", *immediate) 16354 } else { 16355 queryParameters["Immediate"] = autorest.Encode("query", false) 16356 } 16357 if timeout != nil { 16358 queryParameters["timeout"] = autorest.Encode("query", *timeout) 16359 } else { 16360 queryParameters["timeout"] = autorest.Encode("query", 60) 16361 } 16362 16363 preparer := autorest.CreatePreparer( 16364 autorest.AsContentType("application/json; charset=utf-8"), 16365 autorest.AsPost(), 16366 autorest.WithBaseURL(client.BaseURI), 16367 autorest.WithPathParameters("/Partitions/{partitionId}/$/ReportHealth", pathParameters), 16368 autorest.WithJSON(healthInformation), 16369 autorest.WithQueryParameters(queryParameters)) 16370 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 16371} 16372 16373// ReportPartitionHealthSender sends the ReportPartitionHealth request. The method will close the 16374// http.Response Body if it receives an error. 16375func (client BaseClient) ReportPartitionHealthSender(req *http.Request) (*http.Response, error) { 16376 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 16377} 16378 16379// ReportPartitionHealthResponder handles the response to the ReportPartitionHealth request. The method always 16380// closes the http.Response Body. 16381func (client BaseClient) ReportPartitionHealthResponder(resp *http.Response) (result autorest.Response, err error) { 16382 err = autorest.Respond( 16383 resp, 16384 azure.WithErrorUnlessStatusCode(http.StatusOK), 16385 autorest.ByClosing()) 16386 result.Response = resp 16387 return 16388} 16389 16390// ReportReplicaHealth reports health state of the specified Service Fabric replica. The report must contain the 16391// information about the source of the health report and property on which it is reported. 16392// The report is sent to a Service Fabric gateway Replica, which forwards to the health store. 16393// The report may be accepted by the gateway, but rejected by the health store after extra validation. 16394// For example, the health store may reject the report because of an invalid parameter, like a stale sequence number. 16395// To see whether the report was applied in the health store, run GetReplicaHealth and check that the report appears in 16396// the HealthEvents section. 16397// Parameters: 16398// partitionID - the identity of the partition. 16399// replicaID - the identifier of the replica. 16400// replicaHealthReportServiceKind - the kind of service replica (Stateless or Stateful) for which the health is 16401// being reported. Following are the possible values. 16402// healthInformation - describes the health information for the health report. This information needs to be 16403// present in all of the health reports sent to the health manager. 16404// immediate - a flag that indicates whether the report should be sent immediately. 16405// A health report is sent to a Service Fabric gateway Application, which forwards to the health store. 16406// If Immediate is set to true, the report is sent immediately from HTTP Gateway to the health store, 16407// regardless of the fabric client settings that the HTTP Gateway Application is using. 16408// This is useful for critical reports that should be sent as soon as possible. 16409// Depending on timing and other conditions, sending the report may still fail, for example if the HTTP Gateway 16410// is closed or the message doesn't reach the Gateway. 16411// If Immediate is set to false, the report is sent based on the health client settings from the HTTP Gateway. 16412// Therefore, it will be batched according to the HealthReportSendInterval configuration. 16413// This is the recommended setting because it allows the health client to optimize health reporting messages to 16414// health store as well as health report processing. 16415// By default, reports are not sent immediately. 16416// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 16417// duration that the client is willing to wait for the requested operation to complete. The default value for 16418// this parameter is 60 seconds. 16419func (client BaseClient) ReportReplicaHealth(ctx context.Context, partitionID uuid.UUID, replicaID string, replicaHealthReportServiceKind ReplicaHealthReportServiceKind, healthInformation HealthInformation, immediate *bool, timeout *int64) (result autorest.Response, err error) { 16420 if tracing.IsEnabled() { 16421 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ReportReplicaHealth") 16422 defer func() { 16423 sc := -1 16424 if result.Response != nil { 16425 sc = result.Response.StatusCode 16426 } 16427 tracing.EndSpan(ctx, sc, err) 16428 }() 16429 } 16430 if err := validation.Validate([]validation.Validation{ 16431 {TargetValue: healthInformation, 16432 Constraints: []validation.Constraint{{Target: "healthInformation.SourceID", Name: validation.Null, Rule: true, Chain: nil}, 16433 {Target: "healthInformation.Property", Name: validation.Null, Rule: true, Chain: nil}}}, 16434 {TargetValue: timeout, 16435 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 16436 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 16437 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 16438 }}}}}); err != nil { 16439 return result, validation.NewError("servicefabric.BaseClient", "ReportReplicaHealth", err.Error()) 16440 } 16441 16442 req, err := client.ReportReplicaHealthPreparer(ctx, partitionID, replicaID, replicaHealthReportServiceKind, healthInformation, immediate, timeout) 16443 if err != nil { 16444 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ReportReplicaHealth", nil, "Failure preparing request") 16445 return 16446 } 16447 16448 resp, err := client.ReportReplicaHealthSender(req) 16449 if err != nil { 16450 result.Response = resp 16451 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ReportReplicaHealth", resp, "Failure sending request") 16452 return 16453 } 16454 16455 result, err = client.ReportReplicaHealthResponder(resp) 16456 if err != nil { 16457 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ReportReplicaHealth", resp, "Failure responding to request") 16458 return 16459 } 16460 16461 return 16462} 16463 16464// ReportReplicaHealthPreparer prepares the ReportReplicaHealth request. 16465func (client BaseClient) ReportReplicaHealthPreparer(ctx context.Context, partitionID uuid.UUID, replicaID string, replicaHealthReportServiceKind ReplicaHealthReportServiceKind, healthInformation HealthInformation, immediate *bool, timeout *int64) (*http.Request, error) { 16466 pathParameters := map[string]interface{}{ 16467 "partitionId": partitionID, 16468 "replicaId": replicaID, 16469 } 16470 16471 const APIVersion = "6.0" 16472 queryParameters := map[string]interface{}{ 16473 "api-version": APIVersion, 16474 "ReplicaHealthReportServiceKind": autorest.Encode("query", replicaHealthReportServiceKind), 16475 } 16476 if immediate != nil { 16477 queryParameters["Immediate"] = autorest.Encode("query", *immediate) 16478 } else { 16479 queryParameters["Immediate"] = autorest.Encode("query", false) 16480 } 16481 if timeout != nil { 16482 queryParameters["timeout"] = autorest.Encode("query", *timeout) 16483 } else { 16484 queryParameters["timeout"] = autorest.Encode("query", 60) 16485 } 16486 16487 preparer := autorest.CreatePreparer( 16488 autorest.AsContentType("application/json; charset=utf-8"), 16489 autorest.AsPost(), 16490 autorest.WithBaseURL(client.BaseURI), 16491 autorest.WithPathParameters("/Partitions/{partitionId}/$/GetReplicas/{replicaId}/$/ReportHealth", pathParameters), 16492 autorest.WithJSON(healthInformation), 16493 autorest.WithQueryParameters(queryParameters)) 16494 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 16495} 16496 16497// ReportReplicaHealthSender sends the ReportReplicaHealth request. The method will close the 16498// http.Response Body if it receives an error. 16499func (client BaseClient) ReportReplicaHealthSender(req *http.Request) (*http.Response, error) { 16500 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 16501} 16502 16503// ReportReplicaHealthResponder handles the response to the ReportReplicaHealth request. The method always 16504// closes the http.Response Body. 16505func (client BaseClient) ReportReplicaHealthResponder(resp *http.Response) (result autorest.Response, err error) { 16506 err = autorest.Respond( 16507 resp, 16508 azure.WithErrorUnlessStatusCode(http.StatusOK), 16509 autorest.ByClosing()) 16510 result.Response = resp 16511 return 16512} 16513 16514// ReportServiceHealth reports health state of the specified Service Fabric service. The report must contain the 16515// information about the source of the health report and property on which it is reported. 16516// The report is sent to a Service Fabric gateway Service, which forwards to the health store. 16517// The report may be accepted by the gateway, but rejected by the health store after extra validation. 16518// For example, the health store may reject the report because of an invalid parameter, like a stale sequence number. 16519// To see whether the report was applied in the health store, run GetServiceHealth and check that the report appears in 16520// the HealthEvents section. 16521// Parameters: 16522// serviceID - the identity of the service. This ID is typically the full name of the service without the 16523// 'fabric:' URI scheme. 16524// Starting from version 6.0, hierarchical names are delimited with the "~" character. 16525// For example, if the service name is "fabric:/myapp/app1/svc1", the service identity would be 16526// "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in previous versions. 16527// healthInformation - describes the health information for the health report. This information needs to be 16528// present in all of the health reports sent to the health manager. 16529// immediate - a flag that indicates whether the report should be sent immediately. 16530// A health report is sent to a Service Fabric gateway Application, which forwards to the health store. 16531// If Immediate is set to true, the report is sent immediately from HTTP Gateway to the health store, 16532// regardless of the fabric client settings that the HTTP Gateway Application is using. 16533// This is useful for critical reports that should be sent as soon as possible. 16534// Depending on timing and other conditions, sending the report may still fail, for example if the HTTP Gateway 16535// is closed or the message doesn't reach the Gateway. 16536// If Immediate is set to false, the report is sent based on the health client settings from the HTTP Gateway. 16537// Therefore, it will be batched according to the HealthReportSendInterval configuration. 16538// This is the recommended setting because it allows the health client to optimize health reporting messages to 16539// health store as well as health report processing. 16540// By default, reports are not sent immediately. 16541// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 16542// duration that the client is willing to wait for the requested operation to complete. The default value for 16543// this parameter is 60 seconds. 16544func (client BaseClient) ReportServiceHealth(ctx context.Context, serviceID string, healthInformation HealthInformation, immediate *bool, timeout *int64) (result autorest.Response, err error) { 16545 if tracing.IsEnabled() { 16546 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ReportServiceHealth") 16547 defer func() { 16548 sc := -1 16549 if result.Response != nil { 16550 sc = result.Response.StatusCode 16551 } 16552 tracing.EndSpan(ctx, sc, err) 16553 }() 16554 } 16555 if err := validation.Validate([]validation.Validation{ 16556 {TargetValue: healthInformation, 16557 Constraints: []validation.Constraint{{Target: "healthInformation.SourceID", Name: validation.Null, Rule: true, Chain: nil}, 16558 {Target: "healthInformation.Property", Name: validation.Null, Rule: true, Chain: nil}}}, 16559 {TargetValue: timeout, 16560 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 16561 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 16562 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 16563 }}}}}); err != nil { 16564 return result, validation.NewError("servicefabric.BaseClient", "ReportServiceHealth", err.Error()) 16565 } 16566 16567 req, err := client.ReportServiceHealthPreparer(ctx, serviceID, healthInformation, immediate, timeout) 16568 if err != nil { 16569 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ReportServiceHealth", nil, "Failure preparing request") 16570 return 16571 } 16572 16573 resp, err := client.ReportServiceHealthSender(req) 16574 if err != nil { 16575 result.Response = resp 16576 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ReportServiceHealth", resp, "Failure sending request") 16577 return 16578 } 16579 16580 result, err = client.ReportServiceHealthResponder(resp) 16581 if err != nil { 16582 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ReportServiceHealth", resp, "Failure responding to request") 16583 return 16584 } 16585 16586 return 16587} 16588 16589// ReportServiceHealthPreparer prepares the ReportServiceHealth request. 16590func (client BaseClient) ReportServiceHealthPreparer(ctx context.Context, serviceID string, healthInformation HealthInformation, immediate *bool, timeout *int64) (*http.Request, error) { 16591 pathParameters := map[string]interface{}{ 16592 "serviceId": serviceID, 16593 } 16594 16595 const APIVersion = "6.0" 16596 queryParameters := map[string]interface{}{ 16597 "api-version": APIVersion, 16598 } 16599 if immediate != nil { 16600 queryParameters["Immediate"] = autorest.Encode("query", *immediate) 16601 } else { 16602 queryParameters["Immediate"] = autorest.Encode("query", false) 16603 } 16604 if timeout != nil { 16605 queryParameters["timeout"] = autorest.Encode("query", *timeout) 16606 } else { 16607 queryParameters["timeout"] = autorest.Encode("query", 60) 16608 } 16609 16610 preparer := autorest.CreatePreparer( 16611 autorest.AsContentType("application/json; charset=utf-8"), 16612 autorest.AsPost(), 16613 autorest.WithBaseURL(client.BaseURI), 16614 autorest.WithPathParameters("/Services/{serviceId}/$/ReportHealth", pathParameters), 16615 autorest.WithJSON(healthInformation), 16616 autorest.WithQueryParameters(queryParameters)) 16617 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 16618} 16619 16620// ReportServiceHealthSender sends the ReportServiceHealth request. The method will close the 16621// http.Response Body if it receives an error. 16622func (client BaseClient) ReportServiceHealthSender(req *http.Request) (*http.Response, error) { 16623 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 16624} 16625 16626// ReportServiceHealthResponder handles the response to the ReportServiceHealth request. The method always 16627// closes the http.Response Body. 16628func (client BaseClient) ReportServiceHealthResponder(resp *http.Response) (result autorest.Response, err error) { 16629 err = autorest.Respond( 16630 resp, 16631 azure.WithErrorUnlessStatusCode(http.StatusOK), 16632 autorest.ByClosing()) 16633 result.Response = resp 16634 return 16635} 16636 16637// ResetPartitionLoad resets the current load of a Service Fabric partition to the default load for the service. 16638// Parameters: 16639// partitionID - the identity of the partition. 16640// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 16641// duration that the client is willing to wait for the requested operation to complete. The default value for 16642// this parameter is 60 seconds. 16643func (client BaseClient) ResetPartitionLoad(ctx context.Context, partitionID uuid.UUID, timeout *int64) (result autorest.Response, err error) { 16644 if tracing.IsEnabled() { 16645 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ResetPartitionLoad") 16646 defer func() { 16647 sc := -1 16648 if result.Response != nil { 16649 sc = result.Response.StatusCode 16650 } 16651 tracing.EndSpan(ctx, sc, err) 16652 }() 16653 } 16654 if err := validation.Validate([]validation.Validation{ 16655 {TargetValue: timeout, 16656 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 16657 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 16658 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 16659 }}}}}); err != nil { 16660 return result, validation.NewError("servicefabric.BaseClient", "ResetPartitionLoad", err.Error()) 16661 } 16662 16663 req, err := client.ResetPartitionLoadPreparer(ctx, partitionID, timeout) 16664 if err != nil { 16665 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ResetPartitionLoad", nil, "Failure preparing request") 16666 return 16667 } 16668 16669 resp, err := client.ResetPartitionLoadSender(req) 16670 if err != nil { 16671 result.Response = resp 16672 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ResetPartitionLoad", resp, "Failure sending request") 16673 return 16674 } 16675 16676 result, err = client.ResetPartitionLoadResponder(resp) 16677 if err != nil { 16678 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ResetPartitionLoad", resp, "Failure responding to request") 16679 return 16680 } 16681 16682 return 16683} 16684 16685// ResetPartitionLoadPreparer prepares the ResetPartitionLoad request. 16686func (client BaseClient) ResetPartitionLoadPreparer(ctx context.Context, partitionID uuid.UUID, timeout *int64) (*http.Request, error) { 16687 pathParameters := map[string]interface{}{ 16688 "partitionId": partitionID, 16689 } 16690 16691 const APIVersion = "6.0" 16692 queryParameters := map[string]interface{}{ 16693 "api-version": APIVersion, 16694 } 16695 if timeout != nil { 16696 queryParameters["timeout"] = autorest.Encode("query", *timeout) 16697 } else { 16698 queryParameters["timeout"] = autorest.Encode("query", 60) 16699 } 16700 16701 preparer := autorest.CreatePreparer( 16702 autorest.AsPost(), 16703 autorest.WithBaseURL(client.BaseURI), 16704 autorest.WithPathParameters("/Partitions/{partitionId}/$/ResetLoad", pathParameters), 16705 autorest.WithQueryParameters(queryParameters)) 16706 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 16707} 16708 16709// ResetPartitionLoadSender sends the ResetPartitionLoad request. The method will close the 16710// http.Response Body if it receives an error. 16711func (client BaseClient) ResetPartitionLoadSender(req *http.Request) (*http.Response, error) { 16712 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 16713} 16714 16715// ResetPartitionLoadResponder handles the response to the ResetPartitionLoad request. The method always 16716// closes the http.Response Body. 16717func (client BaseClient) ResetPartitionLoadResponder(resp *http.Response) (result autorest.Response, err error) { 16718 err = autorest.Respond( 16719 resp, 16720 azure.WithErrorUnlessStatusCode(http.StatusOK), 16721 autorest.ByClosing()) 16722 result.Response = resp 16723 return 16724} 16725 16726// ResolveService resolve a Service Fabric service partition to get the endpoints of the service replicas. 16727// Parameters: 16728// serviceID - the identity of the service. This ID is typically the full name of the service without the 16729// 'fabric:' URI scheme. 16730// Starting from version 6.0, hierarchical names are delimited with the "~" character. 16731// For example, if the service name is "fabric:/myapp/app1/svc1", the service identity would be 16732// "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in previous versions. 16733// partitionKeyType - key type for the partition. This parameter is required if the partition scheme for the 16734// service is Int64Range or Named. The possible values are following. 16735// - None (1) - Indicates that the PartitionKeyValue parameter is not specified. This is valid for the 16736// partitions with partitioning scheme as Singleton. This is the default value. The value is 1. 16737// - Int64Range (2) - Indicates that the PartitionKeyValue parameter is an int64 partition key. This is valid 16738// for the partitions with partitioning scheme as Int64Range. The value is 2. 16739// - Named (3) - Indicates that the PartitionKeyValue parameter is a name of the partition. This is valid for 16740// the partitions with partitioning scheme as Named. The value is 3. 16741// partitionKeyValue - partition key. This is required if the partition scheme for the service is Int64Range or 16742// Named. 16743// This is not the partition ID, but rather, either the integer key value, or the name of the partition ID. 16744// For example, if your service is using ranged partitions from 0 to 10, then they PartitionKeyValue would be 16745// an 16746// integer in that range. Query service description to see the range or name. 16747// previousRspVersion - the value in the Version field of the response that was received previously. This is 16748// required if the user knows that the result that was gotten previously is stale. 16749// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 16750// duration that the client is willing to wait for the requested operation to complete. The default value for 16751// this parameter is 60 seconds. 16752func (client BaseClient) ResolveService(ctx context.Context, serviceID string, partitionKeyType *int32, partitionKeyValue string, previousRspVersion string, timeout *int64) (result ResolvedServicePartition, err error) { 16753 if tracing.IsEnabled() { 16754 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ResolveService") 16755 defer func() { 16756 sc := -1 16757 if result.Response.Response != nil { 16758 sc = result.Response.Response.StatusCode 16759 } 16760 tracing.EndSpan(ctx, sc, err) 16761 }() 16762 } 16763 if err := validation.Validate([]validation.Validation{ 16764 {TargetValue: timeout, 16765 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 16766 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 16767 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 16768 }}}}}); err != nil { 16769 return result, validation.NewError("servicefabric.BaseClient", "ResolveService", err.Error()) 16770 } 16771 16772 req, err := client.ResolveServicePreparer(ctx, serviceID, partitionKeyType, partitionKeyValue, previousRspVersion, timeout) 16773 if err != nil { 16774 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ResolveService", nil, "Failure preparing request") 16775 return 16776 } 16777 16778 resp, err := client.ResolveServiceSender(req) 16779 if err != nil { 16780 result.Response = autorest.Response{Response: resp} 16781 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ResolveService", resp, "Failure sending request") 16782 return 16783 } 16784 16785 result, err = client.ResolveServiceResponder(resp) 16786 if err != nil { 16787 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ResolveService", resp, "Failure responding to request") 16788 return 16789 } 16790 16791 return 16792} 16793 16794// ResolveServicePreparer prepares the ResolveService request. 16795func (client BaseClient) ResolveServicePreparer(ctx context.Context, serviceID string, partitionKeyType *int32, partitionKeyValue string, previousRspVersion string, timeout *int64) (*http.Request, error) { 16796 pathParameters := map[string]interface{}{ 16797 "serviceId": serviceID, 16798 } 16799 16800 const APIVersion = "6.0" 16801 queryParameters := map[string]interface{}{ 16802 "api-version": APIVersion, 16803 } 16804 if partitionKeyType != nil { 16805 queryParameters["PartitionKeyType"] = autorest.Encode("query", *partitionKeyType) 16806 } 16807 if len(partitionKeyValue) > 0 { 16808 queryParameters["PartitionKeyValue"] = partitionKeyValue 16809 } 16810 if len(previousRspVersion) > 0 { 16811 queryParameters["PreviousRspVersion"] = previousRspVersion 16812 } 16813 if timeout != nil { 16814 queryParameters["timeout"] = autorest.Encode("query", *timeout) 16815 } else { 16816 queryParameters["timeout"] = autorest.Encode("query", 60) 16817 } 16818 16819 preparer := autorest.CreatePreparer( 16820 autorest.AsGet(), 16821 autorest.WithBaseURL(client.BaseURI), 16822 autorest.WithPathParameters("/Services/{serviceId}/$/ResolvePartition", pathParameters), 16823 autorest.WithQueryParameters(queryParameters)) 16824 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 16825} 16826 16827// ResolveServiceSender sends the ResolveService request. The method will close the 16828// http.Response Body if it receives an error. 16829func (client BaseClient) ResolveServiceSender(req *http.Request) (*http.Response, error) { 16830 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 16831} 16832 16833// ResolveServiceResponder handles the response to the ResolveService request. The method always 16834// closes the http.Response Body. 16835func (client BaseClient) ResolveServiceResponder(resp *http.Response) (result ResolvedServicePartition, err error) { 16836 err = autorest.Respond( 16837 resp, 16838 azure.WithErrorUnlessStatusCode(http.StatusOK), 16839 autorest.ByUnmarshallingJSON(&result), 16840 autorest.ByClosing()) 16841 result.Response = autorest.Response{Response: resp} 16842 return 16843} 16844 16845// RestartDeployedCodePackage restarts a code package deployed on a Service Fabric node in a cluster. This aborts the 16846// code package process, which will restart all the user service replicas hosted in that process. 16847// Parameters: 16848// nodeName - the name of the node. 16849// applicationID - the identity of the application. This is typically the full name of the application without 16850// the 'fabric:' URI scheme. 16851// Starting from version 6.0, hierarchical names are delimited with the "~" character. 16852// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" 16853// in 6.0+ and "myapp/app1" in previous versions. 16854// restartDeployedCodePackageDescription - describes the deployed code package on Service Fabric node to 16855// restart. 16856// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 16857// duration that the client is willing to wait for the requested operation to complete. The default value for 16858// this parameter is 60 seconds. 16859func (client BaseClient) RestartDeployedCodePackage(ctx context.Context, nodeName string, applicationID string, restartDeployedCodePackageDescription RestartDeployedCodePackageDescription, timeout *int64) (result autorest.Response, err error) { 16860 if tracing.IsEnabled() { 16861 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.RestartDeployedCodePackage") 16862 defer func() { 16863 sc := -1 16864 if result.Response != nil { 16865 sc = result.Response.StatusCode 16866 } 16867 tracing.EndSpan(ctx, sc, err) 16868 }() 16869 } 16870 if err := validation.Validate([]validation.Validation{ 16871 {TargetValue: restartDeployedCodePackageDescription, 16872 Constraints: []validation.Constraint{{Target: "restartDeployedCodePackageDescription.ServiceManifestName", Name: validation.Null, Rule: true, Chain: nil}, 16873 {Target: "restartDeployedCodePackageDescription.CodePackageName", Name: validation.Null, Rule: true, Chain: nil}, 16874 {Target: "restartDeployedCodePackageDescription.CodePackageInstanceID", Name: validation.Null, Rule: true, Chain: nil}}}, 16875 {TargetValue: timeout, 16876 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 16877 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 16878 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 16879 }}}}}); err != nil { 16880 return result, validation.NewError("servicefabric.BaseClient", "RestartDeployedCodePackage", err.Error()) 16881 } 16882 16883 req, err := client.RestartDeployedCodePackagePreparer(ctx, nodeName, applicationID, restartDeployedCodePackageDescription, timeout) 16884 if err != nil { 16885 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RestartDeployedCodePackage", nil, "Failure preparing request") 16886 return 16887 } 16888 16889 resp, err := client.RestartDeployedCodePackageSender(req) 16890 if err != nil { 16891 result.Response = resp 16892 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RestartDeployedCodePackage", resp, "Failure sending request") 16893 return 16894 } 16895 16896 result, err = client.RestartDeployedCodePackageResponder(resp) 16897 if err != nil { 16898 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RestartDeployedCodePackage", resp, "Failure responding to request") 16899 return 16900 } 16901 16902 return 16903} 16904 16905// RestartDeployedCodePackagePreparer prepares the RestartDeployedCodePackage request. 16906func (client BaseClient) RestartDeployedCodePackagePreparer(ctx context.Context, nodeName string, applicationID string, restartDeployedCodePackageDescription RestartDeployedCodePackageDescription, timeout *int64) (*http.Request, error) { 16907 pathParameters := map[string]interface{}{ 16908 "applicationId": applicationID, 16909 "nodeName": autorest.Encode("path", nodeName), 16910 } 16911 16912 const APIVersion = "6.0" 16913 queryParameters := map[string]interface{}{ 16914 "api-version": APIVersion, 16915 } 16916 if timeout != nil { 16917 queryParameters["timeout"] = autorest.Encode("query", *timeout) 16918 } else { 16919 queryParameters["timeout"] = autorest.Encode("query", 60) 16920 } 16921 16922 preparer := autorest.CreatePreparer( 16923 autorest.AsContentType("application/json; charset=utf-8"), 16924 autorest.AsPost(), 16925 autorest.WithBaseURL(client.BaseURI), 16926 autorest.WithPathParameters("/Nodes/{nodeName}/$/GetApplications/{applicationId}/$/GetCodePackages/$/Restart", pathParameters), 16927 autorest.WithJSON(restartDeployedCodePackageDescription), 16928 autorest.WithQueryParameters(queryParameters)) 16929 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 16930} 16931 16932// RestartDeployedCodePackageSender sends the RestartDeployedCodePackage request. The method will close the 16933// http.Response Body if it receives an error. 16934func (client BaseClient) RestartDeployedCodePackageSender(req *http.Request) (*http.Response, error) { 16935 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 16936} 16937 16938// RestartDeployedCodePackageResponder handles the response to the RestartDeployedCodePackage request. The method always 16939// closes the http.Response Body. 16940func (client BaseClient) RestartDeployedCodePackageResponder(resp *http.Response) (result autorest.Response, err error) { 16941 err = autorest.Respond( 16942 resp, 16943 azure.WithErrorUnlessStatusCode(http.StatusOK), 16944 autorest.ByClosing()) 16945 result.Response = resp 16946 return 16947} 16948 16949// RestartNode restarts a Service Fabric cluster node that is already started. 16950// Parameters: 16951// nodeName - the name of the node. 16952// restartNodeDescription - the instance of the node to be restarted and a flag indicating the need to take 16953// dump of the fabric process. 16954// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 16955// duration that the client is willing to wait for the requested operation to complete. The default value for 16956// this parameter is 60 seconds. 16957func (client BaseClient) RestartNode(ctx context.Context, nodeName string, restartNodeDescription RestartNodeDescription, timeout *int64) (result autorest.Response, err error) { 16958 if tracing.IsEnabled() { 16959 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.RestartNode") 16960 defer func() { 16961 sc := -1 16962 if result.Response != nil { 16963 sc = result.Response.StatusCode 16964 } 16965 tracing.EndSpan(ctx, sc, err) 16966 }() 16967 } 16968 if err := validation.Validate([]validation.Validation{ 16969 {TargetValue: restartNodeDescription, 16970 Constraints: []validation.Constraint{{Target: "restartNodeDescription.NodeInstanceID", Name: validation.Null, Rule: true, Chain: nil}}}, 16971 {TargetValue: timeout, 16972 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 16973 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 16974 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 16975 }}}}}); err != nil { 16976 return result, validation.NewError("servicefabric.BaseClient", "RestartNode", err.Error()) 16977 } 16978 16979 req, err := client.RestartNodePreparer(ctx, nodeName, restartNodeDescription, timeout) 16980 if err != nil { 16981 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RestartNode", nil, "Failure preparing request") 16982 return 16983 } 16984 16985 resp, err := client.RestartNodeSender(req) 16986 if err != nil { 16987 result.Response = resp 16988 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RestartNode", resp, "Failure sending request") 16989 return 16990 } 16991 16992 result, err = client.RestartNodeResponder(resp) 16993 if err != nil { 16994 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RestartNode", resp, "Failure responding to request") 16995 return 16996 } 16997 16998 return 16999} 17000 17001// RestartNodePreparer prepares the RestartNode request. 17002func (client BaseClient) RestartNodePreparer(ctx context.Context, nodeName string, restartNodeDescription RestartNodeDescription, timeout *int64) (*http.Request, error) { 17003 pathParameters := map[string]interface{}{ 17004 "nodeName": autorest.Encode("path", nodeName), 17005 } 17006 17007 const APIVersion = "6.0" 17008 queryParameters := map[string]interface{}{ 17009 "api-version": APIVersion, 17010 } 17011 if timeout != nil { 17012 queryParameters["timeout"] = autorest.Encode("query", *timeout) 17013 } else { 17014 queryParameters["timeout"] = autorest.Encode("query", 60) 17015 } 17016 17017 preparer := autorest.CreatePreparer( 17018 autorest.AsContentType("application/json; charset=utf-8"), 17019 autorest.AsPost(), 17020 autorest.WithBaseURL(client.BaseURI), 17021 autorest.WithPathParameters("/Nodes/{nodeName}/$/Restart", pathParameters), 17022 autorest.WithJSON(restartNodeDescription), 17023 autorest.WithQueryParameters(queryParameters)) 17024 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 17025} 17026 17027// RestartNodeSender sends the RestartNode request. The method will close the 17028// http.Response Body if it receives an error. 17029func (client BaseClient) RestartNodeSender(req *http.Request) (*http.Response, error) { 17030 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 17031} 17032 17033// RestartNodeResponder handles the response to the RestartNode request. The method always 17034// closes the http.Response Body. 17035func (client BaseClient) RestartNodeResponder(resp *http.Response) (result autorest.Response, err error) { 17036 err = autorest.Respond( 17037 resp, 17038 azure.WithErrorUnlessStatusCode(http.StatusOK), 17039 autorest.ByClosing()) 17040 result.Response = resp 17041 return 17042} 17043 17044// RestartReplica restarts a service replica of a persisted service running on a node. Warning - There are no safety 17045// checks performed when this API is used. Incorrect use of this API can lead to availability loss for stateful 17046// services. 17047// Parameters: 17048// nodeName - the name of the node. 17049// partitionID - the identity of the partition. 17050// replicaID - the identifier of the replica. 17051// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 17052// duration that the client is willing to wait for the requested operation to complete. The default value for 17053// this parameter is 60 seconds. 17054func (client BaseClient) RestartReplica(ctx context.Context, nodeName string, partitionID uuid.UUID, replicaID string, timeout *int64) (result autorest.Response, err error) { 17055 if tracing.IsEnabled() { 17056 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.RestartReplica") 17057 defer func() { 17058 sc := -1 17059 if result.Response != nil { 17060 sc = result.Response.StatusCode 17061 } 17062 tracing.EndSpan(ctx, sc, err) 17063 }() 17064 } 17065 if err := validation.Validate([]validation.Validation{ 17066 {TargetValue: timeout, 17067 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 17068 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 17069 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 17070 }}}}}); err != nil { 17071 return result, validation.NewError("servicefabric.BaseClient", "RestartReplica", err.Error()) 17072 } 17073 17074 req, err := client.RestartReplicaPreparer(ctx, nodeName, partitionID, replicaID, timeout) 17075 if err != nil { 17076 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RestartReplica", nil, "Failure preparing request") 17077 return 17078 } 17079 17080 resp, err := client.RestartReplicaSender(req) 17081 if err != nil { 17082 result.Response = resp 17083 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RestartReplica", resp, "Failure sending request") 17084 return 17085 } 17086 17087 result, err = client.RestartReplicaResponder(resp) 17088 if err != nil { 17089 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RestartReplica", resp, "Failure responding to request") 17090 return 17091 } 17092 17093 return 17094} 17095 17096// RestartReplicaPreparer prepares the RestartReplica request. 17097func (client BaseClient) RestartReplicaPreparer(ctx context.Context, nodeName string, partitionID uuid.UUID, replicaID string, timeout *int64) (*http.Request, error) { 17098 pathParameters := map[string]interface{}{ 17099 "nodeName": autorest.Encode("path", nodeName), 17100 "partitionId": partitionID, 17101 "replicaId": replicaID, 17102 } 17103 17104 const APIVersion = "6.0" 17105 queryParameters := map[string]interface{}{ 17106 "api-version": APIVersion, 17107 } 17108 if timeout != nil { 17109 queryParameters["timeout"] = autorest.Encode("query", *timeout) 17110 } else { 17111 queryParameters["timeout"] = autorest.Encode("query", 60) 17112 } 17113 17114 preparer := autorest.CreatePreparer( 17115 autorest.AsPost(), 17116 autorest.WithBaseURL(client.BaseURI), 17117 autorest.WithPathParameters("/Nodes/{nodeName}/$/GetPartitions/{partitionId}/$/GetReplicas/{replicaId}/$/Restart", pathParameters), 17118 autorest.WithQueryParameters(queryParameters)) 17119 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 17120} 17121 17122// RestartReplicaSender sends the RestartReplica request. The method will close the 17123// http.Response Body if it receives an error. 17124func (client BaseClient) RestartReplicaSender(req *http.Request) (*http.Response, error) { 17125 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 17126} 17127 17128// RestartReplicaResponder handles the response to the RestartReplica request. The method always 17129// closes the http.Response Body. 17130func (client BaseClient) RestartReplicaResponder(resp *http.Response) (result autorest.Response, err error) { 17131 err = autorest.Respond( 17132 resp, 17133 azure.WithErrorUnlessStatusCode(http.StatusOK), 17134 autorest.ByClosing()) 17135 result.Response = resp 17136 return 17137} 17138 17139// RestorePartition restores the state of a of the stateful persisted partition using the specified backup point. In 17140// case the partition is already being periodically backed up, then by default the backup point is looked for in the 17141// storage specified in backup policy. One can also override the same by specifying the backup storage details as part 17142// of the restore partition description in body. Once the restore is initiated, its progress can be tracked using the 17143// GetRestoreProgress operation. 17144// In case, the operation times out, specify a greater restore timeout value in the query parameter. 17145// Parameters: 17146// partitionID - the identity of the partition. 17147// restorePartitionDescription - describes the parameters to restore the partition. 17148// restoreTimeout - specifies the maximum amount of time to wait, in minutes, for the restore operation to 17149// complete. Post that, the operation returns back with timeout error. However, in certain corner cases it 17150// could be that the restore operation goes through even though it completes with timeout. In case of timeout 17151// error, its recommended to invoke this operation again with a greater timeout value. the default value for 17152// the same is 10 minutes. 17153// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 17154// duration that the client is willing to wait for the requested operation to complete. The default value for 17155// this parameter is 60 seconds. 17156func (client BaseClient) RestorePartition(ctx context.Context, partitionID uuid.UUID, restorePartitionDescription RestorePartitionDescription, restoreTimeout *int32, timeout *int64) (result autorest.Response, err error) { 17157 if tracing.IsEnabled() { 17158 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.RestorePartition") 17159 defer func() { 17160 sc := -1 17161 if result.Response != nil { 17162 sc = result.Response.StatusCode 17163 } 17164 tracing.EndSpan(ctx, sc, err) 17165 }() 17166 } 17167 if err := validation.Validate([]validation.Validation{ 17168 {TargetValue: restorePartitionDescription, 17169 Constraints: []validation.Constraint{{Target: "restorePartitionDescription.BackupID", Name: validation.Null, Rule: true, Chain: nil}, 17170 {Target: "restorePartitionDescription.BackupLocation", Name: validation.Null, Rule: true, Chain: nil}}}, 17171 {TargetValue: timeout, 17172 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 17173 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 17174 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 17175 }}}}}); err != nil { 17176 return result, validation.NewError("servicefabric.BaseClient", "RestorePartition", err.Error()) 17177 } 17178 17179 req, err := client.RestorePartitionPreparer(ctx, partitionID, restorePartitionDescription, restoreTimeout, timeout) 17180 if err != nil { 17181 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RestorePartition", nil, "Failure preparing request") 17182 return 17183 } 17184 17185 resp, err := client.RestorePartitionSender(req) 17186 if err != nil { 17187 result.Response = resp 17188 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RestorePartition", resp, "Failure sending request") 17189 return 17190 } 17191 17192 result, err = client.RestorePartitionResponder(resp) 17193 if err != nil { 17194 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RestorePartition", resp, "Failure responding to request") 17195 return 17196 } 17197 17198 return 17199} 17200 17201// RestorePartitionPreparer prepares the RestorePartition request. 17202func (client BaseClient) RestorePartitionPreparer(ctx context.Context, partitionID uuid.UUID, restorePartitionDescription RestorePartitionDescription, restoreTimeout *int32, timeout *int64) (*http.Request, error) { 17203 pathParameters := map[string]interface{}{ 17204 "partitionId": partitionID, 17205 } 17206 17207 const APIVersion = "6.4" 17208 queryParameters := map[string]interface{}{ 17209 "api-version": APIVersion, 17210 } 17211 if restoreTimeout != nil { 17212 queryParameters["RestoreTimeout"] = autorest.Encode("query", *restoreTimeout) 17213 } else { 17214 queryParameters["RestoreTimeout"] = autorest.Encode("query", 10) 17215 } 17216 if timeout != nil { 17217 queryParameters["timeout"] = autorest.Encode("query", *timeout) 17218 } else { 17219 queryParameters["timeout"] = autorest.Encode("query", 60) 17220 } 17221 17222 preparer := autorest.CreatePreparer( 17223 autorest.AsContentType("application/json; charset=utf-8"), 17224 autorest.AsPost(), 17225 autorest.WithBaseURL(client.BaseURI), 17226 autorest.WithPathParameters("/Partitions/{partitionId}/$/Restore", pathParameters), 17227 autorest.WithJSON(restorePartitionDescription), 17228 autorest.WithQueryParameters(queryParameters)) 17229 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 17230} 17231 17232// RestorePartitionSender sends the RestorePartition request. The method will close the 17233// http.Response Body if it receives an error. 17234func (client BaseClient) RestorePartitionSender(req *http.Request) (*http.Response, error) { 17235 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 17236} 17237 17238// RestorePartitionResponder handles the response to the RestorePartition request. The method always 17239// closes the http.Response Body. 17240func (client BaseClient) RestorePartitionResponder(resp *http.Response) (result autorest.Response, err error) { 17241 err = autorest.Respond( 17242 resp, 17243 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), 17244 autorest.ByClosing()) 17245 result.Response = resp 17246 return 17247} 17248 17249// ResumeApplicationBackup the previously suspended Service Fabric application resumes taking periodic backup as per 17250// the backup policy currently configured for the same. 17251// Parameters: 17252// applicationID - the identity of the application. This is typically the full name of the application without 17253// the 'fabric:' URI scheme. 17254// Starting from version 6.0, hierarchical names are delimited with the "~" character. 17255// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" 17256// in 6.0+ and "myapp/app1" in previous versions. 17257// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 17258// duration that the client is willing to wait for the requested operation to complete. The default value for 17259// this parameter is 60 seconds. 17260func (client BaseClient) ResumeApplicationBackup(ctx context.Context, applicationID string, timeout *int64) (result autorest.Response, err error) { 17261 if tracing.IsEnabled() { 17262 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ResumeApplicationBackup") 17263 defer func() { 17264 sc := -1 17265 if result.Response != nil { 17266 sc = result.Response.StatusCode 17267 } 17268 tracing.EndSpan(ctx, sc, err) 17269 }() 17270 } 17271 if err := validation.Validate([]validation.Validation{ 17272 {TargetValue: timeout, 17273 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 17274 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 17275 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 17276 }}}}}); err != nil { 17277 return result, validation.NewError("servicefabric.BaseClient", "ResumeApplicationBackup", err.Error()) 17278 } 17279 17280 req, err := client.ResumeApplicationBackupPreparer(ctx, applicationID, timeout) 17281 if err != nil { 17282 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ResumeApplicationBackup", nil, "Failure preparing request") 17283 return 17284 } 17285 17286 resp, err := client.ResumeApplicationBackupSender(req) 17287 if err != nil { 17288 result.Response = resp 17289 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ResumeApplicationBackup", resp, "Failure sending request") 17290 return 17291 } 17292 17293 result, err = client.ResumeApplicationBackupResponder(resp) 17294 if err != nil { 17295 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ResumeApplicationBackup", resp, "Failure responding to request") 17296 return 17297 } 17298 17299 return 17300} 17301 17302// ResumeApplicationBackupPreparer prepares the ResumeApplicationBackup request. 17303func (client BaseClient) ResumeApplicationBackupPreparer(ctx context.Context, applicationID string, timeout *int64) (*http.Request, error) { 17304 pathParameters := map[string]interface{}{ 17305 "applicationId": applicationID, 17306 } 17307 17308 const APIVersion = "6.4" 17309 queryParameters := map[string]interface{}{ 17310 "api-version": APIVersion, 17311 } 17312 if timeout != nil { 17313 queryParameters["timeout"] = autorest.Encode("query", *timeout) 17314 } else { 17315 queryParameters["timeout"] = autorest.Encode("query", 60) 17316 } 17317 17318 preparer := autorest.CreatePreparer( 17319 autorest.AsPost(), 17320 autorest.WithBaseURL(client.BaseURI), 17321 autorest.WithPathParameters("/Applications/{applicationId}/$/ResumeBackup", pathParameters), 17322 autorest.WithQueryParameters(queryParameters)) 17323 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 17324} 17325 17326// ResumeApplicationBackupSender sends the ResumeApplicationBackup request. The method will close the 17327// http.Response Body if it receives an error. 17328func (client BaseClient) ResumeApplicationBackupSender(req *http.Request) (*http.Response, error) { 17329 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 17330} 17331 17332// ResumeApplicationBackupResponder handles the response to the ResumeApplicationBackup request. The method always 17333// closes the http.Response Body. 17334func (client BaseClient) ResumeApplicationBackupResponder(resp *http.Response) (result autorest.Response, err error) { 17335 err = autorest.Respond( 17336 resp, 17337 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), 17338 autorest.ByClosing()) 17339 result.Response = resp 17340 return 17341} 17342 17343// ResumeApplicationUpgrade resumes an unmonitored manual Service Fabric application upgrade. Service Fabric upgrades 17344// one upgrade domain at a time. For unmonitored manual upgrades, after Service Fabric finishes an upgrade domain, it 17345// waits for you to call this API before proceeding to the next upgrade domain. 17346// Parameters: 17347// applicationID - the identity of the application. This is typically the full name of the application without 17348// the 'fabric:' URI scheme. 17349// Starting from version 6.0, hierarchical names are delimited with the "~" character. 17350// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" 17351// in 6.0+ and "myapp/app1" in previous versions. 17352// resumeApplicationUpgradeDescription - describes the parameters for resuming an application upgrade. 17353// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 17354// duration that the client is willing to wait for the requested operation to complete. The default value for 17355// this parameter is 60 seconds. 17356func (client BaseClient) ResumeApplicationUpgrade(ctx context.Context, applicationID string, resumeApplicationUpgradeDescription ResumeApplicationUpgradeDescription, timeout *int64) (result autorest.Response, err error) { 17357 if tracing.IsEnabled() { 17358 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ResumeApplicationUpgrade") 17359 defer func() { 17360 sc := -1 17361 if result.Response != nil { 17362 sc = result.Response.StatusCode 17363 } 17364 tracing.EndSpan(ctx, sc, err) 17365 }() 17366 } 17367 if err := validation.Validate([]validation.Validation{ 17368 {TargetValue: resumeApplicationUpgradeDescription, 17369 Constraints: []validation.Constraint{{Target: "resumeApplicationUpgradeDescription.UpgradeDomainName", Name: validation.Null, Rule: true, Chain: nil}}}, 17370 {TargetValue: timeout, 17371 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 17372 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 17373 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 17374 }}}}}); err != nil { 17375 return result, validation.NewError("servicefabric.BaseClient", "ResumeApplicationUpgrade", err.Error()) 17376 } 17377 17378 req, err := client.ResumeApplicationUpgradePreparer(ctx, applicationID, resumeApplicationUpgradeDescription, timeout) 17379 if err != nil { 17380 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ResumeApplicationUpgrade", nil, "Failure preparing request") 17381 return 17382 } 17383 17384 resp, err := client.ResumeApplicationUpgradeSender(req) 17385 if err != nil { 17386 result.Response = resp 17387 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ResumeApplicationUpgrade", resp, "Failure sending request") 17388 return 17389 } 17390 17391 result, err = client.ResumeApplicationUpgradeResponder(resp) 17392 if err != nil { 17393 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ResumeApplicationUpgrade", resp, "Failure responding to request") 17394 return 17395 } 17396 17397 return 17398} 17399 17400// ResumeApplicationUpgradePreparer prepares the ResumeApplicationUpgrade request. 17401func (client BaseClient) ResumeApplicationUpgradePreparer(ctx context.Context, applicationID string, resumeApplicationUpgradeDescription ResumeApplicationUpgradeDescription, timeout *int64) (*http.Request, error) { 17402 pathParameters := map[string]interface{}{ 17403 "applicationId": applicationID, 17404 } 17405 17406 const APIVersion = "6.0" 17407 queryParameters := map[string]interface{}{ 17408 "api-version": APIVersion, 17409 } 17410 if timeout != nil { 17411 queryParameters["timeout"] = autorest.Encode("query", *timeout) 17412 } else { 17413 queryParameters["timeout"] = autorest.Encode("query", 60) 17414 } 17415 17416 preparer := autorest.CreatePreparer( 17417 autorest.AsContentType("application/json; charset=utf-8"), 17418 autorest.AsPost(), 17419 autorest.WithBaseURL(client.BaseURI), 17420 autorest.WithPathParameters("/Applications/{applicationId}/$/MoveToNextUpgradeDomain", pathParameters), 17421 autorest.WithJSON(resumeApplicationUpgradeDescription), 17422 autorest.WithQueryParameters(queryParameters)) 17423 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 17424} 17425 17426// ResumeApplicationUpgradeSender sends the ResumeApplicationUpgrade request. The method will close the 17427// http.Response Body if it receives an error. 17428func (client BaseClient) ResumeApplicationUpgradeSender(req *http.Request) (*http.Response, error) { 17429 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 17430} 17431 17432// ResumeApplicationUpgradeResponder handles the response to the ResumeApplicationUpgrade request. The method always 17433// closes the http.Response Body. 17434func (client BaseClient) ResumeApplicationUpgradeResponder(resp *http.Response) (result autorest.Response, err error) { 17435 err = autorest.Respond( 17436 resp, 17437 azure.WithErrorUnlessStatusCode(http.StatusOK), 17438 autorest.ByClosing()) 17439 result.Response = resp 17440 return 17441} 17442 17443// ResumeClusterUpgrade make the cluster code or configuration upgrade move on to the next upgrade domain if 17444// appropriate. 17445// Parameters: 17446// resumeClusterUpgradeDescription - describes the parameters for resuming a cluster upgrade. 17447// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 17448// duration that the client is willing to wait for the requested operation to complete. The default value for 17449// this parameter is 60 seconds. 17450func (client BaseClient) ResumeClusterUpgrade(ctx context.Context, resumeClusterUpgradeDescription ResumeClusterUpgradeDescription, timeout *int64) (result autorest.Response, err error) { 17451 if tracing.IsEnabled() { 17452 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ResumeClusterUpgrade") 17453 defer func() { 17454 sc := -1 17455 if result.Response != nil { 17456 sc = result.Response.StatusCode 17457 } 17458 tracing.EndSpan(ctx, sc, err) 17459 }() 17460 } 17461 if err := validation.Validate([]validation.Validation{ 17462 {TargetValue: resumeClusterUpgradeDescription, 17463 Constraints: []validation.Constraint{{Target: "resumeClusterUpgradeDescription.UpgradeDomain", Name: validation.Null, Rule: true, Chain: nil}}}, 17464 {TargetValue: timeout, 17465 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 17466 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 17467 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 17468 }}}}}); err != nil { 17469 return result, validation.NewError("servicefabric.BaseClient", "ResumeClusterUpgrade", err.Error()) 17470 } 17471 17472 req, err := client.ResumeClusterUpgradePreparer(ctx, resumeClusterUpgradeDescription, timeout) 17473 if err != nil { 17474 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ResumeClusterUpgrade", nil, "Failure preparing request") 17475 return 17476 } 17477 17478 resp, err := client.ResumeClusterUpgradeSender(req) 17479 if err != nil { 17480 result.Response = resp 17481 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ResumeClusterUpgrade", resp, "Failure sending request") 17482 return 17483 } 17484 17485 result, err = client.ResumeClusterUpgradeResponder(resp) 17486 if err != nil { 17487 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ResumeClusterUpgrade", resp, "Failure responding to request") 17488 return 17489 } 17490 17491 return 17492} 17493 17494// ResumeClusterUpgradePreparer prepares the ResumeClusterUpgrade request. 17495func (client BaseClient) ResumeClusterUpgradePreparer(ctx context.Context, resumeClusterUpgradeDescription ResumeClusterUpgradeDescription, timeout *int64) (*http.Request, error) { 17496 const APIVersion = "6.0" 17497 queryParameters := map[string]interface{}{ 17498 "api-version": APIVersion, 17499 } 17500 if timeout != nil { 17501 queryParameters["timeout"] = autorest.Encode("query", *timeout) 17502 } else { 17503 queryParameters["timeout"] = autorest.Encode("query", 60) 17504 } 17505 17506 preparer := autorest.CreatePreparer( 17507 autorest.AsContentType("application/json; charset=utf-8"), 17508 autorest.AsPost(), 17509 autorest.WithBaseURL(client.BaseURI), 17510 autorest.WithPath("/$/MoveToNextUpgradeDomain"), 17511 autorest.WithJSON(resumeClusterUpgradeDescription), 17512 autorest.WithQueryParameters(queryParameters)) 17513 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 17514} 17515 17516// ResumeClusterUpgradeSender sends the ResumeClusterUpgrade request. The method will close the 17517// http.Response Body if it receives an error. 17518func (client BaseClient) ResumeClusterUpgradeSender(req *http.Request) (*http.Response, error) { 17519 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 17520} 17521 17522// ResumeClusterUpgradeResponder handles the response to the ResumeClusterUpgrade request. The method always 17523// closes the http.Response Body. 17524func (client BaseClient) ResumeClusterUpgradeResponder(resp *http.Response) (result autorest.Response, err error) { 17525 err = autorest.Respond( 17526 resp, 17527 azure.WithErrorUnlessStatusCode(http.StatusOK), 17528 autorest.ByClosing()) 17529 result.Response = resp 17530 return 17531} 17532 17533// ResumePartitionBackup the previously suspended partition resumes taking periodic backup as per the backup policy 17534// currently configured for the same. 17535// Parameters: 17536// partitionID - the identity of the partition. 17537// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 17538// duration that the client is willing to wait for the requested operation to complete. The default value for 17539// this parameter is 60 seconds. 17540func (client BaseClient) ResumePartitionBackup(ctx context.Context, partitionID uuid.UUID, timeout *int64) (result autorest.Response, err error) { 17541 if tracing.IsEnabled() { 17542 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ResumePartitionBackup") 17543 defer func() { 17544 sc := -1 17545 if result.Response != nil { 17546 sc = result.Response.StatusCode 17547 } 17548 tracing.EndSpan(ctx, sc, err) 17549 }() 17550 } 17551 if err := validation.Validate([]validation.Validation{ 17552 {TargetValue: timeout, 17553 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 17554 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 17555 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 17556 }}}}}); err != nil { 17557 return result, validation.NewError("servicefabric.BaseClient", "ResumePartitionBackup", err.Error()) 17558 } 17559 17560 req, err := client.ResumePartitionBackupPreparer(ctx, partitionID, timeout) 17561 if err != nil { 17562 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ResumePartitionBackup", nil, "Failure preparing request") 17563 return 17564 } 17565 17566 resp, err := client.ResumePartitionBackupSender(req) 17567 if err != nil { 17568 result.Response = resp 17569 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ResumePartitionBackup", resp, "Failure sending request") 17570 return 17571 } 17572 17573 result, err = client.ResumePartitionBackupResponder(resp) 17574 if err != nil { 17575 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ResumePartitionBackup", resp, "Failure responding to request") 17576 return 17577 } 17578 17579 return 17580} 17581 17582// ResumePartitionBackupPreparer prepares the ResumePartitionBackup request. 17583func (client BaseClient) ResumePartitionBackupPreparer(ctx context.Context, partitionID uuid.UUID, timeout *int64) (*http.Request, error) { 17584 pathParameters := map[string]interface{}{ 17585 "partitionId": partitionID, 17586 } 17587 17588 const APIVersion = "6.4" 17589 queryParameters := map[string]interface{}{ 17590 "api-version": APIVersion, 17591 } 17592 if timeout != nil { 17593 queryParameters["timeout"] = autorest.Encode("query", *timeout) 17594 } else { 17595 queryParameters["timeout"] = autorest.Encode("query", 60) 17596 } 17597 17598 preparer := autorest.CreatePreparer( 17599 autorest.AsPost(), 17600 autorest.WithBaseURL(client.BaseURI), 17601 autorest.WithPathParameters("/Partitions/{partitionId}/$/ResumeBackup", pathParameters), 17602 autorest.WithQueryParameters(queryParameters)) 17603 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 17604} 17605 17606// ResumePartitionBackupSender sends the ResumePartitionBackup request. The method will close the 17607// http.Response Body if it receives an error. 17608func (client BaseClient) ResumePartitionBackupSender(req *http.Request) (*http.Response, error) { 17609 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 17610} 17611 17612// ResumePartitionBackupResponder handles the response to the ResumePartitionBackup request. The method always 17613// closes the http.Response Body. 17614func (client BaseClient) ResumePartitionBackupResponder(resp *http.Response) (result autorest.Response, err error) { 17615 err = autorest.Respond( 17616 resp, 17617 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), 17618 autorest.ByClosing()) 17619 result.Response = resp 17620 return 17621} 17622 17623// ResumeServiceBackup the previously suspended Service Fabric service resumes taking periodic backup as per the backup 17624// policy currently configured for the same. 17625// Parameters: 17626// serviceID - the identity of the service. This ID is typically the full name of the service without the 17627// 'fabric:' URI scheme. 17628// Starting from version 6.0, hierarchical names are delimited with the "~" character. 17629// For example, if the service name is "fabric:/myapp/app1/svc1", the service identity would be 17630// "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in previous versions. 17631// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 17632// duration that the client is willing to wait for the requested operation to complete. The default value for 17633// this parameter is 60 seconds. 17634func (client BaseClient) ResumeServiceBackup(ctx context.Context, serviceID string, timeout *int64) (result autorest.Response, err error) { 17635 if tracing.IsEnabled() { 17636 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ResumeServiceBackup") 17637 defer func() { 17638 sc := -1 17639 if result.Response != nil { 17640 sc = result.Response.StatusCode 17641 } 17642 tracing.EndSpan(ctx, sc, err) 17643 }() 17644 } 17645 if err := validation.Validate([]validation.Validation{ 17646 {TargetValue: timeout, 17647 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 17648 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 17649 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 17650 }}}}}); err != nil { 17651 return result, validation.NewError("servicefabric.BaseClient", "ResumeServiceBackup", err.Error()) 17652 } 17653 17654 req, err := client.ResumeServiceBackupPreparer(ctx, serviceID, timeout) 17655 if err != nil { 17656 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ResumeServiceBackup", nil, "Failure preparing request") 17657 return 17658 } 17659 17660 resp, err := client.ResumeServiceBackupSender(req) 17661 if err != nil { 17662 result.Response = resp 17663 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ResumeServiceBackup", resp, "Failure sending request") 17664 return 17665 } 17666 17667 result, err = client.ResumeServiceBackupResponder(resp) 17668 if err != nil { 17669 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "ResumeServiceBackup", resp, "Failure responding to request") 17670 return 17671 } 17672 17673 return 17674} 17675 17676// ResumeServiceBackupPreparer prepares the ResumeServiceBackup request. 17677func (client BaseClient) ResumeServiceBackupPreparer(ctx context.Context, serviceID string, timeout *int64) (*http.Request, error) { 17678 pathParameters := map[string]interface{}{ 17679 "serviceId": serviceID, 17680 } 17681 17682 const APIVersion = "6.4" 17683 queryParameters := map[string]interface{}{ 17684 "api-version": APIVersion, 17685 } 17686 if timeout != nil { 17687 queryParameters["timeout"] = autorest.Encode("query", *timeout) 17688 } else { 17689 queryParameters["timeout"] = autorest.Encode("query", 60) 17690 } 17691 17692 preparer := autorest.CreatePreparer( 17693 autorest.AsPost(), 17694 autorest.WithBaseURL(client.BaseURI), 17695 autorest.WithPathParameters("/Services/{serviceId}/$/ResumeBackup", pathParameters), 17696 autorest.WithQueryParameters(queryParameters)) 17697 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 17698} 17699 17700// ResumeServiceBackupSender sends the ResumeServiceBackup request. The method will close the 17701// http.Response Body if it receives an error. 17702func (client BaseClient) ResumeServiceBackupSender(req *http.Request) (*http.Response, error) { 17703 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 17704} 17705 17706// ResumeServiceBackupResponder handles the response to the ResumeServiceBackup request. The method always 17707// closes the http.Response Body. 17708func (client BaseClient) ResumeServiceBackupResponder(resp *http.Response) (result autorest.Response, err error) { 17709 err = autorest.Respond( 17710 resp, 17711 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), 17712 autorest.ByClosing()) 17713 result.Response = resp 17714 return 17715} 17716 17717// RollbackApplicationUpgrade starts rolling back the current application upgrade to the previous version. This API can 17718// only be used to roll back the current in-progress upgrade that is rolling forward to new version. If the application 17719// is not currently being upgraded use StartApplicationUpgrade API to upgrade it to desired version, including rolling 17720// back to a previous version. 17721// Parameters: 17722// applicationID - the identity of the application. This is typically the full name of the application without 17723// the 'fabric:' URI scheme. 17724// Starting from version 6.0, hierarchical names are delimited with the "~" character. 17725// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" 17726// in 6.0+ and "myapp/app1" in previous versions. 17727// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 17728// duration that the client is willing to wait for the requested operation to complete. The default value for 17729// this parameter is 60 seconds. 17730func (client BaseClient) RollbackApplicationUpgrade(ctx context.Context, applicationID string, timeout *int64) (result autorest.Response, err error) { 17731 if tracing.IsEnabled() { 17732 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.RollbackApplicationUpgrade") 17733 defer func() { 17734 sc := -1 17735 if result.Response != nil { 17736 sc = result.Response.StatusCode 17737 } 17738 tracing.EndSpan(ctx, sc, err) 17739 }() 17740 } 17741 if err := validation.Validate([]validation.Validation{ 17742 {TargetValue: timeout, 17743 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 17744 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 17745 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 17746 }}}}}); err != nil { 17747 return result, validation.NewError("servicefabric.BaseClient", "RollbackApplicationUpgrade", err.Error()) 17748 } 17749 17750 req, err := client.RollbackApplicationUpgradePreparer(ctx, applicationID, timeout) 17751 if err != nil { 17752 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RollbackApplicationUpgrade", nil, "Failure preparing request") 17753 return 17754 } 17755 17756 resp, err := client.RollbackApplicationUpgradeSender(req) 17757 if err != nil { 17758 result.Response = resp 17759 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RollbackApplicationUpgrade", resp, "Failure sending request") 17760 return 17761 } 17762 17763 result, err = client.RollbackApplicationUpgradeResponder(resp) 17764 if err != nil { 17765 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RollbackApplicationUpgrade", resp, "Failure responding to request") 17766 return 17767 } 17768 17769 return 17770} 17771 17772// RollbackApplicationUpgradePreparer prepares the RollbackApplicationUpgrade request. 17773func (client BaseClient) RollbackApplicationUpgradePreparer(ctx context.Context, applicationID string, timeout *int64) (*http.Request, error) { 17774 pathParameters := map[string]interface{}{ 17775 "applicationId": applicationID, 17776 } 17777 17778 const APIVersion = "6.0" 17779 queryParameters := map[string]interface{}{ 17780 "api-version": APIVersion, 17781 } 17782 if timeout != nil { 17783 queryParameters["timeout"] = autorest.Encode("query", *timeout) 17784 } else { 17785 queryParameters["timeout"] = autorest.Encode("query", 60) 17786 } 17787 17788 preparer := autorest.CreatePreparer( 17789 autorest.AsPost(), 17790 autorest.WithBaseURL(client.BaseURI), 17791 autorest.WithPathParameters("/Applications/{applicationId}/$/RollbackUpgrade", pathParameters), 17792 autorest.WithQueryParameters(queryParameters)) 17793 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 17794} 17795 17796// RollbackApplicationUpgradeSender sends the RollbackApplicationUpgrade request. The method will close the 17797// http.Response Body if it receives an error. 17798func (client BaseClient) RollbackApplicationUpgradeSender(req *http.Request) (*http.Response, error) { 17799 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 17800} 17801 17802// RollbackApplicationUpgradeResponder handles the response to the RollbackApplicationUpgrade request. The method always 17803// closes the http.Response Body. 17804func (client BaseClient) RollbackApplicationUpgradeResponder(resp *http.Response) (result autorest.Response, err error) { 17805 err = autorest.Respond( 17806 resp, 17807 azure.WithErrorUnlessStatusCode(http.StatusOK), 17808 autorest.ByClosing()) 17809 result.Response = resp 17810 return 17811} 17812 17813// RollbackClusterUpgrade roll back the code or configuration upgrade of a Service Fabric cluster. 17814// Parameters: 17815// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 17816// duration that the client is willing to wait for the requested operation to complete. The default value for 17817// this parameter is 60 seconds. 17818func (client BaseClient) RollbackClusterUpgrade(ctx context.Context, timeout *int64) (result autorest.Response, err error) { 17819 if tracing.IsEnabled() { 17820 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.RollbackClusterUpgrade") 17821 defer func() { 17822 sc := -1 17823 if result.Response != nil { 17824 sc = result.Response.StatusCode 17825 } 17826 tracing.EndSpan(ctx, sc, err) 17827 }() 17828 } 17829 if err := validation.Validate([]validation.Validation{ 17830 {TargetValue: timeout, 17831 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 17832 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 17833 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 17834 }}}}}); err != nil { 17835 return result, validation.NewError("servicefabric.BaseClient", "RollbackClusterUpgrade", err.Error()) 17836 } 17837 17838 req, err := client.RollbackClusterUpgradePreparer(ctx, timeout) 17839 if err != nil { 17840 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RollbackClusterUpgrade", nil, "Failure preparing request") 17841 return 17842 } 17843 17844 resp, err := client.RollbackClusterUpgradeSender(req) 17845 if err != nil { 17846 result.Response = resp 17847 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RollbackClusterUpgrade", resp, "Failure sending request") 17848 return 17849 } 17850 17851 result, err = client.RollbackClusterUpgradeResponder(resp) 17852 if err != nil { 17853 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "RollbackClusterUpgrade", resp, "Failure responding to request") 17854 return 17855 } 17856 17857 return 17858} 17859 17860// RollbackClusterUpgradePreparer prepares the RollbackClusterUpgrade request. 17861func (client BaseClient) RollbackClusterUpgradePreparer(ctx context.Context, timeout *int64) (*http.Request, error) { 17862 const APIVersion = "6.0" 17863 queryParameters := map[string]interface{}{ 17864 "api-version": APIVersion, 17865 } 17866 if timeout != nil { 17867 queryParameters["timeout"] = autorest.Encode("query", *timeout) 17868 } else { 17869 queryParameters["timeout"] = autorest.Encode("query", 60) 17870 } 17871 17872 preparer := autorest.CreatePreparer( 17873 autorest.AsPost(), 17874 autorest.WithBaseURL(client.BaseURI), 17875 autorest.WithPath("/$/RollbackUpgrade"), 17876 autorest.WithQueryParameters(queryParameters)) 17877 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 17878} 17879 17880// RollbackClusterUpgradeSender sends the RollbackClusterUpgrade request. The method will close the 17881// http.Response Body if it receives an error. 17882func (client BaseClient) RollbackClusterUpgradeSender(req *http.Request) (*http.Response, error) { 17883 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 17884} 17885 17886// RollbackClusterUpgradeResponder handles the response to the RollbackClusterUpgrade request. The method always 17887// closes the http.Response Body. 17888func (client BaseClient) RollbackClusterUpgradeResponder(resp *http.Response) (result autorest.Response, err error) { 17889 err = autorest.Respond( 17890 resp, 17891 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), 17892 autorest.ByClosing()) 17893 result.Response = resp 17894 return 17895} 17896 17897// SetUpgradeOrchestrationServiceState update the service state of Service Fabric Upgrade Orchestration Service. This 17898// API is internally used for support purposes. 17899// Parameters: 17900// upgradeOrchestrationServiceState - service state of Service Fabric Upgrade Orchestration Service. 17901// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 17902// duration that the client is willing to wait for the requested operation to complete. The default value for 17903// this parameter is 60 seconds. 17904func (client BaseClient) SetUpgradeOrchestrationServiceState(ctx context.Context, upgradeOrchestrationServiceState UpgradeOrchestrationServiceState, timeout *int64) (result UpgradeOrchestrationServiceStateSummary, err error) { 17905 if tracing.IsEnabled() { 17906 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.SetUpgradeOrchestrationServiceState") 17907 defer func() { 17908 sc := -1 17909 if result.Response.Response != nil { 17910 sc = result.Response.Response.StatusCode 17911 } 17912 tracing.EndSpan(ctx, sc, err) 17913 }() 17914 } 17915 if err := validation.Validate([]validation.Validation{ 17916 {TargetValue: timeout, 17917 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 17918 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 17919 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 17920 }}}}}); err != nil { 17921 return result, validation.NewError("servicefabric.BaseClient", "SetUpgradeOrchestrationServiceState", err.Error()) 17922 } 17923 17924 req, err := client.SetUpgradeOrchestrationServiceStatePreparer(ctx, upgradeOrchestrationServiceState, timeout) 17925 if err != nil { 17926 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "SetUpgradeOrchestrationServiceState", nil, "Failure preparing request") 17927 return 17928 } 17929 17930 resp, err := client.SetUpgradeOrchestrationServiceStateSender(req) 17931 if err != nil { 17932 result.Response = autorest.Response{Response: resp} 17933 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "SetUpgradeOrchestrationServiceState", resp, "Failure sending request") 17934 return 17935 } 17936 17937 result, err = client.SetUpgradeOrchestrationServiceStateResponder(resp) 17938 if err != nil { 17939 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "SetUpgradeOrchestrationServiceState", resp, "Failure responding to request") 17940 return 17941 } 17942 17943 return 17944} 17945 17946// SetUpgradeOrchestrationServiceStatePreparer prepares the SetUpgradeOrchestrationServiceState request. 17947func (client BaseClient) SetUpgradeOrchestrationServiceStatePreparer(ctx context.Context, upgradeOrchestrationServiceState UpgradeOrchestrationServiceState, timeout *int64) (*http.Request, error) { 17948 const APIVersion = "6.0" 17949 queryParameters := map[string]interface{}{ 17950 "api-version": APIVersion, 17951 } 17952 if timeout != nil { 17953 queryParameters["timeout"] = autorest.Encode("query", *timeout) 17954 } else { 17955 queryParameters["timeout"] = autorest.Encode("query", 60) 17956 } 17957 17958 preparer := autorest.CreatePreparer( 17959 autorest.AsContentType("application/json; charset=utf-8"), 17960 autorest.AsPost(), 17961 autorest.WithBaseURL(client.BaseURI), 17962 autorest.WithPath("/$/SetUpgradeOrchestrationServiceState"), 17963 autorest.WithJSON(upgradeOrchestrationServiceState), 17964 autorest.WithQueryParameters(queryParameters)) 17965 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 17966} 17967 17968// SetUpgradeOrchestrationServiceStateSender sends the SetUpgradeOrchestrationServiceState request. The method will close the 17969// http.Response Body if it receives an error. 17970func (client BaseClient) SetUpgradeOrchestrationServiceStateSender(req *http.Request) (*http.Response, error) { 17971 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 17972} 17973 17974// SetUpgradeOrchestrationServiceStateResponder handles the response to the SetUpgradeOrchestrationServiceState request. The method always 17975// closes the http.Response Body. 17976func (client BaseClient) SetUpgradeOrchestrationServiceStateResponder(resp *http.Response) (result UpgradeOrchestrationServiceStateSummary, err error) { 17977 err = autorest.Respond( 17978 resp, 17979 azure.WithErrorUnlessStatusCode(http.StatusOK), 17980 autorest.ByUnmarshallingJSON(&result), 17981 autorest.ByClosing()) 17982 result.Response = autorest.Response{Response: resp} 17983 return 17984} 17985 17986// StartApplicationUpgrade validates the supplied application upgrade parameters and starts upgrading the application 17987// if the parameters are valid. 17988// Parameters: 17989// applicationID - the identity of the application. This is typically the full name of the application without 17990// the 'fabric:' URI scheme. 17991// Starting from version 6.0, hierarchical names are delimited with the "~" character. 17992// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" 17993// in 6.0+ and "myapp/app1" in previous versions. 17994// applicationUpgradeDescription - parameters for an application upgrade. 17995// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 17996// duration that the client is willing to wait for the requested operation to complete. The default value for 17997// this parameter is 60 seconds. 17998func (client BaseClient) StartApplicationUpgrade(ctx context.Context, applicationID string, applicationUpgradeDescription ApplicationUpgradeDescription, timeout *int64) (result autorest.Response, err error) { 17999 if tracing.IsEnabled() { 18000 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.StartApplicationUpgrade") 18001 defer func() { 18002 sc := -1 18003 if result.Response != nil { 18004 sc = result.Response.StatusCode 18005 } 18006 tracing.EndSpan(ctx, sc, err) 18007 }() 18008 } 18009 if err := validation.Validate([]validation.Validation{ 18010 {TargetValue: applicationUpgradeDescription, 18011 Constraints: []validation.Constraint{{Target: "applicationUpgradeDescription.Name", Name: validation.Null, Rule: true, Chain: nil}, 18012 {Target: "applicationUpgradeDescription.TargetApplicationTypeVersion", Name: validation.Null, Rule: true, Chain: nil}, 18013 {Target: "applicationUpgradeDescription.Parameters", Name: validation.Null, Rule: true, Chain: nil}}}, 18014 {TargetValue: timeout, 18015 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 18016 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 18017 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 18018 }}}}}); err != nil { 18019 return result, validation.NewError("servicefabric.BaseClient", "StartApplicationUpgrade", err.Error()) 18020 } 18021 18022 req, err := client.StartApplicationUpgradePreparer(ctx, applicationID, applicationUpgradeDescription, timeout) 18023 if err != nil { 18024 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartApplicationUpgrade", nil, "Failure preparing request") 18025 return 18026 } 18027 18028 resp, err := client.StartApplicationUpgradeSender(req) 18029 if err != nil { 18030 result.Response = resp 18031 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartApplicationUpgrade", resp, "Failure sending request") 18032 return 18033 } 18034 18035 result, err = client.StartApplicationUpgradeResponder(resp) 18036 if err != nil { 18037 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartApplicationUpgrade", resp, "Failure responding to request") 18038 return 18039 } 18040 18041 return 18042} 18043 18044// StartApplicationUpgradePreparer prepares the StartApplicationUpgrade request. 18045func (client BaseClient) StartApplicationUpgradePreparer(ctx context.Context, applicationID string, applicationUpgradeDescription ApplicationUpgradeDescription, timeout *int64) (*http.Request, error) { 18046 pathParameters := map[string]interface{}{ 18047 "applicationId": applicationID, 18048 } 18049 18050 const APIVersion = "6.0" 18051 queryParameters := map[string]interface{}{ 18052 "api-version": APIVersion, 18053 } 18054 if timeout != nil { 18055 queryParameters["timeout"] = autorest.Encode("query", *timeout) 18056 } else { 18057 queryParameters["timeout"] = autorest.Encode("query", 60) 18058 } 18059 18060 preparer := autorest.CreatePreparer( 18061 autorest.AsContentType("application/json; charset=utf-8"), 18062 autorest.AsPost(), 18063 autorest.WithBaseURL(client.BaseURI), 18064 autorest.WithPathParameters("/Applications/{applicationId}/$/Upgrade", pathParameters), 18065 autorest.WithJSON(applicationUpgradeDescription), 18066 autorest.WithQueryParameters(queryParameters)) 18067 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 18068} 18069 18070// StartApplicationUpgradeSender sends the StartApplicationUpgrade request. The method will close the 18071// http.Response Body if it receives an error. 18072func (client BaseClient) StartApplicationUpgradeSender(req *http.Request) (*http.Response, error) { 18073 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 18074} 18075 18076// StartApplicationUpgradeResponder handles the response to the StartApplicationUpgrade request. The method always 18077// closes the http.Response Body. 18078func (client BaseClient) StartApplicationUpgradeResponder(resp *http.Response) (result autorest.Response, err error) { 18079 err = autorest.Respond( 18080 resp, 18081 azure.WithErrorUnlessStatusCode(http.StatusOK), 18082 autorest.ByClosing()) 18083 result.Response = resp 18084 return 18085} 18086 18087// StartChaos if Chaos is not already running in the cluster, it starts Chaos with the passed in Chaos parameters. 18088// If Chaos is already running when this call is made, the call fails with the error code 18089// FABRIC_E_CHAOS_ALREADY_RUNNING. 18090// Refer to the article [Induce controlled Chaos in Service Fabric 18091// clusters](https://docs.microsoft.com/azure/service-fabric/service-fabric-controlled-chaos) for more details. 18092// Parameters: 18093// chaosParameters - describes all the parameters to configure a Chaos run. 18094// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 18095// duration that the client is willing to wait for the requested operation to complete. The default value for 18096// this parameter is 60 seconds. 18097func (client BaseClient) StartChaos(ctx context.Context, chaosParameters ChaosParameters, timeout *int64) (result autorest.Response, err error) { 18098 if tracing.IsEnabled() { 18099 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.StartChaos") 18100 defer func() { 18101 sc := -1 18102 if result.Response != nil { 18103 sc = result.Response.StatusCode 18104 } 18105 tracing.EndSpan(ctx, sc, err) 18106 }() 18107 } 18108 if err := validation.Validate([]validation.Validation{ 18109 {TargetValue: chaosParameters, 18110 Constraints: []validation.Constraint{{Target: "chaosParameters.MaxClusterStabilizationTimeoutInSeconds", Name: validation.Null, Rule: false, 18111 Chain: []validation.Constraint{{Target: "chaosParameters.MaxClusterStabilizationTimeoutInSeconds", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 18112 {Target: "chaosParameters.MaxClusterStabilizationTimeoutInSeconds", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}, 18113 }}, 18114 {Target: "chaosParameters.MaxConcurrentFaults", Name: validation.Null, Rule: false, 18115 Chain: []validation.Constraint{{Target: "chaosParameters.MaxConcurrentFaults", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 18116 {Target: "chaosParameters.MaxConcurrentFaults", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}, 18117 }}, 18118 {Target: "chaosParameters.WaitTimeBetweenFaultsInSeconds", Name: validation.Null, Rule: false, 18119 Chain: []validation.Constraint{{Target: "chaosParameters.WaitTimeBetweenFaultsInSeconds", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 18120 {Target: "chaosParameters.WaitTimeBetweenFaultsInSeconds", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}, 18121 }}, 18122 {Target: "chaosParameters.WaitTimeBetweenIterationsInSeconds", Name: validation.Null, Rule: false, 18123 Chain: []validation.Constraint{{Target: "chaosParameters.WaitTimeBetweenIterationsInSeconds", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 18124 {Target: "chaosParameters.WaitTimeBetweenIterationsInSeconds", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}, 18125 }}}}, 18126 {TargetValue: timeout, 18127 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 18128 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 18129 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 18130 }}}}}); err != nil { 18131 return result, validation.NewError("servicefabric.BaseClient", "StartChaos", err.Error()) 18132 } 18133 18134 req, err := client.StartChaosPreparer(ctx, chaosParameters, timeout) 18135 if err != nil { 18136 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartChaos", nil, "Failure preparing request") 18137 return 18138 } 18139 18140 resp, err := client.StartChaosSender(req) 18141 if err != nil { 18142 result.Response = resp 18143 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartChaos", resp, "Failure sending request") 18144 return 18145 } 18146 18147 result, err = client.StartChaosResponder(resp) 18148 if err != nil { 18149 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartChaos", resp, "Failure responding to request") 18150 return 18151 } 18152 18153 return 18154} 18155 18156// StartChaosPreparer prepares the StartChaos request. 18157func (client BaseClient) StartChaosPreparer(ctx context.Context, chaosParameters ChaosParameters, timeout *int64) (*http.Request, error) { 18158 const APIVersion = "6.0" 18159 queryParameters := map[string]interface{}{ 18160 "api-version": APIVersion, 18161 } 18162 if timeout != nil { 18163 queryParameters["timeout"] = autorest.Encode("query", *timeout) 18164 } else { 18165 queryParameters["timeout"] = autorest.Encode("query", 60) 18166 } 18167 18168 preparer := autorest.CreatePreparer( 18169 autorest.AsContentType("application/json; charset=utf-8"), 18170 autorest.AsPost(), 18171 autorest.WithBaseURL(client.BaseURI), 18172 autorest.WithPath("/Tools/Chaos/$/Start"), 18173 autorest.WithJSON(chaosParameters), 18174 autorest.WithQueryParameters(queryParameters)) 18175 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 18176} 18177 18178// StartChaosSender sends the StartChaos request. The method will close the 18179// http.Response Body if it receives an error. 18180func (client BaseClient) StartChaosSender(req *http.Request) (*http.Response, error) { 18181 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 18182} 18183 18184// StartChaosResponder handles the response to the StartChaos request. The method always 18185// closes the http.Response Body. 18186func (client BaseClient) StartChaosResponder(resp *http.Response) (result autorest.Response, err error) { 18187 err = autorest.Respond( 18188 resp, 18189 azure.WithErrorUnlessStatusCode(http.StatusOK), 18190 autorest.ByClosing()) 18191 result.Response = resp 18192 return 18193} 18194 18195// StartClusterConfigurationUpgrade validate the supplied configuration upgrade parameters and start upgrading the 18196// cluster configuration if the parameters are valid. 18197// Parameters: 18198// clusterConfigurationUpgradeDescription - parameters for a standalone cluster configuration upgrade. 18199// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 18200// duration that the client is willing to wait for the requested operation to complete. The default value for 18201// this parameter is 60 seconds. 18202func (client BaseClient) StartClusterConfigurationUpgrade(ctx context.Context, clusterConfigurationUpgradeDescription ClusterConfigurationUpgradeDescription, timeout *int64) (result autorest.Response, err error) { 18203 if tracing.IsEnabled() { 18204 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.StartClusterConfigurationUpgrade") 18205 defer func() { 18206 sc := -1 18207 if result.Response != nil { 18208 sc = result.Response.StatusCode 18209 } 18210 tracing.EndSpan(ctx, sc, err) 18211 }() 18212 } 18213 if err := validation.Validate([]validation.Validation{ 18214 {TargetValue: clusterConfigurationUpgradeDescription, 18215 Constraints: []validation.Constraint{{Target: "clusterConfigurationUpgradeDescription.ClusterConfig", Name: validation.Null, Rule: true, Chain: nil}}}, 18216 {TargetValue: timeout, 18217 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 18218 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 18219 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 18220 }}}}}); err != nil { 18221 return result, validation.NewError("servicefabric.BaseClient", "StartClusterConfigurationUpgrade", err.Error()) 18222 } 18223 18224 req, err := client.StartClusterConfigurationUpgradePreparer(ctx, clusterConfigurationUpgradeDescription, timeout) 18225 if err != nil { 18226 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartClusterConfigurationUpgrade", nil, "Failure preparing request") 18227 return 18228 } 18229 18230 resp, err := client.StartClusterConfigurationUpgradeSender(req) 18231 if err != nil { 18232 result.Response = resp 18233 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartClusterConfigurationUpgrade", resp, "Failure sending request") 18234 return 18235 } 18236 18237 result, err = client.StartClusterConfigurationUpgradeResponder(resp) 18238 if err != nil { 18239 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartClusterConfigurationUpgrade", resp, "Failure responding to request") 18240 return 18241 } 18242 18243 return 18244} 18245 18246// StartClusterConfigurationUpgradePreparer prepares the StartClusterConfigurationUpgrade request. 18247func (client BaseClient) StartClusterConfigurationUpgradePreparer(ctx context.Context, clusterConfigurationUpgradeDescription ClusterConfigurationUpgradeDescription, timeout *int64) (*http.Request, error) { 18248 const APIVersion = "6.0" 18249 queryParameters := map[string]interface{}{ 18250 "api-version": APIVersion, 18251 } 18252 if timeout != nil { 18253 queryParameters["timeout"] = autorest.Encode("query", *timeout) 18254 } else { 18255 queryParameters["timeout"] = autorest.Encode("query", 60) 18256 } 18257 18258 preparer := autorest.CreatePreparer( 18259 autorest.AsContentType("application/json; charset=utf-8"), 18260 autorest.AsPost(), 18261 autorest.WithBaseURL(client.BaseURI), 18262 autorest.WithPath("/$/StartClusterConfigurationUpgrade"), 18263 autorest.WithJSON(clusterConfigurationUpgradeDescription), 18264 autorest.WithQueryParameters(queryParameters)) 18265 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 18266} 18267 18268// StartClusterConfigurationUpgradeSender sends the StartClusterConfigurationUpgrade request. The method will close the 18269// http.Response Body if it receives an error. 18270func (client BaseClient) StartClusterConfigurationUpgradeSender(req *http.Request) (*http.Response, error) { 18271 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 18272} 18273 18274// StartClusterConfigurationUpgradeResponder handles the response to the StartClusterConfigurationUpgrade request. The method always 18275// closes the http.Response Body. 18276func (client BaseClient) StartClusterConfigurationUpgradeResponder(resp *http.Response) (result autorest.Response, err error) { 18277 err = autorest.Respond( 18278 resp, 18279 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), 18280 autorest.ByClosing()) 18281 result.Response = resp 18282 return 18283} 18284 18285// StartClusterUpgrade validate the supplied upgrade parameters and start upgrading the code or configuration version 18286// of a Service Fabric cluster if the parameters are valid. 18287// Parameters: 18288// startClusterUpgradeDescription - describes the parameters for starting a cluster upgrade. 18289// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 18290// duration that the client is willing to wait for the requested operation to complete. The default value for 18291// this parameter is 60 seconds. 18292func (client BaseClient) StartClusterUpgrade(ctx context.Context, startClusterUpgradeDescription StartClusterUpgradeDescription, timeout *int64) (result autorest.Response, err error) { 18293 if tracing.IsEnabled() { 18294 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.StartClusterUpgrade") 18295 defer func() { 18296 sc := -1 18297 if result.Response != nil { 18298 sc = result.Response.StatusCode 18299 } 18300 tracing.EndSpan(ctx, sc, err) 18301 }() 18302 } 18303 if err := validation.Validate([]validation.Validation{ 18304 {TargetValue: startClusterUpgradeDescription, 18305 Constraints: []validation.Constraint{{Target: "startClusterUpgradeDescription.ClusterUpgradeHealthPolicy", Name: validation.Null, Rule: false, 18306 Chain: []validation.Constraint{{Target: "startClusterUpgradeDescription.ClusterUpgradeHealthPolicy.MaxPercentDeltaUnhealthyNodes", Name: validation.Null, Rule: false, 18307 Chain: []validation.Constraint{{Target: "startClusterUpgradeDescription.ClusterUpgradeHealthPolicy.MaxPercentDeltaUnhealthyNodes", Name: validation.InclusiveMaximum, Rule: int64(100), Chain: nil}, 18308 {Target: "startClusterUpgradeDescription.ClusterUpgradeHealthPolicy.MaxPercentDeltaUnhealthyNodes", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}, 18309 }}, 18310 {Target: "startClusterUpgradeDescription.ClusterUpgradeHealthPolicy.MaxPercentUpgradeDomainDeltaUnhealthyNodes", Name: validation.Null, Rule: false, 18311 Chain: []validation.Constraint{{Target: "startClusterUpgradeDescription.ClusterUpgradeHealthPolicy.MaxPercentUpgradeDomainDeltaUnhealthyNodes", Name: validation.InclusiveMaximum, Rule: int64(100), Chain: nil}, 18312 {Target: "startClusterUpgradeDescription.ClusterUpgradeHealthPolicy.MaxPercentUpgradeDomainDeltaUnhealthyNodes", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}, 18313 }}, 18314 }}}}, 18315 {TargetValue: timeout, 18316 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 18317 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 18318 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 18319 }}}}}); err != nil { 18320 return result, validation.NewError("servicefabric.BaseClient", "StartClusterUpgrade", err.Error()) 18321 } 18322 18323 req, err := client.StartClusterUpgradePreparer(ctx, startClusterUpgradeDescription, timeout) 18324 if err != nil { 18325 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartClusterUpgrade", nil, "Failure preparing request") 18326 return 18327 } 18328 18329 resp, err := client.StartClusterUpgradeSender(req) 18330 if err != nil { 18331 result.Response = resp 18332 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartClusterUpgrade", resp, "Failure sending request") 18333 return 18334 } 18335 18336 result, err = client.StartClusterUpgradeResponder(resp) 18337 if err != nil { 18338 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartClusterUpgrade", resp, "Failure responding to request") 18339 return 18340 } 18341 18342 return 18343} 18344 18345// StartClusterUpgradePreparer prepares the StartClusterUpgrade request. 18346func (client BaseClient) StartClusterUpgradePreparer(ctx context.Context, startClusterUpgradeDescription StartClusterUpgradeDescription, timeout *int64) (*http.Request, error) { 18347 const APIVersion = "6.0" 18348 queryParameters := map[string]interface{}{ 18349 "api-version": APIVersion, 18350 } 18351 if timeout != nil { 18352 queryParameters["timeout"] = autorest.Encode("query", *timeout) 18353 } else { 18354 queryParameters["timeout"] = autorest.Encode("query", 60) 18355 } 18356 18357 preparer := autorest.CreatePreparer( 18358 autorest.AsContentType("application/json; charset=utf-8"), 18359 autorest.AsPost(), 18360 autorest.WithBaseURL(client.BaseURI), 18361 autorest.WithPath("/$/Upgrade"), 18362 autorest.WithJSON(startClusterUpgradeDescription), 18363 autorest.WithQueryParameters(queryParameters)) 18364 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 18365} 18366 18367// StartClusterUpgradeSender sends the StartClusterUpgrade request. The method will close the 18368// http.Response Body if it receives an error. 18369func (client BaseClient) StartClusterUpgradeSender(req *http.Request) (*http.Response, error) { 18370 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 18371} 18372 18373// StartClusterUpgradeResponder handles the response to the StartClusterUpgrade request. The method always 18374// closes the http.Response Body. 18375func (client BaseClient) StartClusterUpgradeResponder(resp *http.Response) (result autorest.Response, err error) { 18376 err = autorest.Respond( 18377 resp, 18378 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), 18379 autorest.ByClosing()) 18380 result.Response = resp 18381 return 18382} 18383 18384// StartComposeDeploymentUpgrade validates the supplied upgrade parameters and starts upgrading the deployment if the 18385// parameters are valid. 18386// Parameters: 18387// deploymentName - the identity of the deployment. 18388// composeDeploymentUpgradeDescription - parameters for upgrading compose deployment. 18389// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 18390// duration that the client is willing to wait for the requested operation to complete. The default value for 18391// this parameter is 60 seconds. 18392func (client BaseClient) StartComposeDeploymentUpgrade(ctx context.Context, deploymentName string, composeDeploymentUpgradeDescription ComposeDeploymentUpgradeDescription, timeout *int64) (result autorest.Response, err error) { 18393 if tracing.IsEnabled() { 18394 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.StartComposeDeploymentUpgrade") 18395 defer func() { 18396 sc := -1 18397 if result.Response != nil { 18398 sc = result.Response.StatusCode 18399 } 18400 tracing.EndSpan(ctx, sc, err) 18401 }() 18402 } 18403 if err := validation.Validate([]validation.Validation{ 18404 {TargetValue: composeDeploymentUpgradeDescription, 18405 Constraints: []validation.Constraint{{Target: "composeDeploymentUpgradeDescription.DeploymentName", Name: validation.Null, Rule: true, Chain: nil}, 18406 {Target: "composeDeploymentUpgradeDescription.ComposeFileContent", Name: validation.Null, Rule: true, Chain: nil}}}, 18407 {TargetValue: timeout, 18408 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 18409 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 18410 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 18411 }}}}}); err != nil { 18412 return result, validation.NewError("servicefabric.BaseClient", "StartComposeDeploymentUpgrade", err.Error()) 18413 } 18414 18415 req, err := client.StartComposeDeploymentUpgradePreparer(ctx, deploymentName, composeDeploymentUpgradeDescription, timeout) 18416 if err != nil { 18417 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartComposeDeploymentUpgrade", nil, "Failure preparing request") 18418 return 18419 } 18420 18421 resp, err := client.StartComposeDeploymentUpgradeSender(req) 18422 if err != nil { 18423 result.Response = resp 18424 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartComposeDeploymentUpgrade", resp, "Failure sending request") 18425 return 18426 } 18427 18428 result, err = client.StartComposeDeploymentUpgradeResponder(resp) 18429 if err != nil { 18430 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartComposeDeploymentUpgrade", resp, "Failure responding to request") 18431 return 18432 } 18433 18434 return 18435} 18436 18437// StartComposeDeploymentUpgradePreparer prepares the StartComposeDeploymentUpgrade request. 18438func (client BaseClient) StartComposeDeploymentUpgradePreparer(ctx context.Context, deploymentName string, composeDeploymentUpgradeDescription ComposeDeploymentUpgradeDescription, timeout *int64) (*http.Request, error) { 18439 pathParameters := map[string]interface{}{ 18440 "deploymentName": deploymentName, 18441 } 18442 18443 const APIVersion = "6.0-preview" 18444 queryParameters := map[string]interface{}{ 18445 "api-version": APIVersion, 18446 } 18447 if timeout != nil { 18448 queryParameters["timeout"] = autorest.Encode("query", *timeout) 18449 } else { 18450 queryParameters["timeout"] = autorest.Encode("query", 60) 18451 } 18452 18453 preparer := autorest.CreatePreparer( 18454 autorest.AsContentType("application/json; charset=utf-8"), 18455 autorest.AsPost(), 18456 autorest.WithBaseURL(client.BaseURI), 18457 autorest.WithPathParameters("/ComposeDeployments/{deploymentName}/$/Upgrade", pathParameters), 18458 autorest.WithJSON(composeDeploymentUpgradeDescription), 18459 autorest.WithQueryParameters(queryParameters)) 18460 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 18461} 18462 18463// StartComposeDeploymentUpgradeSender sends the StartComposeDeploymentUpgrade request. The method will close the 18464// http.Response Body if it receives an error. 18465func (client BaseClient) StartComposeDeploymentUpgradeSender(req *http.Request) (*http.Response, error) { 18466 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 18467} 18468 18469// StartComposeDeploymentUpgradeResponder handles the response to the StartComposeDeploymentUpgrade request. The method always 18470// closes the http.Response Body. 18471func (client BaseClient) StartComposeDeploymentUpgradeResponder(resp *http.Response) (result autorest.Response, err error) { 18472 err = autorest.Respond( 18473 resp, 18474 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), 18475 autorest.ByClosing()) 18476 result.Response = resp 18477 return 18478} 18479 18480// StartDataLoss this API will induce data loss for the specified partition. It will trigger a call to the OnDataLoss 18481// API of the partition. 18482// Actual data loss will depend on the specified DataLossMode. 18483// 18484// - PartialDataLoss - Only a quorum of replicas are removed and OnDataLoss is triggered for the partition but actual 18485// data loss depends on the presence of in-flight replication. 18486// - FullDataLoss - All replicas are removed hence all data is lost and OnDataLoss is triggered. 18487// 18488// This API should only be called with a stateful service as the target. 18489// 18490// Calling this API with a system service as the target is not advised. 18491// 18492// Note: Once this API has been called, it cannot be reversed. Calling CancelOperation will only stop execution and 18493// clean up internal system state. 18494// It will not restore data if the command has progressed far enough to cause data loss. 18495// 18496// Call the GetDataLossProgress API with the same OperationId to return information on the operation started with this 18497// API. 18498// Parameters: 18499// serviceID - the identity of the service. This ID is typically the full name of the service without the 18500// 'fabric:' URI scheme. 18501// Starting from version 6.0, hierarchical names are delimited with the "~" character. 18502// For example, if the service name is "fabric:/myapp/app1/svc1", the service identity would be 18503// "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in previous versions. 18504// partitionID - the identity of the partition. 18505// operationID - a GUID that identifies a call of this API. This is passed into the corresponding GetProgress 18506// API 18507// dataLossMode - this enum is passed to the StartDataLoss API to indicate what type of data loss to induce. 18508// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 18509// duration that the client is willing to wait for the requested operation to complete. The default value for 18510// this parameter is 60 seconds. 18511func (client BaseClient) StartDataLoss(ctx context.Context, serviceID string, partitionID uuid.UUID, operationID uuid.UUID, dataLossMode DataLossMode, timeout *int64) (result autorest.Response, err error) { 18512 if tracing.IsEnabled() { 18513 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.StartDataLoss") 18514 defer func() { 18515 sc := -1 18516 if result.Response != nil { 18517 sc = result.Response.StatusCode 18518 } 18519 tracing.EndSpan(ctx, sc, err) 18520 }() 18521 } 18522 if err := validation.Validate([]validation.Validation{ 18523 {TargetValue: timeout, 18524 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 18525 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 18526 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 18527 }}}}}); err != nil { 18528 return result, validation.NewError("servicefabric.BaseClient", "StartDataLoss", err.Error()) 18529 } 18530 18531 req, err := client.StartDataLossPreparer(ctx, serviceID, partitionID, operationID, dataLossMode, timeout) 18532 if err != nil { 18533 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartDataLoss", nil, "Failure preparing request") 18534 return 18535 } 18536 18537 resp, err := client.StartDataLossSender(req) 18538 if err != nil { 18539 result.Response = resp 18540 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartDataLoss", resp, "Failure sending request") 18541 return 18542 } 18543 18544 result, err = client.StartDataLossResponder(resp) 18545 if err != nil { 18546 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartDataLoss", resp, "Failure responding to request") 18547 return 18548 } 18549 18550 return 18551} 18552 18553// StartDataLossPreparer prepares the StartDataLoss request. 18554func (client BaseClient) StartDataLossPreparer(ctx context.Context, serviceID string, partitionID uuid.UUID, operationID uuid.UUID, dataLossMode DataLossMode, timeout *int64) (*http.Request, error) { 18555 pathParameters := map[string]interface{}{ 18556 "partitionId": partitionID, 18557 "serviceId": serviceID, 18558 } 18559 18560 const APIVersion = "6.0" 18561 queryParameters := map[string]interface{}{ 18562 "api-version": APIVersion, 18563 "DataLossMode": autorest.Encode("query", dataLossMode), 18564 "OperationId": autorest.Encode("query", operationID), 18565 } 18566 if timeout != nil { 18567 queryParameters["timeout"] = autorest.Encode("query", *timeout) 18568 } else { 18569 queryParameters["timeout"] = autorest.Encode("query", 60) 18570 } 18571 18572 preparer := autorest.CreatePreparer( 18573 autorest.AsPost(), 18574 autorest.WithBaseURL(client.BaseURI), 18575 autorest.WithPathParameters("/Faults/Services/{serviceId}/$/GetPartitions/{partitionId}/$/StartDataLoss", pathParameters), 18576 autorest.WithQueryParameters(queryParameters)) 18577 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 18578} 18579 18580// StartDataLossSender sends the StartDataLoss request. The method will close the 18581// http.Response Body if it receives an error. 18582func (client BaseClient) StartDataLossSender(req *http.Request) (*http.Response, error) { 18583 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 18584} 18585 18586// StartDataLossResponder handles the response to the StartDataLoss request. The method always 18587// closes the http.Response Body. 18588func (client BaseClient) StartDataLossResponder(resp *http.Response) (result autorest.Response, err error) { 18589 err = autorest.Respond( 18590 resp, 18591 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), 18592 autorest.ByClosing()) 18593 result.Response = resp 18594 return 18595} 18596 18597// StartNodeTransition starts or stops a cluster node. A cluster node is a process, not the OS instance itself. To 18598// start a node, pass in "Start" for the NodeTransitionType parameter. 18599// To stop a node, pass in "Stop" for the NodeTransitionType parameter. This API starts the operation - when the API 18600// returns the node may not have finished transitioning yet. 18601// Call GetNodeTransitionProgress with the same OperationId to get the progress of the operation. 18602// Parameters: 18603// nodeName - the name of the node. 18604// operationID - a GUID that identifies a call of this API. This is passed into the corresponding GetProgress 18605// API 18606// nodeTransitionType - indicates the type of transition to perform. NodeTransitionType.Start will start a 18607// stopped node. NodeTransitionType.Stop will stop a node that is up. 18608// nodeInstanceID - the node instance ID of the target node. This can be determined through GetNodeInfo API. 18609// stopDurationInSeconds - the duration, in seconds, to keep the node stopped. The minimum value is 600, the 18610// maximum is 14400. After this time expires, the node will automatically come back up. 18611// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 18612// duration that the client is willing to wait for the requested operation to complete. The default value for 18613// this parameter is 60 seconds. 18614func (client BaseClient) StartNodeTransition(ctx context.Context, nodeName string, operationID uuid.UUID, nodeTransitionType NodeTransitionType, nodeInstanceID string, stopDurationInSeconds int32, timeout *int64) (result autorest.Response, err error) { 18615 if tracing.IsEnabled() { 18616 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.StartNodeTransition") 18617 defer func() { 18618 sc := -1 18619 if result.Response != nil { 18620 sc = result.Response.StatusCode 18621 } 18622 tracing.EndSpan(ctx, sc, err) 18623 }() 18624 } 18625 if err := validation.Validate([]validation.Validation{ 18626 {TargetValue: stopDurationInSeconds, 18627 Constraints: []validation.Constraint{{Target: "stopDurationInSeconds", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}}}, 18628 {TargetValue: timeout, 18629 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 18630 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 18631 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 18632 }}}}}); err != nil { 18633 return result, validation.NewError("servicefabric.BaseClient", "StartNodeTransition", err.Error()) 18634 } 18635 18636 req, err := client.StartNodeTransitionPreparer(ctx, nodeName, operationID, nodeTransitionType, nodeInstanceID, stopDurationInSeconds, timeout) 18637 if err != nil { 18638 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartNodeTransition", nil, "Failure preparing request") 18639 return 18640 } 18641 18642 resp, err := client.StartNodeTransitionSender(req) 18643 if err != nil { 18644 result.Response = resp 18645 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartNodeTransition", resp, "Failure sending request") 18646 return 18647 } 18648 18649 result, err = client.StartNodeTransitionResponder(resp) 18650 if err != nil { 18651 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartNodeTransition", resp, "Failure responding to request") 18652 return 18653 } 18654 18655 return 18656} 18657 18658// StartNodeTransitionPreparer prepares the StartNodeTransition request. 18659func (client BaseClient) StartNodeTransitionPreparer(ctx context.Context, nodeName string, operationID uuid.UUID, nodeTransitionType NodeTransitionType, nodeInstanceID string, stopDurationInSeconds int32, timeout *int64) (*http.Request, error) { 18660 pathParameters := map[string]interface{}{ 18661 "nodeName": autorest.Encode("path", nodeName), 18662 } 18663 18664 const APIVersion = "6.0" 18665 queryParameters := map[string]interface{}{ 18666 "api-version": APIVersion, 18667 "NodeInstanceId": autorest.Encode("query", nodeInstanceID), 18668 "NodeTransitionType": autorest.Encode("query", nodeTransitionType), 18669 "OperationId": autorest.Encode("query", operationID), 18670 "StopDurationInSeconds": autorest.Encode("query", stopDurationInSeconds), 18671 } 18672 if timeout != nil { 18673 queryParameters["timeout"] = autorest.Encode("query", *timeout) 18674 } else { 18675 queryParameters["timeout"] = autorest.Encode("query", 60) 18676 } 18677 18678 preparer := autorest.CreatePreparer( 18679 autorest.AsPost(), 18680 autorest.WithBaseURL(client.BaseURI), 18681 autorest.WithPathParameters("/Faults/Nodes/{nodeName}/$/StartTransition/", pathParameters), 18682 autorest.WithQueryParameters(queryParameters)) 18683 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 18684} 18685 18686// StartNodeTransitionSender sends the StartNodeTransition request. The method will close the 18687// http.Response Body if it receives an error. 18688func (client BaseClient) StartNodeTransitionSender(req *http.Request) (*http.Response, error) { 18689 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 18690} 18691 18692// StartNodeTransitionResponder handles the response to the StartNodeTransition request. The method always 18693// closes the http.Response Body. 18694func (client BaseClient) StartNodeTransitionResponder(resp *http.Response) (result autorest.Response, err error) { 18695 err = autorest.Respond( 18696 resp, 18697 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), 18698 autorest.ByClosing()) 18699 result.Response = resp 18700 return 18701} 18702 18703// StartPartitionRestart this API is useful for testing failover. 18704// 18705// If used to target a stateless service partition, RestartPartitionMode must be AllReplicasOrInstances. 18706// 18707// Call the GetPartitionRestartProgress API using the same OperationId to get the progress. 18708// Parameters: 18709// serviceID - the identity of the service. This ID is typically the full name of the service without the 18710// 'fabric:' URI scheme. 18711// Starting from version 6.0, hierarchical names are delimited with the "~" character. 18712// For example, if the service name is "fabric:/myapp/app1/svc1", the service identity would be 18713// "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in previous versions. 18714// partitionID - the identity of the partition. 18715// operationID - a GUID that identifies a call of this API. This is passed into the corresponding GetProgress 18716// API 18717// restartPartitionMode - describe which partitions to restart. 18718// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 18719// duration that the client is willing to wait for the requested operation to complete. The default value for 18720// this parameter is 60 seconds. 18721func (client BaseClient) StartPartitionRestart(ctx context.Context, serviceID string, partitionID uuid.UUID, operationID uuid.UUID, restartPartitionMode RestartPartitionMode, timeout *int64) (result autorest.Response, err error) { 18722 if tracing.IsEnabled() { 18723 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.StartPartitionRestart") 18724 defer func() { 18725 sc := -1 18726 if result.Response != nil { 18727 sc = result.Response.StatusCode 18728 } 18729 tracing.EndSpan(ctx, sc, err) 18730 }() 18731 } 18732 if err := validation.Validate([]validation.Validation{ 18733 {TargetValue: timeout, 18734 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 18735 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 18736 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 18737 }}}}}); err != nil { 18738 return result, validation.NewError("servicefabric.BaseClient", "StartPartitionRestart", err.Error()) 18739 } 18740 18741 req, err := client.StartPartitionRestartPreparer(ctx, serviceID, partitionID, operationID, restartPartitionMode, timeout) 18742 if err != nil { 18743 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartPartitionRestart", nil, "Failure preparing request") 18744 return 18745 } 18746 18747 resp, err := client.StartPartitionRestartSender(req) 18748 if err != nil { 18749 result.Response = resp 18750 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartPartitionRestart", resp, "Failure sending request") 18751 return 18752 } 18753 18754 result, err = client.StartPartitionRestartResponder(resp) 18755 if err != nil { 18756 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartPartitionRestart", resp, "Failure responding to request") 18757 return 18758 } 18759 18760 return 18761} 18762 18763// StartPartitionRestartPreparer prepares the StartPartitionRestart request. 18764func (client BaseClient) StartPartitionRestartPreparer(ctx context.Context, serviceID string, partitionID uuid.UUID, operationID uuid.UUID, restartPartitionMode RestartPartitionMode, timeout *int64) (*http.Request, error) { 18765 pathParameters := map[string]interface{}{ 18766 "partitionId": partitionID, 18767 "serviceId": serviceID, 18768 } 18769 18770 const APIVersion = "6.0" 18771 queryParameters := map[string]interface{}{ 18772 "api-version": APIVersion, 18773 "OperationId": autorest.Encode("query", operationID), 18774 "RestartPartitionMode": autorest.Encode("query", restartPartitionMode), 18775 } 18776 if timeout != nil { 18777 queryParameters["timeout"] = autorest.Encode("query", *timeout) 18778 } else { 18779 queryParameters["timeout"] = autorest.Encode("query", 60) 18780 } 18781 18782 preparer := autorest.CreatePreparer( 18783 autorest.AsPost(), 18784 autorest.WithBaseURL(client.BaseURI), 18785 autorest.WithPathParameters("/Faults/Services/{serviceId}/$/GetPartitions/{partitionId}/$/StartRestart", pathParameters), 18786 autorest.WithQueryParameters(queryParameters)) 18787 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 18788} 18789 18790// StartPartitionRestartSender sends the StartPartitionRestart request. The method will close the 18791// http.Response Body if it receives an error. 18792func (client BaseClient) StartPartitionRestartSender(req *http.Request) (*http.Response, error) { 18793 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 18794} 18795 18796// StartPartitionRestartResponder handles the response to the StartPartitionRestart request. The method always 18797// closes the http.Response Body. 18798func (client BaseClient) StartPartitionRestartResponder(resp *http.Response) (result autorest.Response, err error) { 18799 err = autorest.Respond( 18800 resp, 18801 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), 18802 autorest.ByClosing()) 18803 result.Response = resp 18804 return 18805} 18806 18807// StartQuorumLoss this API is useful for a temporary quorum loss situation on your service. 18808// 18809// Call the GetQuorumLossProgress API with the same OperationId to return information on the operation started with 18810// this API. 18811// 18812// This can only be called on stateful persisted (HasPersistedState==true) services. Do not use this API on stateless 18813// services or stateful in-memory only services. 18814// Parameters: 18815// serviceID - the identity of the service. This ID is typically the full name of the service without the 18816// 'fabric:' URI scheme. 18817// Starting from version 6.0, hierarchical names are delimited with the "~" character. 18818// For example, if the service name is "fabric:/myapp/app1/svc1", the service identity would be 18819// "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in previous versions. 18820// partitionID - the identity of the partition. 18821// operationID - a GUID that identifies a call of this API. This is passed into the corresponding GetProgress 18822// API 18823// quorumLossMode - this enum is passed to the StartQuorumLoss API to indicate what type of quorum loss to 18824// induce. 18825// quorumLossDuration - the amount of time for which the partition will be kept in quorum loss. This must be 18826// specified in seconds. 18827// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 18828// duration that the client is willing to wait for the requested operation to complete. The default value for 18829// this parameter is 60 seconds. 18830func (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) { 18831 if tracing.IsEnabled() { 18832 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.StartQuorumLoss") 18833 defer func() { 18834 sc := -1 18835 if result.Response != nil { 18836 sc = result.Response.StatusCode 18837 } 18838 tracing.EndSpan(ctx, sc, err) 18839 }() 18840 } 18841 if err := validation.Validate([]validation.Validation{ 18842 {TargetValue: timeout, 18843 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 18844 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 18845 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 18846 }}}}}); err != nil { 18847 return result, validation.NewError("servicefabric.BaseClient", "StartQuorumLoss", err.Error()) 18848 } 18849 18850 req, err := client.StartQuorumLossPreparer(ctx, serviceID, partitionID, operationID, quorumLossMode, quorumLossDuration, timeout) 18851 if err != nil { 18852 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartQuorumLoss", nil, "Failure preparing request") 18853 return 18854 } 18855 18856 resp, err := client.StartQuorumLossSender(req) 18857 if err != nil { 18858 result.Response = resp 18859 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartQuorumLoss", resp, "Failure sending request") 18860 return 18861 } 18862 18863 result, err = client.StartQuorumLossResponder(resp) 18864 if err != nil { 18865 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartQuorumLoss", resp, "Failure responding to request") 18866 return 18867 } 18868 18869 return 18870} 18871 18872// StartQuorumLossPreparer prepares the StartQuorumLoss request. 18873func (client BaseClient) StartQuorumLossPreparer(ctx context.Context, serviceID string, partitionID uuid.UUID, operationID uuid.UUID, quorumLossMode QuorumLossMode, quorumLossDuration int32, timeout *int64) (*http.Request, error) { 18874 pathParameters := map[string]interface{}{ 18875 "partitionId": partitionID, 18876 "serviceId": serviceID, 18877 } 18878 18879 const APIVersion = "6.0" 18880 queryParameters := map[string]interface{}{ 18881 "api-version": APIVersion, 18882 "OperationId": autorest.Encode("query", operationID), 18883 "QuorumLossDuration": autorest.Encode("query", quorumLossDuration), 18884 "QuorumLossMode": autorest.Encode("query", quorumLossMode), 18885 } 18886 if timeout != nil { 18887 queryParameters["timeout"] = autorest.Encode("query", *timeout) 18888 } else { 18889 queryParameters["timeout"] = autorest.Encode("query", 60) 18890 } 18891 18892 preparer := autorest.CreatePreparer( 18893 autorest.AsPost(), 18894 autorest.WithBaseURL(client.BaseURI), 18895 autorest.WithPathParameters("/Faults/Services/{serviceId}/$/GetPartitions/{partitionId}/$/StartQuorumLoss", pathParameters), 18896 autorest.WithQueryParameters(queryParameters)) 18897 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 18898} 18899 18900// StartQuorumLossSender sends the StartQuorumLoss request. The method will close the 18901// http.Response Body if it receives an error. 18902func (client BaseClient) StartQuorumLossSender(req *http.Request) (*http.Response, error) { 18903 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 18904} 18905 18906// StartQuorumLossResponder handles the response to the StartQuorumLoss request. The method always 18907// closes the http.Response Body. 18908func (client BaseClient) StartQuorumLossResponder(resp *http.Response) (result autorest.Response, err error) { 18909 err = autorest.Respond( 18910 resp, 18911 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), 18912 autorest.ByClosing()) 18913 result.Response = resp 18914 return 18915} 18916 18917// StartRollbackComposeDeploymentUpgrade rollback a service fabric compose deployment upgrade. 18918// Parameters: 18919// deploymentName - the identity of the deployment. 18920// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 18921// duration that the client is willing to wait for the requested operation to complete. The default value for 18922// this parameter is 60 seconds. 18923func (client BaseClient) StartRollbackComposeDeploymentUpgrade(ctx context.Context, deploymentName string, timeout *int64) (result autorest.Response, err error) { 18924 if tracing.IsEnabled() { 18925 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.StartRollbackComposeDeploymentUpgrade") 18926 defer func() { 18927 sc := -1 18928 if result.Response != nil { 18929 sc = result.Response.StatusCode 18930 } 18931 tracing.EndSpan(ctx, sc, err) 18932 }() 18933 } 18934 if err := validation.Validate([]validation.Validation{ 18935 {TargetValue: timeout, 18936 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 18937 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 18938 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 18939 }}}}}); err != nil { 18940 return result, validation.NewError("servicefabric.BaseClient", "StartRollbackComposeDeploymentUpgrade", err.Error()) 18941 } 18942 18943 req, err := client.StartRollbackComposeDeploymentUpgradePreparer(ctx, deploymentName, timeout) 18944 if err != nil { 18945 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartRollbackComposeDeploymentUpgrade", nil, "Failure preparing request") 18946 return 18947 } 18948 18949 resp, err := client.StartRollbackComposeDeploymentUpgradeSender(req) 18950 if err != nil { 18951 result.Response = resp 18952 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartRollbackComposeDeploymentUpgrade", resp, "Failure sending request") 18953 return 18954 } 18955 18956 result, err = client.StartRollbackComposeDeploymentUpgradeResponder(resp) 18957 if err != nil { 18958 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StartRollbackComposeDeploymentUpgrade", resp, "Failure responding to request") 18959 return 18960 } 18961 18962 return 18963} 18964 18965// StartRollbackComposeDeploymentUpgradePreparer prepares the StartRollbackComposeDeploymentUpgrade request. 18966func (client BaseClient) StartRollbackComposeDeploymentUpgradePreparer(ctx context.Context, deploymentName string, timeout *int64) (*http.Request, error) { 18967 pathParameters := map[string]interface{}{ 18968 "deploymentName": deploymentName, 18969 } 18970 18971 const APIVersion = "6.4-preview" 18972 queryParameters := map[string]interface{}{ 18973 "api-version": APIVersion, 18974 } 18975 if timeout != nil { 18976 queryParameters["timeout"] = autorest.Encode("query", *timeout) 18977 } else { 18978 queryParameters["timeout"] = autorest.Encode("query", 60) 18979 } 18980 18981 preparer := autorest.CreatePreparer( 18982 autorest.AsPost(), 18983 autorest.WithBaseURL(client.BaseURI), 18984 autorest.WithPathParameters("/ComposeDeployments/{deploymentName}/$/RollbackUpgrade", pathParameters), 18985 autorest.WithQueryParameters(queryParameters)) 18986 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 18987} 18988 18989// StartRollbackComposeDeploymentUpgradeSender sends the StartRollbackComposeDeploymentUpgrade request. The method will close the 18990// http.Response Body if it receives an error. 18991func (client BaseClient) StartRollbackComposeDeploymentUpgradeSender(req *http.Request) (*http.Response, error) { 18992 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 18993} 18994 18995// StartRollbackComposeDeploymentUpgradeResponder handles the response to the StartRollbackComposeDeploymentUpgrade request. The method always 18996// closes the http.Response Body. 18997func (client BaseClient) StartRollbackComposeDeploymentUpgradeResponder(resp *http.Response) (result autorest.Response, err error) { 18998 err = autorest.Respond( 18999 resp, 19000 azure.WithErrorUnlessStatusCode(http.StatusOK), 19001 autorest.ByClosing()) 19002 result.Response = resp 19003 return 19004} 19005 19006// StopChaos stops Chaos from executing new faults. In-flight faults will continue to execute until they are complete. 19007// The current Chaos Schedule is put into a stopped state. 19008// Once a schedule is stopped, it will stay in the stopped state and not be used to Chaos Schedule new runs of Chaos. A 19009// new Chaos Schedule must be set in order to resume scheduling. 19010// Parameters: 19011// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 19012// duration that the client is willing to wait for the requested operation to complete. The default value for 19013// this parameter is 60 seconds. 19014func (client BaseClient) StopChaos(ctx context.Context, timeout *int64) (result autorest.Response, err error) { 19015 if tracing.IsEnabled() { 19016 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.StopChaos") 19017 defer func() { 19018 sc := -1 19019 if result.Response != nil { 19020 sc = result.Response.StatusCode 19021 } 19022 tracing.EndSpan(ctx, sc, err) 19023 }() 19024 } 19025 if err := validation.Validate([]validation.Validation{ 19026 {TargetValue: timeout, 19027 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 19028 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 19029 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 19030 }}}}}); err != nil { 19031 return result, validation.NewError("servicefabric.BaseClient", "StopChaos", err.Error()) 19032 } 19033 19034 req, err := client.StopChaosPreparer(ctx, timeout) 19035 if err != nil { 19036 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StopChaos", nil, "Failure preparing request") 19037 return 19038 } 19039 19040 resp, err := client.StopChaosSender(req) 19041 if err != nil { 19042 result.Response = resp 19043 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StopChaos", resp, "Failure sending request") 19044 return 19045 } 19046 19047 result, err = client.StopChaosResponder(resp) 19048 if err != nil { 19049 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "StopChaos", resp, "Failure responding to request") 19050 return 19051 } 19052 19053 return 19054} 19055 19056// StopChaosPreparer prepares the StopChaos request. 19057func (client BaseClient) StopChaosPreparer(ctx context.Context, timeout *int64) (*http.Request, error) { 19058 const APIVersion = "6.0" 19059 queryParameters := map[string]interface{}{ 19060 "api-version": APIVersion, 19061 } 19062 if timeout != nil { 19063 queryParameters["timeout"] = autorest.Encode("query", *timeout) 19064 } else { 19065 queryParameters["timeout"] = autorest.Encode("query", 60) 19066 } 19067 19068 preparer := autorest.CreatePreparer( 19069 autorest.AsPost(), 19070 autorest.WithBaseURL(client.BaseURI), 19071 autorest.WithPath("/Tools/Chaos/$/Stop"), 19072 autorest.WithQueryParameters(queryParameters)) 19073 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 19074} 19075 19076// StopChaosSender sends the StopChaos request. The method will close the 19077// http.Response Body if it receives an error. 19078func (client BaseClient) StopChaosSender(req *http.Request) (*http.Response, error) { 19079 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 19080} 19081 19082// StopChaosResponder handles the response to the StopChaos request. The method always 19083// closes the http.Response Body. 19084func (client BaseClient) StopChaosResponder(resp *http.Response) (result autorest.Response, err error) { 19085 err = autorest.Respond( 19086 resp, 19087 azure.WithErrorUnlessStatusCode(http.StatusOK), 19088 autorest.ByClosing()) 19089 result.Response = resp 19090 return 19091} 19092 19093// SubmitPropertyBatch submits a batch of property operations. Either all or none of the operations will be committed. 19094// Parameters: 19095// nameID - the Service Fabric name, without the 'fabric:' URI scheme. 19096// propertyBatchDescriptionList - describes the property batch operations to be submitted. 19097// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 19098// duration that the client is willing to wait for the requested operation to complete. The default value for 19099// this parameter is 60 seconds. 19100func (client BaseClient) SubmitPropertyBatch(ctx context.Context, nameID string, propertyBatchDescriptionList PropertyBatchDescriptionList, timeout *int64) (result PropertyBatchInfoModel, err error) { 19101 if tracing.IsEnabled() { 19102 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.SubmitPropertyBatch") 19103 defer func() { 19104 sc := -1 19105 if result.Response.Response != nil { 19106 sc = result.Response.Response.StatusCode 19107 } 19108 tracing.EndSpan(ctx, sc, err) 19109 }() 19110 } 19111 if err := validation.Validate([]validation.Validation{ 19112 {TargetValue: timeout, 19113 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 19114 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 19115 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 19116 }}}}}); err != nil { 19117 return result, validation.NewError("servicefabric.BaseClient", "SubmitPropertyBatch", err.Error()) 19118 } 19119 19120 req, err := client.SubmitPropertyBatchPreparer(ctx, nameID, propertyBatchDescriptionList, timeout) 19121 if err != nil { 19122 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "SubmitPropertyBatch", nil, "Failure preparing request") 19123 return 19124 } 19125 19126 resp, err := client.SubmitPropertyBatchSender(req) 19127 if err != nil { 19128 result.Response = autorest.Response{Response: resp} 19129 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "SubmitPropertyBatch", resp, "Failure sending request") 19130 return 19131 } 19132 19133 result, err = client.SubmitPropertyBatchResponder(resp) 19134 if err != nil { 19135 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "SubmitPropertyBatch", resp, "Failure responding to request") 19136 return 19137 } 19138 19139 return 19140} 19141 19142// SubmitPropertyBatchPreparer prepares the SubmitPropertyBatch request. 19143func (client BaseClient) SubmitPropertyBatchPreparer(ctx context.Context, nameID string, propertyBatchDescriptionList PropertyBatchDescriptionList, timeout *int64) (*http.Request, error) { 19144 pathParameters := map[string]interface{}{ 19145 "nameId": nameID, 19146 } 19147 19148 const APIVersion = "6.0" 19149 queryParameters := map[string]interface{}{ 19150 "api-version": APIVersion, 19151 } 19152 if timeout != nil { 19153 queryParameters["timeout"] = autorest.Encode("query", *timeout) 19154 } else { 19155 queryParameters["timeout"] = autorest.Encode("query", 60) 19156 } 19157 19158 preparer := autorest.CreatePreparer( 19159 autorest.AsContentType("application/json; charset=utf-8"), 19160 autorest.AsPost(), 19161 autorest.WithBaseURL(client.BaseURI), 19162 autorest.WithPathParameters("/Names/{nameId}/$/GetProperties/$/SubmitBatch", pathParameters), 19163 autorest.WithJSON(propertyBatchDescriptionList), 19164 autorest.WithQueryParameters(queryParameters)) 19165 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 19166} 19167 19168// SubmitPropertyBatchSender sends the SubmitPropertyBatch request. The method will close the 19169// http.Response Body if it receives an error. 19170func (client BaseClient) SubmitPropertyBatchSender(req *http.Request) (*http.Response, error) { 19171 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 19172} 19173 19174// SubmitPropertyBatchResponder handles the response to the SubmitPropertyBatch request. The method always 19175// closes the http.Response Body. 19176func (client BaseClient) SubmitPropertyBatchResponder(resp *http.Response) (result PropertyBatchInfoModel, err error) { 19177 err = autorest.Respond( 19178 resp, 19179 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusConflict), 19180 autorest.ByUnmarshallingJSON(&result), 19181 autorest.ByClosing()) 19182 result.Response = autorest.Response{Response: resp} 19183 return 19184} 19185 19186// SuspendApplicationBackup the application which is configured to take periodic backups, is suspended for taking 19187// further backups till it is resumed again. This operation applies to the entire application's hierarchy. It means all 19188// the services and partitions under this application are now suspended for backup. 19189// Parameters: 19190// applicationID - the identity of the application. This is typically the full name of the application without 19191// the 'fabric:' URI scheme. 19192// Starting from version 6.0, hierarchical names are delimited with the "~" character. 19193// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" 19194// in 6.0+ and "myapp/app1" in previous versions. 19195// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 19196// duration that the client is willing to wait for the requested operation to complete. The default value for 19197// this parameter is 60 seconds. 19198func (client BaseClient) SuspendApplicationBackup(ctx context.Context, applicationID string, timeout *int64) (result autorest.Response, err error) { 19199 if tracing.IsEnabled() { 19200 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.SuspendApplicationBackup") 19201 defer func() { 19202 sc := -1 19203 if result.Response != nil { 19204 sc = result.Response.StatusCode 19205 } 19206 tracing.EndSpan(ctx, sc, err) 19207 }() 19208 } 19209 if err := validation.Validate([]validation.Validation{ 19210 {TargetValue: timeout, 19211 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 19212 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 19213 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 19214 }}}}}); err != nil { 19215 return result, validation.NewError("servicefabric.BaseClient", "SuspendApplicationBackup", err.Error()) 19216 } 19217 19218 req, err := client.SuspendApplicationBackupPreparer(ctx, applicationID, timeout) 19219 if err != nil { 19220 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "SuspendApplicationBackup", nil, "Failure preparing request") 19221 return 19222 } 19223 19224 resp, err := client.SuspendApplicationBackupSender(req) 19225 if err != nil { 19226 result.Response = resp 19227 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "SuspendApplicationBackup", resp, "Failure sending request") 19228 return 19229 } 19230 19231 result, err = client.SuspendApplicationBackupResponder(resp) 19232 if err != nil { 19233 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "SuspendApplicationBackup", resp, "Failure responding to request") 19234 return 19235 } 19236 19237 return 19238} 19239 19240// SuspendApplicationBackupPreparer prepares the SuspendApplicationBackup request. 19241func (client BaseClient) SuspendApplicationBackupPreparer(ctx context.Context, applicationID string, timeout *int64) (*http.Request, error) { 19242 pathParameters := map[string]interface{}{ 19243 "applicationId": applicationID, 19244 } 19245 19246 const APIVersion = "6.4" 19247 queryParameters := map[string]interface{}{ 19248 "api-version": APIVersion, 19249 } 19250 if timeout != nil { 19251 queryParameters["timeout"] = autorest.Encode("query", *timeout) 19252 } else { 19253 queryParameters["timeout"] = autorest.Encode("query", 60) 19254 } 19255 19256 preparer := autorest.CreatePreparer( 19257 autorest.AsPost(), 19258 autorest.WithBaseURL(client.BaseURI), 19259 autorest.WithPathParameters("/Applications/{applicationId}/$/SuspendBackup", pathParameters), 19260 autorest.WithQueryParameters(queryParameters)) 19261 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 19262} 19263 19264// SuspendApplicationBackupSender sends the SuspendApplicationBackup request. The method will close the 19265// http.Response Body if it receives an error. 19266func (client BaseClient) SuspendApplicationBackupSender(req *http.Request) (*http.Response, error) { 19267 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 19268} 19269 19270// SuspendApplicationBackupResponder handles the response to the SuspendApplicationBackup request. The method always 19271// closes the http.Response Body. 19272func (client BaseClient) SuspendApplicationBackupResponder(resp *http.Response) (result autorest.Response, err error) { 19273 err = autorest.Respond( 19274 resp, 19275 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), 19276 autorest.ByClosing()) 19277 result.Response = resp 19278 return 19279} 19280 19281// SuspendPartitionBackup the partition which is configured to take periodic backups, is suspended for taking further 19282// backups till it is resumed again. 19283// Parameters: 19284// partitionID - the identity of the partition. 19285// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 19286// duration that the client is willing to wait for the requested operation to complete. The default value for 19287// this parameter is 60 seconds. 19288func (client BaseClient) SuspendPartitionBackup(ctx context.Context, partitionID uuid.UUID, timeout *int64) (result autorest.Response, err error) { 19289 if tracing.IsEnabled() { 19290 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.SuspendPartitionBackup") 19291 defer func() { 19292 sc := -1 19293 if result.Response != nil { 19294 sc = result.Response.StatusCode 19295 } 19296 tracing.EndSpan(ctx, sc, err) 19297 }() 19298 } 19299 if err := validation.Validate([]validation.Validation{ 19300 {TargetValue: timeout, 19301 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 19302 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 19303 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 19304 }}}}}); err != nil { 19305 return result, validation.NewError("servicefabric.BaseClient", "SuspendPartitionBackup", err.Error()) 19306 } 19307 19308 req, err := client.SuspendPartitionBackupPreparer(ctx, partitionID, timeout) 19309 if err != nil { 19310 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "SuspendPartitionBackup", nil, "Failure preparing request") 19311 return 19312 } 19313 19314 resp, err := client.SuspendPartitionBackupSender(req) 19315 if err != nil { 19316 result.Response = resp 19317 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "SuspendPartitionBackup", resp, "Failure sending request") 19318 return 19319 } 19320 19321 result, err = client.SuspendPartitionBackupResponder(resp) 19322 if err != nil { 19323 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "SuspendPartitionBackup", resp, "Failure responding to request") 19324 return 19325 } 19326 19327 return 19328} 19329 19330// SuspendPartitionBackupPreparer prepares the SuspendPartitionBackup request. 19331func (client BaseClient) SuspendPartitionBackupPreparer(ctx context.Context, partitionID uuid.UUID, timeout *int64) (*http.Request, error) { 19332 pathParameters := map[string]interface{}{ 19333 "partitionId": partitionID, 19334 } 19335 19336 const APIVersion = "6.4" 19337 queryParameters := map[string]interface{}{ 19338 "api-version": APIVersion, 19339 } 19340 if timeout != nil { 19341 queryParameters["timeout"] = autorest.Encode("query", *timeout) 19342 } else { 19343 queryParameters["timeout"] = autorest.Encode("query", 60) 19344 } 19345 19346 preparer := autorest.CreatePreparer( 19347 autorest.AsPost(), 19348 autorest.WithBaseURL(client.BaseURI), 19349 autorest.WithPathParameters("/Partitions/{partitionId}/$/SuspendBackup", pathParameters), 19350 autorest.WithQueryParameters(queryParameters)) 19351 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 19352} 19353 19354// SuspendPartitionBackupSender sends the SuspendPartitionBackup request. The method will close the 19355// http.Response Body if it receives an error. 19356func (client BaseClient) SuspendPartitionBackupSender(req *http.Request) (*http.Response, error) { 19357 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 19358} 19359 19360// SuspendPartitionBackupResponder handles the response to the SuspendPartitionBackup request. The method always 19361// closes the http.Response Body. 19362func (client BaseClient) SuspendPartitionBackupResponder(resp *http.Response) (result autorest.Response, err error) { 19363 err = autorest.Respond( 19364 resp, 19365 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), 19366 autorest.ByClosing()) 19367 result.Response = resp 19368 return 19369} 19370 19371// SuspendServiceBackup the service which is configured to take periodic backups, is suspended for taking further 19372// backups till it is resumed again. This operation applies to the entire service's hierarchy. It means all the 19373// partitions under this service are now suspended for backup. 19374// Parameters: 19375// serviceID - the identity of the service. This ID is typically the full name of the service without the 19376// 'fabric:' URI scheme. 19377// Starting from version 6.0, hierarchical names are delimited with the "~" character. 19378// For example, if the service name is "fabric:/myapp/app1/svc1", the service identity would be 19379// "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in previous versions. 19380// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 19381// duration that the client is willing to wait for the requested operation to complete. The default value for 19382// this parameter is 60 seconds. 19383func (client BaseClient) SuspendServiceBackup(ctx context.Context, serviceID string, timeout *int64) (result autorest.Response, err error) { 19384 if tracing.IsEnabled() { 19385 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.SuspendServiceBackup") 19386 defer func() { 19387 sc := -1 19388 if result.Response != nil { 19389 sc = result.Response.StatusCode 19390 } 19391 tracing.EndSpan(ctx, sc, err) 19392 }() 19393 } 19394 if err := validation.Validate([]validation.Validation{ 19395 {TargetValue: timeout, 19396 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 19397 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 19398 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 19399 }}}}}); err != nil { 19400 return result, validation.NewError("servicefabric.BaseClient", "SuspendServiceBackup", err.Error()) 19401 } 19402 19403 req, err := client.SuspendServiceBackupPreparer(ctx, serviceID, timeout) 19404 if err != nil { 19405 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "SuspendServiceBackup", nil, "Failure preparing request") 19406 return 19407 } 19408 19409 resp, err := client.SuspendServiceBackupSender(req) 19410 if err != nil { 19411 result.Response = resp 19412 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "SuspendServiceBackup", resp, "Failure sending request") 19413 return 19414 } 19415 19416 result, err = client.SuspendServiceBackupResponder(resp) 19417 if err != nil { 19418 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "SuspendServiceBackup", resp, "Failure responding to request") 19419 return 19420 } 19421 19422 return 19423} 19424 19425// SuspendServiceBackupPreparer prepares the SuspendServiceBackup request. 19426func (client BaseClient) SuspendServiceBackupPreparer(ctx context.Context, serviceID string, timeout *int64) (*http.Request, error) { 19427 pathParameters := map[string]interface{}{ 19428 "serviceId": serviceID, 19429 } 19430 19431 const APIVersion = "6.4" 19432 queryParameters := map[string]interface{}{ 19433 "api-version": APIVersion, 19434 } 19435 if timeout != nil { 19436 queryParameters["timeout"] = autorest.Encode("query", *timeout) 19437 } else { 19438 queryParameters["timeout"] = autorest.Encode("query", 60) 19439 } 19440 19441 preparer := autorest.CreatePreparer( 19442 autorest.AsPost(), 19443 autorest.WithBaseURL(client.BaseURI), 19444 autorest.WithPathParameters("/Services/{serviceId}/$/SuspendBackup", pathParameters), 19445 autorest.WithQueryParameters(queryParameters)) 19446 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 19447} 19448 19449// SuspendServiceBackupSender sends the SuspendServiceBackup request. The method will close the 19450// http.Response Body if it receives an error. 19451func (client BaseClient) SuspendServiceBackupSender(req *http.Request) (*http.Response, error) { 19452 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 19453} 19454 19455// SuspendServiceBackupResponder handles the response to the SuspendServiceBackup request. The method always 19456// closes the http.Response Body. 19457func (client BaseClient) SuspendServiceBackupResponder(resp *http.Response) (result autorest.Response, err error) { 19458 err = autorest.Respond( 19459 resp, 19460 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), 19461 autorest.ByClosing()) 19462 result.Response = resp 19463 return 19464} 19465 19466// UnprovisionApplicationType this operation can only be performed if all application instances of the application type 19467// have been deleted. Once the application type is unregistered, no new application instances can be created for this 19468// particular application type. 19469// Parameters: 19470// applicationTypeName - the name of the application type. 19471// unprovisionApplicationTypeDescriptionInfo - the relative path for the application package in the image store 19472// specified during the prior copy operation. 19473// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 19474// duration that the client is willing to wait for the requested operation to complete. The default value for 19475// this parameter is 60 seconds. 19476func (client BaseClient) UnprovisionApplicationType(ctx context.Context, applicationTypeName string, unprovisionApplicationTypeDescriptionInfo UnprovisionApplicationTypeDescriptionInfo, timeout *int64) (result autorest.Response, err error) { 19477 if tracing.IsEnabled() { 19478 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.UnprovisionApplicationType") 19479 defer func() { 19480 sc := -1 19481 if result.Response != nil { 19482 sc = result.Response.StatusCode 19483 } 19484 tracing.EndSpan(ctx, sc, err) 19485 }() 19486 } 19487 if err := validation.Validate([]validation.Validation{ 19488 {TargetValue: unprovisionApplicationTypeDescriptionInfo, 19489 Constraints: []validation.Constraint{{Target: "unprovisionApplicationTypeDescriptionInfo.ApplicationTypeVersion", Name: validation.Null, Rule: true, Chain: nil}}}, 19490 {TargetValue: timeout, 19491 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 19492 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 19493 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 19494 }}}}}); err != nil { 19495 return result, validation.NewError("servicefabric.BaseClient", "UnprovisionApplicationType", err.Error()) 19496 } 19497 19498 req, err := client.UnprovisionApplicationTypePreparer(ctx, applicationTypeName, unprovisionApplicationTypeDescriptionInfo, timeout) 19499 if err != nil { 19500 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UnprovisionApplicationType", nil, "Failure preparing request") 19501 return 19502 } 19503 19504 resp, err := client.UnprovisionApplicationTypeSender(req) 19505 if err != nil { 19506 result.Response = resp 19507 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UnprovisionApplicationType", resp, "Failure sending request") 19508 return 19509 } 19510 19511 result, err = client.UnprovisionApplicationTypeResponder(resp) 19512 if err != nil { 19513 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UnprovisionApplicationType", resp, "Failure responding to request") 19514 return 19515 } 19516 19517 return 19518} 19519 19520// UnprovisionApplicationTypePreparer prepares the UnprovisionApplicationType request. 19521func (client BaseClient) UnprovisionApplicationTypePreparer(ctx context.Context, applicationTypeName string, unprovisionApplicationTypeDescriptionInfo UnprovisionApplicationTypeDescriptionInfo, timeout *int64) (*http.Request, error) { 19522 pathParameters := map[string]interface{}{ 19523 "applicationTypeName": autorest.Encode("path", applicationTypeName), 19524 } 19525 19526 const APIVersion = "6.0" 19527 queryParameters := map[string]interface{}{ 19528 "api-version": APIVersion, 19529 } 19530 if timeout != nil { 19531 queryParameters["timeout"] = autorest.Encode("query", *timeout) 19532 } else { 19533 queryParameters["timeout"] = autorest.Encode("query", 60) 19534 } 19535 19536 preparer := autorest.CreatePreparer( 19537 autorest.AsContentType("application/json; charset=utf-8"), 19538 autorest.AsPost(), 19539 autorest.WithBaseURL(client.BaseURI), 19540 autorest.WithPathParameters("/ApplicationTypes/{applicationTypeName}/$/Unprovision", pathParameters), 19541 autorest.WithJSON(unprovisionApplicationTypeDescriptionInfo), 19542 autorest.WithQueryParameters(queryParameters)) 19543 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 19544} 19545 19546// UnprovisionApplicationTypeSender sends the UnprovisionApplicationType request. The method will close the 19547// http.Response Body if it receives an error. 19548func (client BaseClient) UnprovisionApplicationTypeSender(req *http.Request) (*http.Response, error) { 19549 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 19550} 19551 19552// UnprovisionApplicationTypeResponder handles the response to the UnprovisionApplicationType request. The method always 19553// closes the http.Response Body. 19554func (client BaseClient) UnprovisionApplicationTypeResponder(resp *http.Response) (result autorest.Response, err error) { 19555 err = autorest.Respond( 19556 resp, 19557 azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), 19558 autorest.ByClosing()) 19559 result.Response = resp 19560 return 19561} 19562 19563// UnprovisionCluster it is supported to unprovision code and configuration separately. 19564// Parameters: 19565// unprovisionFabricDescription - describes the parameters for unprovisioning a cluster. 19566// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 19567// duration that the client is willing to wait for the requested operation to complete. The default value for 19568// this parameter is 60 seconds. 19569func (client BaseClient) UnprovisionCluster(ctx context.Context, unprovisionFabricDescription UnprovisionFabricDescription, timeout *int64) (result autorest.Response, err error) { 19570 if tracing.IsEnabled() { 19571 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.UnprovisionCluster") 19572 defer func() { 19573 sc := -1 19574 if result.Response != nil { 19575 sc = result.Response.StatusCode 19576 } 19577 tracing.EndSpan(ctx, sc, err) 19578 }() 19579 } 19580 if err := validation.Validate([]validation.Validation{ 19581 {TargetValue: timeout, 19582 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 19583 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 19584 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 19585 }}}}}); err != nil { 19586 return result, validation.NewError("servicefabric.BaseClient", "UnprovisionCluster", err.Error()) 19587 } 19588 19589 req, err := client.UnprovisionClusterPreparer(ctx, unprovisionFabricDescription, timeout) 19590 if err != nil { 19591 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UnprovisionCluster", nil, "Failure preparing request") 19592 return 19593 } 19594 19595 resp, err := client.UnprovisionClusterSender(req) 19596 if err != nil { 19597 result.Response = resp 19598 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UnprovisionCluster", resp, "Failure sending request") 19599 return 19600 } 19601 19602 result, err = client.UnprovisionClusterResponder(resp) 19603 if err != nil { 19604 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UnprovisionCluster", resp, "Failure responding to request") 19605 return 19606 } 19607 19608 return 19609} 19610 19611// UnprovisionClusterPreparer prepares the UnprovisionCluster request. 19612func (client BaseClient) UnprovisionClusterPreparer(ctx context.Context, unprovisionFabricDescription UnprovisionFabricDescription, timeout *int64) (*http.Request, error) { 19613 const APIVersion = "6.0" 19614 queryParameters := map[string]interface{}{ 19615 "api-version": APIVersion, 19616 } 19617 if timeout != nil { 19618 queryParameters["timeout"] = autorest.Encode("query", *timeout) 19619 } else { 19620 queryParameters["timeout"] = autorest.Encode("query", 60) 19621 } 19622 19623 preparer := autorest.CreatePreparer( 19624 autorest.AsContentType("application/json; charset=utf-8"), 19625 autorest.AsPost(), 19626 autorest.WithBaseURL(client.BaseURI), 19627 autorest.WithPath("/$/Unprovision"), 19628 autorest.WithJSON(unprovisionFabricDescription), 19629 autorest.WithQueryParameters(queryParameters)) 19630 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 19631} 19632 19633// UnprovisionClusterSender sends the UnprovisionCluster request. The method will close the 19634// http.Response Body if it receives an error. 19635func (client BaseClient) UnprovisionClusterSender(req *http.Request) (*http.Response, error) { 19636 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 19637} 19638 19639// UnprovisionClusterResponder handles the response to the UnprovisionCluster request. The method always 19640// closes the http.Response Body. 19641func (client BaseClient) UnprovisionClusterResponder(resp *http.Response) (result autorest.Response, err error) { 19642 err = autorest.Respond( 19643 resp, 19644 azure.WithErrorUnlessStatusCode(http.StatusOK), 19645 autorest.ByClosing()) 19646 result.Response = resp 19647 return 19648} 19649 19650// UpdateApplicationUpgrade updates the parameters of an ongoing application upgrade from the ones specified at the 19651// time of starting the application upgrade. This may be required to mitigate stuck application upgrades due to 19652// incorrect parameters or issues in the application to make progress. 19653// Parameters: 19654// applicationID - the identity of the application. This is typically the full name of the application without 19655// the 'fabric:' URI scheme. 19656// Starting from version 6.0, hierarchical names are delimited with the "~" character. 19657// For example, if the application name is "fabric:/myapp/app1", the application identity would be "myapp~app1" 19658// in 6.0+ and "myapp/app1" in previous versions. 19659// applicationUpgradeUpdateDescription - parameters for updating an existing application upgrade. 19660// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 19661// duration that the client is willing to wait for the requested operation to complete. The default value for 19662// this parameter is 60 seconds. 19663func (client BaseClient) UpdateApplicationUpgrade(ctx context.Context, applicationID string, applicationUpgradeUpdateDescription ApplicationUpgradeUpdateDescription, timeout *int64) (result autorest.Response, err error) { 19664 if tracing.IsEnabled() { 19665 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.UpdateApplicationUpgrade") 19666 defer func() { 19667 sc := -1 19668 if result.Response != nil { 19669 sc = result.Response.StatusCode 19670 } 19671 tracing.EndSpan(ctx, sc, err) 19672 }() 19673 } 19674 if err := validation.Validate([]validation.Validation{ 19675 {TargetValue: applicationUpgradeUpdateDescription, 19676 Constraints: []validation.Constraint{{Target: "applicationUpgradeUpdateDescription.Name", Name: validation.Null, Rule: true, Chain: nil}}}, 19677 {TargetValue: timeout, 19678 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 19679 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 19680 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 19681 }}}}}); err != nil { 19682 return result, validation.NewError("servicefabric.BaseClient", "UpdateApplicationUpgrade", err.Error()) 19683 } 19684 19685 req, err := client.UpdateApplicationUpgradePreparer(ctx, applicationID, applicationUpgradeUpdateDescription, timeout) 19686 if err != nil { 19687 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UpdateApplicationUpgrade", nil, "Failure preparing request") 19688 return 19689 } 19690 19691 resp, err := client.UpdateApplicationUpgradeSender(req) 19692 if err != nil { 19693 result.Response = resp 19694 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UpdateApplicationUpgrade", resp, "Failure sending request") 19695 return 19696 } 19697 19698 result, err = client.UpdateApplicationUpgradeResponder(resp) 19699 if err != nil { 19700 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UpdateApplicationUpgrade", resp, "Failure responding to request") 19701 return 19702 } 19703 19704 return 19705} 19706 19707// UpdateApplicationUpgradePreparer prepares the UpdateApplicationUpgrade request. 19708func (client BaseClient) UpdateApplicationUpgradePreparer(ctx context.Context, applicationID string, applicationUpgradeUpdateDescription ApplicationUpgradeUpdateDescription, timeout *int64) (*http.Request, error) { 19709 pathParameters := map[string]interface{}{ 19710 "applicationId": applicationID, 19711 } 19712 19713 const APIVersion = "6.0" 19714 queryParameters := map[string]interface{}{ 19715 "api-version": APIVersion, 19716 } 19717 if timeout != nil { 19718 queryParameters["timeout"] = autorest.Encode("query", *timeout) 19719 } else { 19720 queryParameters["timeout"] = autorest.Encode("query", 60) 19721 } 19722 19723 preparer := autorest.CreatePreparer( 19724 autorest.AsContentType("application/json; charset=utf-8"), 19725 autorest.AsPost(), 19726 autorest.WithBaseURL(client.BaseURI), 19727 autorest.WithPathParameters("/Applications/{applicationId}/$/UpdateUpgrade", pathParameters), 19728 autorest.WithJSON(applicationUpgradeUpdateDescription), 19729 autorest.WithQueryParameters(queryParameters)) 19730 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 19731} 19732 19733// UpdateApplicationUpgradeSender sends the UpdateApplicationUpgrade request. The method will close the 19734// http.Response Body if it receives an error. 19735func (client BaseClient) UpdateApplicationUpgradeSender(req *http.Request) (*http.Response, error) { 19736 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 19737} 19738 19739// UpdateApplicationUpgradeResponder handles the response to the UpdateApplicationUpgrade request. The method always 19740// closes the http.Response Body. 19741func (client BaseClient) UpdateApplicationUpgradeResponder(resp *http.Response) (result autorest.Response, err error) { 19742 err = autorest.Respond( 19743 resp, 19744 azure.WithErrorUnlessStatusCode(http.StatusOK), 19745 autorest.ByClosing()) 19746 result.Response = resp 19747 return 19748} 19749 19750// UpdateBackupPolicy updates the backup policy identified by {backupPolicyName} 19751// Parameters: 19752// backupPolicyDescription - describes the backup policy. 19753// backupPolicyName - the name of the backup policy. 19754// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 19755// duration that the client is willing to wait for the requested operation to complete. The default value for 19756// this parameter is 60 seconds. 19757func (client BaseClient) UpdateBackupPolicy(ctx context.Context, backupPolicyDescription BackupPolicyDescription, backupPolicyName string, timeout *int64) (result autorest.Response, err error) { 19758 if tracing.IsEnabled() { 19759 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.UpdateBackupPolicy") 19760 defer func() { 19761 sc := -1 19762 if result.Response != nil { 19763 sc = result.Response.StatusCode 19764 } 19765 tracing.EndSpan(ctx, sc, err) 19766 }() 19767 } 19768 if err := validation.Validate([]validation.Validation{ 19769 {TargetValue: backupPolicyDescription, 19770 Constraints: []validation.Constraint{{Target: "backupPolicyDescription.Name", Name: validation.Null, Rule: true, Chain: nil}, 19771 {Target: "backupPolicyDescription.AutoRestoreOnDataLoss", Name: validation.Null, Rule: true, Chain: nil}, 19772 {Target: "backupPolicyDescription.MaxIncrementalBackups", Name: validation.Null, Rule: true, 19773 Chain: []validation.Constraint{{Target: "backupPolicyDescription.MaxIncrementalBackups", Name: validation.InclusiveMaximum, Rule: int64(255), Chain: nil}, 19774 {Target: "backupPolicyDescription.MaxIncrementalBackups", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}, 19775 }}}}, 19776 {TargetValue: timeout, 19777 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 19778 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 19779 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 19780 }}}}}); err != nil { 19781 return result, validation.NewError("servicefabric.BaseClient", "UpdateBackupPolicy", err.Error()) 19782 } 19783 19784 req, err := client.UpdateBackupPolicyPreparer(ctx, backupPolicyDescription, backupPolicyName, timeout) 19785 if err != nil { 19786 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UpdateBackupPolicy", nil, "Failure preparing request") 19787 return 19788 } 19789 19790 resp, err := client.UpdateBackupPolicySender(req) 19791 if err != nil { 19792 result.Response = resp 19793 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UpdateBackupPolicy", resp, "Failure sending request") 19794 return 19795 } 19796 19797 result, err = client.UpdateBackupPolicyResponder(resp) 19798 if err != nil { 19799 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UpdateBackupPolicy", resp, "Failure responding to request") 19800 return 19801 } 19802 19803 return 19804} 19805 19806// UpdateBackupPolicyPreparer prepares the UpdateBackupPolicy request. 19807func (client BaseClient) UpdateBackupPolicyPreparer(ctx context.Context, backupPolicyDescription BackupPolicyDescription, backupPolicyName string, timeout *int64) (*http.Request, error) { 19808 pathParameters := map[string]interface{}{ 19809 "backupPolicyName": autorest.Encode("path", backupPolicyName), 19810 } 19811 19812 const APIVersion = "6.4" 19813 queryParameters := map[string]interface{}{ 19814 "api-version": APIVersion, 19815 } 19816 if timeout != nil { 19817 queryParameters["timeout"] = autorest.Encode("query", *timeout) 19818 } else { 19819 queryParameters["timeout"] = autorest.Encode("query", 60) 19820 } 19821 19822 preparer := autorest.CreatePreparer( 19823 autorest.AsContentType("application/json; charset=utf-8"), 19824 autorest.AsPost(), 19825 autorest.WithBaseURL(client.BaseURI), 19826 autorest.WithPathParameters("/BackupRestore/BackupPolicies/{backupPolicyName}/$/Update", pathParameters), 19827 autorest.WithJSON(backupPolicyDescription), 19828 autorest.WithQueryParameters(queryParameters)) 19829 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 19830} 19831 19832// UpdateBackupPolicySender sends the UpdateBackupPolicy request. The method will close the 19833// http.Response Body if it receives an error. 19834func (client BaseClient) UpdateBackupPolicySender(req *http.Request) (*http.Response, error) { 19835 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 19836} 19837 19838// UpdateBackupPolicyResponder handles the response to the UpdateBackupPolicy request. The method always 19839// closes the http.Response Body. 19840func (client BaseClient) UpdateBackupPolicyResponder(resp *http.Response) (result autorest.Response, err error) { 19841 err = autorest.Respond( 19842 resp, 19843 azure.WithErrorUnlessStatusCode(http.StatusOK), 19844 autorest.ByClosing()) 19845 result.Response = resp 19846 return 19847} 19848 19849// UpdateClusterUpgrade update the upgrade parameters used during a Service Fabric cluster upgrade. 19850// Parameters: 19851// updateClusterUpgradeDescription - parameters for updating a cluster upgrade. 19852// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 19853// duration that the client is willing to wait for the requested operation to complete. The default value for 19854// this parameter is 60 seconds. 19855func (client BaseClient) UpdateClusterUpgrade(ctx context.Context, updateClusterUpgradeDescription UpdateClusterUpgradeDescription, timeout *int64) (result autorest.Response, err error) { 19856 if tracing.IsEnabled() { 19857 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.UpdateClusterUpgrade") 19858 defer func() { 19859 sc := -1 19860 if result.Response != nil { 19861 sc = result.Response.StatusCode 19862 } 19863 tracing.EndSpan(ctx, sc, err) 19864 }() 19865 } 19866 if err := validation.Validate([]validation.Validation{ 19867 {TargetValue: updateClusterUpgradeDescription, 19868 Constraints: []validation.Constraint{{Target: "updateClusterUpgradeDescription.ClusterUpgradeHealthPolicy", Name: validation.Null, Rule: false, 19869 Chain: []validation.Constraint{{Target: "updateClusterUpgradeDescription.ClusterUpgradeHealthPolicy.MaxPercentDeltaUnhealthyNodes", Name: validation.Null, Rule: false, 19870 Chain: []validation.Constraint{{Target: "updateClusterUpgradeDescription.ClusterUpgradeHealthPolicy.MaxPercentDeltaUnhealthyNodes", Name: validation.InclusiveMaximum, Rule: int64(100), Chain: nil}, 19871 {Target: "updateClusterUpgradeDescription.ClusterUpgradeHealthPolicy.MaxPercentDeltaUnhealthyNodes", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}, 19872 }}, 19873 {Target: "updateClusterUpgradeDescription.ClusterUpgradeHealthPolicy.MaxPercentUpgradeDomainDeltaUnhealthyNodes", Name: validation.Null, Rule: false, 19874 Chain: []validation.Constraint{{Target: "updateClusterUpgradeDescription.ClusterUpgradeHealthPolicy.MaxPercentUpgradeDomainDeltaUnhealthyNodes", Name: validation.InclusiveMaximum, Rule: int64(100), Chain: nil}, 19875 {Target: "updateClusterUpgradeDescription.ClusterUpgradeHealthPolicy.MaxPercentUpgradeDomainDeltaUnhealthyNodes", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}, 19876 }}, 19877 }}}}, 19878 {TargetValue: timeout, 19879 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 19880 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 19881 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 19882 }}}}}); err != nil { 19883 return result, validation.NewError("servicefabric.BaseClient", "UpdateClusterUpgrade", err.Error()) 19884 } 19885 19886 req, err := client.UpdateClusterUpgradePreparer(ctx, updateClusterUpgradeDescription, timeout) 19887 if err != nil { 19888 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UpdateClusterUpgrade", nil, "Failure preparing request") 19889 return 19890 } 19891 19892 resp, err := client.UpdateClusterUpgradeSender(req) 19893 if err != nil { 19894 result.Response = resp 19895 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UpdateClusterUpgrade", resp, "Failure sending request") 19896 return 19897 } 19898 19899 result, err = client.UpdateClusterUpgradeResponder(resp) 19900 if err != nil { 19901 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UpdateClusterUpgrade", resp, "Failure responding to request") 19902 return 19903 } 19904 19905 return 19906} 19907 19908// UpdateClusterUpgradePreparer prepares the UpdateClusterUpgrade request. 19909func (client BaseClient) UpdateClusterUpgradePreparer(ctx context.Context, updateClusterUpgradeDescription UpdateClusterUpgradeDescription, timeout *int64) (*http.Request, error) { 19910 const APIVersion = "6.0" 19911 queryParameters := map[string]interface{}{ 19912 "api-version": APIVersion, 19913 } 19914 if timeout != nil { 19915 queryParameters["timeout"] = autorest.Encode("query", *timeout) 19916 } else { 19917 queryParameters["timeout"] = autorest.Encode("query", 60) 19918 } 19919 19920 preparer := autorest.CreatePreparer( 19921 autorest.AsContentType("application/json; charset=utf-8"), 19922 autorest.AsPost(), 19923 autorest.WithBaseURL(client.BaseURI), 19924 autorest.WithPath("/$/UpdateUpgrade"), 19925 autorest.WithJSON(updateClusterUpgradeDescription), 19926 autorest.WithQueryParameters(queryParameters)) 19927 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 19928} 19929 19930// UpdateClusterUpgradeSender sends the UpdateClusterUpgrade request. The method will close the 19931// http.Response Body if it receives an error. 19932func (client BaseClient) UpdateClusterUpgradeSender(req *http.Request) (*http.Response, error) { 19933 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 19934} 19935 19936// UpdateClusterUpgradeResponder handles the response to the UpdateClusterUpgrade request. The method always 19937// closes the http.Response Body. 19938func (client BaseClient) UpdateClusterUpgradeResponder(resp *http.Response) (result autorest.Response, err error) { 19939 err = autorest.Respond( 19940 resp, 19941 azure.WithErrorUnlessStatusCode(http.StatusOK), 19942 autorest.ByClosing()) 19943 result.Response = resp 19944 return 19945} 19946 19947// UpdateRepairExecutionState this API supports the Service Fabric platform; it is not meant to be used directly from 19948// your code. 19949// Parameters: 19950// repairTask - describes the repair task to be created or updated. 19951func (client BaseClient) UpdateRepairExecutionState(ctx context.Context, repairTask RepairTask) (result RepairTaskUpdateInfo, err error) { 19952 if tracing.IsEnabled() { 19953 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.UpdateRepairExecutionState") 19954 defer func() { 19955 sc := -1 19956 if result.Response.Response != nil { 19957 sc = result.Response.Response.StatusCode 19958 } 19959 tracing.EndSpan(ctx, sc, err) 19960 }() 19961 } 19962 if err := validation.Validate([]validation.Validation{ 19963 {TargetValue: repairTask, 19964 Constraints: []validation.Constraint{{Target: "repairTask.TaskID", Name: validation.Null, Rule: true, Chain: nil}, 19965 {Target: "repairTask.Action", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { 19966 return result, validation.NewError("servicefabric.BaseClient", "UpdateRepairExecutionState", err.Error()) 19967 } 19968 19969 req, err := client.UpdateRepairExecutionStatePreparer(ctx, repairTask) 19970 if err != nil { 19971 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UpdateRepairExecutionState", nil, "Failure preparing request") 19972 return 19973 } 19974 19975 resp, err := client.UpdateRepairExecutionStateSender(req) 19976 if err != nil { 19977 result.Response = autorest.Response{Response: resp} 19978 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UpdateRepairExecutionState", resp, "Failure sending request") 19979 return 19980 } 19981 19982 result, err = client.UpdateRepairExecutionStateResponder(resp) 19983 if err != nil { 19984 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UpdateRepairExecutionState", resp, "Failure responding to request") 19985 return 19986 } 19987 19988 return 19989} 19990 19991// UpdateRepairExecutionStatePreparer prepares the UpdateRepairExecutionState request. 19992func (client BaseClient) UpdateRepairExecutionStatePreparer(ctx context.Context, repairTask RepairTask) (*http.Request, error) { 19993 const APIVersion = "6.0" 19994 queryParameters := map[string]interface{}{ 19995 "api-version": APIVersion, 19996 } 19997 19998 preparer := autorest.CreatePreparer( 19999 autorest.AsContentType("application/json; charset=utf-8"), 20000 autorest.AsPost(), 20001 autorest.WithBaseURL(client.BaseURI), 20002 autorest.WithPath("/$/UpdateRepairExecutionState"), 20003 autorest.WithJSON(repairTask), 20004 autorest.WithQueryParameters(queryParameters)) 20005 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 20006} 20007 20008// UpdateRepairExecutionStateSender sends the UpdateRepairExecutionState request. The method will close the 20009// http.Response Body if it receives an error. 20010func (client BaseClient) UpdateRepairExecutionStateSender(req *http.Request) (*http.Response, error) { 20011 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 20012} 20013 20014// UpdateRepairExecutionStateResponder handles the response to the UpdateRepairExecutionState request. The method always 20015// closes the http.Response Body. 20016func (client BaseClient) UpdateRepairExecutionStateResponder(resp *http.Response) (result RepairTaskUpdateInfo, err error) { 20017 err = autorest.Respond( 20018 resp, 20019 azure.WithErrorUnlessStatusCode(http.StatusOK), 20020 autorest.ByUnmarshallingJSON(&result), 20021 autorest.ByClosing()) 20022 result.Response = autorest.Response{Response: resp} 20023 return 20024} 20025 20026// UpdateRepairTaskHealthPolicy this API supports the Service Fabric platform; it is not meant to be used directly from 20027// your code. 20028// Parameters: 20029// repairTaskUpdateHealthPolicyDescription - describes the repair task healthy policy to be updated. 20030func (client BaseClient) UpdateRepairTaskHealthPolicy(ctx context.Context, repairTaskUpdateHealthPolicyDescription RepairTaskUpdateHealthPolicyDescription) (result RepairTaskUpdateInfo, err error) { 20031 if tracing.IsEnabled() { 20032 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.UpdateRepairTaskHealthPolicy") 20033 defer func() { 20034 sc := -1 20035 if result.Response.Response != nil { 20036 sc = result.Response.Response.StatusCode 20037 } 20038 tracing.EndSpan(ctx, sc, err) 20039 }() 20040 } 20041 if err := validation.Validate([]validation.Validation{ 20042 {TargetValue: repairTaskUpdateHealthPolicyDescription, 20043 Constraints: []validation.Constraint{{Target: "repairTaskUpdateHealthPolicyDescription.TaskID", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { 20044 return result, validation.NewError("servicefabric.BaseClient", "UpdateRepairTaskHealthPolicy", err.Error()) 20045 } 20046 20047 req, err := client.UpdateRepairTaskHealthPolicyPreparer(ctx, repairTaskUpdateHealthPolicyDescription) 20048 if err != nil { 20049 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UpdateRepairTaskHealthPolicy", nil, "Failure preparing request") 20050 return 20051 } 20052 20053 resp, err := client.UpdateRepairTaskHealthPolicySender(req) 20054 if err != nil { 20055 result.Response = autorest.Response{Response: resp} 20056 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UpdateRepairTaskHealthPolicy", resp, "Failure sending request") 20057 return 20058 } 20059 20060 result, err = client.UpdateRepairTaskHealthPolicyResponder(resp) 20061 if err != nil { 20062 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UpdateRepairTaskHealthPolicy", resp, "Failure responding to request") 20063 return 20064 } 20065 20066 return 20067} 20068 20069// UpdateRepairTaskHealthPolicyPreparer prepares the UpdateRepairTaskHealthPolicy request. 20070func (client BaseClient) UpdateRepairTaskHealthPolicyPreparer(ctx context.Context, repairTaskUpdateHealthPolicyDescription RepairTaskUpdateHealthPolicyDescription) (*http.Request, error) { 20071 const APIVersion = "6.0" 20072 queryParameters := map[string]interface{}{ 20073 "api-version": APIVersion, 20074 } 20075 20076 preparer := autorest.CreatePreparer( 20077 autorest.AsContentType("application/json; charset=utf-8"), 20078 autorest.AsPost(), 20079 autorest.WithBaseURL(client.BaseURI), 20080 autorest.WithPath("/$/UpdateRepairTaskHealthPolicy"), 20081 autorest.WithJSON(repairTaskUpdateHealthPolicyDescription), 20082 autorest.WithQueryParameters(queryParameters)) 20083 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 20084} 20085 20086// UpdateRepairTaskHealthPolicySender sends the UpdateRepairTaskHealthPolicy request. The method will close the 20087// http.Response Body if it receives an error. 20088func (client BaseClient) UpdateRepairTaskHealthPolicySender(req *http.Request) (*http.Response, error) { 20089 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 20090} 20091 20092// UpdateRepairTaskHealthPolicyResponder handles the response to the UpdateRepairTaskHealthPolicy request. The method always 20093// closes the http.Response Body. 20094func (client BaseClient) UpdateRepairTaskHealthPolicyResponder(resp *http.Response) (result RepairTaskUpdateInfo, err error) { 20095 err = autorest.Respond( 20096 resp, 20097 azure.WithErrorUnlessStatusCode(http.StatusOK), 20098 autorest.ByUnmarshallingJSON(&result), 20099 autorest.ByClosing()) 20100 result.Response = autorest.Response{Response: resp} 20101 return 20102} 20103 20104// UpdateService this API allows updating properties of a running Service Fabric service. The set of properties that 20105// can be updated are a subset of the properties that were specified at the time of creating the service. The current 20106// set of properties can be obtained using `GetServiceDescription` API. Note that updating the properties of a running 20107// service is different than upgrading your application using `StartApplicationUpgrade` API. The upgrade is a long 20108// running background operation that involves moving the application from one version to another, one upgrade domain at 20109// a time, whereas update applies the new properties immediately to the service. 20110// Parameters: 20111// serviceID - the identity of the service. This ID is typically the full name of the service without the 20112// 'fabric:' URI scheme. 20113// Starting from version 6.0, hierarchical names are delimited with the "~" character. 20114// For example, if the service name is "fabric:/myapp/app1/svc1", the service identity would be 20115// "myapp~app1~svc1" in 6.0+ and "myapp/app1/svc1" in previous versions. 20116// serviceUpdateDescription - the information necessary to update a service. 20117// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 20118// duration that the client is willing to wait for the requested operation to complete. The default value for 20119// this parameter is 60 seconds. 20120func (client BaseClient) UpdateService(ctx context.Context, serviceID string, serviceUpdateDescription BasicServiceUpdateDescription, timeout *int64) (result autorest.Response, err error) { 20121 if tracing.IsEnabled() { 20122 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.UpdateService") 20123 defer func() { 20124 sc := -1 20125 if result.Response != nil { 20126 sc = result.Response.StatusCode 20127 } 20128 tracing.EndSpan(ctx, sc, err) 20129 }() 20130 } 20131 if err := validation.Validate([]validation.Validation{ 20132 {TargetValue: timeout, 20133 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 20134 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 20135 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 20136 }}}}}); err != nil { 20137 return result, validation.NewError("servicefabric.BaseClient", "UpdateService", err.Error()) 20138 } 20139 20140 req, err := client.UpdateServicePreparer(ctx, serviceID, serviceUpdateDescription, timeout) 20141 if err != nil { 20142 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UpdateService", nil, "Failure preparing request") 20143 return 20144 } 20145 20146 resp, err := client.UpdateServiceSender(req) 20147 if err != nil { 20148 result.Response = resp 20149 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UpdateService", resp, "Failure sending request") 20150 return 20151 } 20152 20153 result, err = client.UpdateServiceResponder(resp) 20154 if err != nil { 20155 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UpdateService", resp, "Failure responding to request") 20156 return 20157 } 20158 20159 return 20160} 20161 20162// UpdateServicePreparer prepares the UpdateService request. 20163func (client BaseClient) UpdateServicePreparer(ctx context.Context, serviceID string, serviceUpdateDescription BasicServiceUpdateDescription, timeout *int64) (*http.Request, error) { 20164 pathParameters := map[string]interface{}{ 20165 "serviceId": serviceID, 20166 } 20167 20168 const APIVersion = "6.0" 20169 queryParameters := map[string]interface{}{ 20170 "api-version": APIVersion, 20171 } 20172 if timeout != nil { 20173 queryParameters["timeout"] = autorest.Encode("query", *timeout) 20174 } else { 20175 queryParameters["timeout"] = autorest.Encode("query", 60) 20176 } 20177 20178 preparer := autorest.CreatePreparer( 20179 autorest.AsContentType("application/json; charset=utf-8"), 20180 autorest.AsPost(), 20181 autorest.WithBaseURL(client.BaseURI), 20182 autorest.WithPathParameters("/Services/{serviceId}/$/Update", pathParameters), 20183 autorest.WithJSON(serviceUpdateDescription), 20184 autorest.WithQueryParameters(queryParameters)) 20185 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 20186} 20187 20188// UpdateServiceSender sends the UpdateService request. The method will close the 20189// http.Response Body if it receives an error. 20190func (client BaseClient) UpdateServiceSender(req *http.Request) (*http.Response, error) { 20191 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 20192} 20193 20194// UpdateServiceResponder handles the response to the UpdateService request. The method always 20195// closes the http.Response Body. 20196func (client BaseClient) UpdateServiceResponder(resp *http.Response) (result autorest.Response, err error) { 20197 err = autorest.Respond( 20198 resp, 20199 azure.WithErrorUnlessStatusCode(http.StatusOK), 20200 autorest.ByClosing()) 20201 result.Response = resp 20202 return 20203} 20204 20205// UploadFile uploads contents of the file to the image store. Use this API if the file is small enough to upload again 20206// if the connection fails. The file's data needs to be added to the request body. The contents will be uploaded to the 20207// specified path. Image store service uses a mark file to indicate the availability of the folder. The mark file is an 20208// empty file named "_.dir". The mark file is generated by the image store service when all files in a folder are 20209// uploaded. When using File-by-File approach to upload application package in REST, the image store service isn't 20210// aware of the file hierarchy of the application package; you need to create a mark file per folder and upload it 20211// last, to let the image store service know that the folder is complete. 20212// Parameters: 20213// contentPath - relative path to file or folder in the image store from its root. 20214// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 20215// duration that the client is willing to wait for the requested operation to complete. The default value for 20216// this parameter is 60 seconds. 20217func (client BaseClient) UploadFile(ctx context.Context, contentPath string, timeout *int64) (result autorest.Response, err error) { 20218 if tracing.IsEnabled() { 20219 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.UploadFile") 20220 defer func() { 20221 sc := -1 20222 if result.Response != nil { 20223 sc = result.Response.StatusCode 20224 } 20225 tracing.EndSpan(ctx, sc, err) 20226 }() 20227 } 20228 if err := validation.Validate([]validation.Validation{ 20229 {TargetValue: timeout, 20230 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 20231 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 20232 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 20233 }}}}}); err != nil { 20234 return result, validation.NewError("servicefabric.BaseClient", "UploadFile", err.Error()) 20235 } 20236 20237 req, err := client.UploadFilePreparer(ctx, contentPath, timeout) 20238 if err != nil { 20239 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UploadFile", nil, "Failure preparing request") 20240 return 20241 } 20242 20243 resp, err := client.UploadFileSender(req) 20244 if err != nil { 20245 result.Response = resp 20246 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UploadFile", resp, "Failure sending request") 20247 return 20248 } 20249 20250 result, err = client.UploadFileResponder(resp) 20251 if err != nil { 20252 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UploadFile", resp, "Failure responding to request") 20253 return 20254 } 20255 20256 return 20257} 20258 20259// UploadFilePreparer prepares the UploadFile request. 20260func (client BaseClient) UploadFilePreparer(ctx context.Context, contentPath string, timeout *int64) (*http.Request, error) { 20261 pathParameters := map[string]interface{}{ 20262 "contentPath": autorest.Encode("path", contentPath), 20263 } 20264 20265 const APIVersion = "6.0" 20266 queryParameters := map[string]interface{}{ 20267 "api-version": APIVersion, 20268 } 20269 if timeout != nil { 20270 queryParameters["timeout"] = autorest.Encode("query", *timeout) 20271 } else { 20272 queryParameters["timeout"] = autorest.Encode("query", 60) 20273 } 20274 20275 preparer := autorest.CreatePreparer( 20276 autorest.AsPut(), 20277 autorest.WithBaseURL(client.BaseURI), 20278 autorest.WithPathParameters("/ImageStore/{contentPath}", pathParameters), 20279 autorest.WithQueryParameters(queryParameters)) 20280 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 20281} 20282 20283// UploadFileSender sends the UploadFile request. The method will close the 20284// http.Response Body if it receives an error. 20285func (client BaseClient) UploadFileSender(req *http.Request) (*http.Response, error) { 20286 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 20287} 20288 20289// UploadFileResponder handles the response to the UploadFile request. The method always 20290// closes the http.Response Body. 20291func (client BaseClient) UploadFileResponder(resp *http.Response) (result autorest.Response, err error) { 20292 err = autorest.Respond( 20293 resp, 20294 azure.WithErrorUnlessStatusCode(http.StatusOK), 20295 autorest.ByClosing()) 20296 result.Response = resp 20297 return 20298} 20299 20300// UploadFileChunk uploads a file chunk to the image store with the specified upload session ID and image store 20301// relative path. This API allows user to resume the file upload operation. user doesn't have to restart the file 20302// upload from scratch whenever there is a network interruption. Use this option if the file size is large. 20303// 20304// To perform a resumable file upload, user need to break the file into multiple chunks and upload these chunks to the 20305// image store one-by-one. Chunks don't have to be uploaded in order. If the file represented by the image store 20306// relative path already exists, it will be overwritten when the upload session commits. 20307// Parameters: 20308// contentPath - relative path to file or folder in the image store from its root. 20309// sessionID - a GUID generated by the user for a file uploading. It identifies an image store upload session 20310// which keeps track of all file chunks until it is committed. 20311// contentRange - when uploading file chunks to the image store, the Content-Range header field need to be 20312// configured and sent with a request. The format should looks like "bytes 20313// {First-Byte-Position}-{Last-Byte-Position}/{File-Length}". For example, Content-Range:bytes 300-5000/20000 20314// indicates that user is sending bytes 300 through 5,000 and the total file length is 20,000 bytes. 20315// timeout - the server timeout for performing the operation in seconds. This timeout specifies the time 20316// duration that the client is willing to wait for the requested operation to complete. The default value for 20317// this parameter is 60 seconds. 20318func (client BaseClient) UploadFileChunk(ctx context.Context, contentPath string, sessionID uuid.UUID, contentRange string, timeout *int64) (result autorest.Response, err error) { 20319 if tracing.IsEnabled() { 20320 ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.UploadFileChunk") 20321 defer func() { 20322 sc := -1 20323 if result.Response != nil { 20324 sc = result.Response.StatusCode 20325 } 20326 tracing.EndSpan(ctx, sc, err) 20327 }() 20328 } 20329 if err := validation.Validate([]validation.Validation{ 20330 {TargetValue: timeout, 20331 Constraints: []validation.Constraint{{Target: "timeout", Name: validation.Null, Rule: false, 20332 Chain: []validation.Constraint{{Target: "timeout", Name: validation.InclusiveMaximum, Rule: int64(4294967295), Chain: nil}, 20333 {Target: "timeout", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, 20334 }}}}}); err != nil { 20335 return result, validation.NewError("servicefabric.BaseClient", "UploadFileChunk", err.Error()) 20336 } 20337 20338 req, err := client.UploadFileChunkPreparer(ctx, contentPath, sessionID, contentRange, timeout) 20339 if err != nil { 20340 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UploadFileChunk", nil, "Failure preparing request") 20341 return 20342 } 20343 20344 resp, err := client.UploadFileChunkSender(req) 20345 if err != nil { 20346 result.Response = resp 20347 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UploadFileChunk", resp, "Failure sending request") 20348 return 20349 } 20350 20351 result, err = client.UploadFileChunkResponder(resp) 20352 if err != nil { 20353 err = autorest.NewErrorWithError(err, "servicefabric.BaseClient", "UploadFileChunk", resp, "Failure responding to request") 20354 return 20355 } 20356 20357 return 20358} 20359 20360// UploadFileChunkPreparer prepares the UploadFileChunk request. 20361func (client BaseClient) UploadFileChunkPreparer(ctx context.Context, contentPath string, sessionID uuid.UUID, contentRange string, timeout *int64) (*http.Request, error) { 20362 pathParameters := map[string]interface{}{ 20363 "contentPath": autorest.Encode("path", contentPath), 20364 } 20365 20366 const APIVersion = "6.0" 20367 queryParameters := map[string]interface{}{ 20368 "api-version": APIVersion, 20369 "session-id": autorest.Encode("query", sessionID), 20370 } 20371 if timeout != nil { 20372 queryParameters["timeout"] = autorest.Encode("query", *timeout) 20373 } else { 20374 queryParameters["timeout"] = autorest.Encode("query", 60) 20375 } 20376 20377 preparer := autorest.CreatePreparer( 20378 autorest.AsPut(), 20379 autorest.WithBaseURL(client.BaseURI), 20380 autorest.WithPathParameters("/ImageStore/{contentPath}/$/UploadChunk", pathParameters), 20381 autorest.WithQueryParameters(queryParameters), 20382 autorest.WithHeader("Content-Range", autorest.String(contentRange))) 20383 return preparer.Prepare((&http.Request{}).WithContext(ctx)) 20384} 20385 20386// UploadFileChunkSender sends the UploadFileChunk request. The method will close the 20387// http.Response Body if it receives an error. 20388func (client BaseClient) UploadFileChunkSender(req *http.Request) (*http.Response, error) { 20389 return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 20390} 20391 20392// UploadFileChunkResponder handles the response to the UploadFileChunk request. The method always 20393// closes the http.Response Body. 20394func (client BaseClient) UploadFileChunkResponder(resp *http.Response) (result autorest.Response, err error) { 20395 err = autorest.Respond( 20396 resp, 20397 azure.WithErrorUnlessStatusCode(http.StatusOK), 20398 autorest.ByClosing()) 20399 result.Response = resp 20400 return 20401} 20402