1package netapp 2 3// Copyright (c) Microsoft and contributors. All rights reserved. 4// 5// Licensed under the Apache License, Version 2.0 (the "License"); 6// you may not use this file except in compliance with the License. 7// You may obtain a copy of the License at 8// http://www.apache.org/licenses/LICENSE-2.0 9// 10// Unless required by applicable law or agreed to in writing, software 11// distributed under the License is distributed on an "AS IS" BASIS, 12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13// 14// See the License for the specific language governing permissions and 15// limitations under the License. 16// 17// Code generated by Microsoft (R) AutoRest Code Generator. 18// Changes may cause incorrect behavior and will be lost if the code is regenerated. 19 20import ( 21 "context" 22 "encoding/json" 23 "github.com/Azure/go-autorest/autorest" 24 "github.com/Azure/go-autorest/autorest/azure" 25 "github.com/Azure/go-autorest/autorest/date" 26 "net/http" 27) 28 29// The package's fully qualified name. 30const fqdn = "github.com/Azure/azure-sdk-for-go/services/netapp/mgmt/2019-10-01/netapp" 31 32// CheckNameResourceTypes enumerates the values for check name resource types. 33type CheckNameResourceTypes string 34 35const ( 36 // MicrosoftNetAppnetAppAccounts ... 37 MicrosoftNetAppnetAppAccounts CheckNameResourceTypes = "Microsoft.NetApp/netAppAccounts" 38 // MicrosoftNetAppnetAppAccountscapacityPools ... 39 MicrosoftNetAppnetAppAccountscapacityPools CheckNameResourceTypes = "Microsoft.NetApp/netAppAccounts/capacityPools" 40 // MicrosoftNetAppnetAppAccountscapacityPoolsvolumes ... 41 MicrosoftNetAppnetAppAccountscapacityPoolsvolumes CheckNameResourceTypes = "Microsoft.NetApp/netAppAccounts/capacityPools/volumes" 42 // MicrosoftNetAppnetAppAccountscapacityPoolsvolumessnapshots ... 43 MicrosoftNetAppnetAppAccountscapacityPoolsvolumessnapshots CheckNameResourceTypes = "Microsoft.NetApp/netAppAccounts/capacityPools/volumes/snapshots" 44) 45 46// PossibleCheckNameResourceTypesValues returns an array of possible values for the CheckNameResourceTypes const type. 47func PossibleCheckNameResourceTypesValues() []CheckNameResourceTypes { 48 return []CheckNameResourceTypes{MicrosoftNetAppnetAppAccounts, MicrosoftNetAppnetAppAccountscapacityPools, MicrosoftNetAppnetAppAccountscapacityPoolsvolumes, MicrosoftNetAppnetAppAccountscapacityPoolsvolumessnapshots} 49} 50 51// EndpointType enumerates the values for endpoint type. 52type EndpointType string 53 54const ( 55 // Dst ... 56 Dst EndpointType = "dst" 57 // Src ... 58 Src EndpointType = "src" 59) 60 61// PossibleEndpointTypeValues returns an array of possible values for the EndpointType const type. 62func PossibleEndpointTypeValues() []EndpointType { 63 return []EndpointType{Dst, Src} 64} 65 66// InAvailabilityReasonType enumerates the values for in availability reason type. 67type InAvailabilityReasonType string 68 69const ( 70 // AlreadyExists ... 71 AlreadyExists InAvailabilityReasonType = "AlreadyExists" 72 // Invalid ... 73 Invalid InAvailabilityReasonType = "Invalid" 74) 75 76// PossibleInAvailabilityReasonTypeValues returns an array of possible values for the InAvailabilityReasonType const type. 77func PossibleInAvailabilityReasonTypeValues() []InAvailabilityReasonType { 78 return []InAvailabilityReasonType{AlreadyExists, Invalid} 79} 80 81// MirrorState enumerates the values for mirror state. 82type MirrorState string 83 84const ( 85 // Broken ... 86 Broken MirrorState = "Broken" 87 // Mirrored ... 88 Mirrored MirrorState = "Mirrored" 89 // Uninitialized ... 90 Uninitialized MirrorState = "Uninitialized" 91) 92 93// PossibleMirrorStateValues returns an array of possible values for the MirrorState const type. 94func PossibleMirrorStateValues() []MirrorState { 95 return []MirrorState{Broken, Mirrored, Uninitialized} 96} 97 98// RelationshipStatus enumerates the values for relationship status. 99type RelationshipStatus string 100 101const ( 102 // Idle ... 103 Idle RelationshipStatus = "Idle" 104 // Transferring ... 105 Transferring RelationshipStatus = "Transferring" 106) 107 108// PossibleRelationshipStatusValues returns an array of possible values for the RelationshipStatus const type. 109func PossibleRelationshipStatusValues() []RelationshipStatus { 110 return []RelationshipStatus{Idle, Transferring} 111} 112 113// ReplicationSchedule enumerates the values for replication schedule. 114type ReplicationSchedule string 115 116const ( 117 // OneZerominutely ... 118 OneZerominutely ReplicationSchedule = "_10minutely" 119 // Daily ... 120 Daily ReplicationSchedule = "daily" 121 // Hourly ... 122 Hourly ReplicationSchedule = "hourly" 123 // Monthly ... 124 Monthly ReplicationSchedule = "monthly" 125 // Weekly ... 126 Weekly ReplicationSchedule = "weekly" 127) 128 129// PossibleReplicationScheduleValues returns an array of possible values for the ReplicationSchedule const type. 130func PossibleReplicationScheduleValues() []ReplicationSchedule { 131 return []ReplicationSchedule{OneZerominutely, Daily, Hourly, Monthly, Weekly} 132} 133 134// ServiceLevel enumerates the values for service level. 135type ServiceLevel string 136 137const ( 138 // Premium Premium service level 139 Premium ServiceLevel = "Premium" 140 // Standard Standard service level 141 Standard ServiceLevel = "Standard" 142 // Ultra Ultra service level 143 Ultra ServiceLevel = "Ultra" 144) 145 146// PossibleServiceLevelValues returns an array of possible values for the ServiceLevel const type. 147func PossibleServiceLevelValues() []ServiceLevel { 148 return []ServiceLevel{Premium, Standard, Ultra} 149} 150 151// Account netApp account resource 152type Account struct { 153 autorest.Response `json:"-"` 154 // Location - Resource location 155 Location *string `json:"location,omitempty"` 156 // ID - READ-ONLY; Resource Id 157 ID *string `json:"id,omitempty"` 158 // Name - READ-ONLY; Resource name 159 Name *string `json:"name,omitempty"` 160 // Type - READ-ONLY; Resource type 161 Type *string `json:"type,omitempty"` 162 // Tags - Resource tags 163 Tags map[string]*string `json:"tags"` 164 // AccountProperties - NetApp Account properties 165 *AccountProperties `json:"properties,omitempty"` 166} 167 168// MarshalJSON is the custom marshaler for Account. 169func (a Account) MarshalJSON() ([]byte, error) { 170 objectMap := make(map[string]interface{}) 171 if a.Location != nil { 172 objectMap["location"] = a.Location 173 } 174 if a.Tags != nil { 175 objectMap["tags"] = a.Tags 176 } 177 if a.AccountProperties != nil { 178 objectMap["properties"] = a.AccountProperties 179 } 180 return json.Marshal(objectMap) 181} 182 183// UnmarshalJSON is the custom unmarshaler for Account struct. 184func (a *Account) UnmarshalJSON(body []byte) error { 185 var m map[string]*json.RawMessage 186 err := json.Unmarshal(body, &m) 187 if err != nil { 188 return err 189 } 190 for k, v := range m { 191 switch k { 192 case "location": 193 if v != nil { 194 var location string 195 err = json.Unmarshal(*v, &location) 196 if err != nil { 197 return err 198 } 199 a.Location = &location 200 } 201 case "id": 202 if v != nil { 203 var ID string 204 err = json.Unmarshal(*v, &ID) 205 if err != nil { 206 return err 207 } 208 a.ID = &ID 209 } 210 case "name": 211 if v != nil { 212 var name string 213 err = json.Unmarshal(*v, &name) 214 if err != nil { 215 return err 216 } 217 a.Name = &name 218 } 219 case "type": 220 if v != nil { 221 var typeVar string 222 err = json.Unmarshal(*v, &typeVar) 223 if err != nil { 224 return err 225 } 226 a.Type = &typeVar 227 } 228 case "tags": 229 if v != nil { 230 var tags map[string]*string 231 err = json.Unmarshal(*v, &tags) 232 if err != nil { 233 return err 234 } 235 a.Tags = tags 236 } 237 case "properties": 238 if v != nil { 239 var accountProperties AccountProperties 240 err = json.Unmarshal(*v, &accountProperties) 241 if err != nil { 242 return err 243 } 244 a.AccountProperties = &accountProperties 245 } 246 } 247 } 248 249 return nil 250} 251 252// AccountList list of NetApp account resources 253type AccountList struct { 254 autorest.Response `json:"-"` 255 // Value - Multiple NetApp accounts 256 Value *[]Account `json:"value,omitempty"` 257} 258 259// AccountPatch netApp account patch resource 260type AccountPatch struct { 261 // Location - Resource location 262 Location *string `json:"location,omitempty"` 263 // ID - READ-ONLY; Resource Id 264 ID *string `json:"id,omitempty"` 265 // Name - READ-ONLY; Resource name 266 Name *string `json:"name,omitempty"` 267 // Type - READ-ONLY; Resource type 268 Type *string `json:"type,omitempty"` 269 // Tags - Resource tags 270 Tags map[string]*string `json:"tags"` 271 // AccountProperties - NetApp Account properties 272 *AccountProperties `json:"properties,omitempty"` 273} 274 275// MarshalJSON is the custom marshaler for AccountPatch. 276func (ap AccountPatch) MarshalJSON() ([]byte, error) { 277 objectMap := make(map[string]interface{}) 278 if ap.Location != nil { 279 objectMap["location"] = ap.Location 280 } 281 if ap.Tags != nil { 282 objectMap["tags"] = ap.Tags 283 } 284 if ap.AccountProperties != nil { 285 objectMap["properties"] = ap.AccountProperties 286 } 287 return json.Marshal(objectMap) 288} 289 290// UnmarshalJSON is the custom unmarshaler for AccountPatch struct. 291func (ap *AccountPatch) UnmarshalJSON(body []byte) error { 292 var m map[string]*json.RawMessage 293 err := json.Unmarshal(body, &m) 294 if err != nil { 295 return err 296 } 297 for k, v := range m { 298 switch k { 299 case "location": 300 if v != nil { 301 var location string 302 err = json.Unmarshal(*v, &location) 303 if err != nil { 304 return err 305 } 306 ap.Location = &location 307 } 308 case "id": 309 if v != nil { 310 var ID string 311 err = json.Unmarshal(*v, &ID) 312 if err != nil { 313 return err 314 } 315 ap.ID = &ID 316 } 317 case "name": 318 if v != nil { 319 var name string 320 err = json.Unmarshal(*v, &name) 321 if err != nil { 322 return err 323 } 324 ap.Name = &name 325 } 326 case "type": 327 if v != nil { 328 var typeVar string 329 err = json.Unmarshal(*v, &typeVar) 330 if err != nil { 331 return err 332 } 333 ap.Type = &typeVar 334 } 335 case "tags": 336 if v != nil { 337 var tags map[string]*string 338 err = json.Unmarshal(*v, &tags) 339 if err != nil { 340 return err 341 } 342 ap.Tags = tags 343 } 344 case "properties": 345 if v != nil { 346 var accountProperties AccountProperties 347 err = json.Unmarshal(*v, &accountProperties) 348 if err != nil { 349 return err 350 } 351 ap.AccountProperties = &accountProperties 352 } 353 } 354 } 355 356 return nil 357} 358 359// AccountProperties netApp account properties 360type AccountProperties struct { 361 // ProvisioningState - READ-ONLY; Azure lifecycle management 362 ProvisioningState *string `json:"provisioningState,omitempty"` 363 // ActiveDirectories - Active Directories 364 ActiveDirectories *[]ActiveDirectory `json:"activeDirectories,omitempty"` 365} 366 367// AccountsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 368// operation. 369type AccountsCreateOrUpdateFuture struct { 370 azure.Future 371} 372 373// Result returns the result of the asynchronous operation. 374// If the operation has not completed it will return an error. 375func (future *AccountsCreateOrUpdateFuture) Result(client AccountsClient) (a Account, err error) { 376 var done bool 377 done, err = future.DoneWithContext(context.Background(), client) 378 if err != nil { 379 err = autorest.NewErrorWithError(err, "netapp.AccountsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 380 return 381 } 382 if !done { 383 err = azure.NewAsyncOpIncompleteError("netapp.AccountsCreateOrUpdateFuture") 384 return 385 } 386 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 387 if a.Response.Response, err = future.GetResult(sender); err == nil && a.Response.Response.StatusCode != http.StatusNoContent { 388 a, err = client.CreateOrUpdateResponder(a.Response.Response) 389 if err != nil { 390 err = autorest.NewErrorWithError(err, "netapp.AccountsCreateOrUpdateFuture", "Result", a.Response.Response, "Failure responding to request") 391 } 392 } 393 return 394} 395 396// AccountsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 397// operation. 398type AccountsDeleteFuture struct { 399 azure.Future 400} 401 402// Result returns the result of the asynchronous operation. 403// If the operation has not completed it will return an error. 404func (future *AccountsDeleteFuture) Result(client AccountsClient) (ar autorest.Response, err error) { 405 var done bool 406 done, err = future.DoneWithContext(context.Background(), client) 407 if err != nil { 408 err = autorest.NewErrorWithError(err, "netapp.AccountsDeleteFuture", "Result", future.Response(), "Polling failure") 409 return 410 } 411 if !done { 412 err = azure.NewAsyncOpIncompleteError("netapp.AccountsDeleteFuture") 413 return 414 } 415 ar.Response = future.Response() 416 return 417} 418 419// ActiveDirectory active Directory 420type ActiveDirectory struct { 421 // ActiveDirectoryID - Id of the Active Directory 422 ActiveDirectoryID *string `json:"activeDirectoryId,omitempty"` 423 // Username - Username of Active Directory domain administrator 424 Username *string `json:"username,omitempty"` 425 // Password - Plain text password of Active Directory domain administrator 426 Password *string `json:"password,omitempty"` 427 // Domain - Name of the Active Directory domain 428 Domain *string `json:"domain,omitempty"` 429 // DNS - Comma separated list of DNS server IP addresses (IPv4 only) for the Active Directory domain 430 DNS *string `json:"dns,omitempty"` 431 // Status - Status of the Active Directory 432 Status *string `json:"status,omitempty"` 433 // SmbServerName - NetBIOS name of the SMB server. This name will be registered as a computer account in the AD and used to mount volumes 434 SmbServerName *string `json:"smbServerName,omitempty"` 435 // OrganizationalUnit - The Organizational Unit (OU) within the Windows Active Directory 436 OrganizationalUnit *string `json:"organizationalUnit,omitempty"` 437} 438 439// AuthorizeRequest authorize request 440type AuthorizeRequest struct { 441 // RemoteVolumeResourceID - Resource id 442 RemoteVolumeResourceID *string `json:"remoteVolumeResourceId,omitempty"` 443} 444 445// CapacityPool capacity pool resource 446type CapacityPool struct { 447 autorest.Response `json:"-"` 448 // Location - Resource location 449 Location *string `json:"location,omitempty"` 450 // ID - READ-ONLY; Resource Id 451 ID *string `json:"id,omitempty"` 452 // Name - READ-ONLY; Resource name 453 Name *string `json:"name,omitempty"` 454 // Type - READ-ONLY; Resource type 455 Type *string `json:"type,omitempty"` 456 // Tags - Resource tags 457 Tags map[string]*string `json:"tags"` 458 // PoolProperties - Capacity pool properties 459 *PoolProperties `json:"properties,omitempty"` 460} 461 462// MarshalJSON is the custom marshaler for CapacityPool. 463func (cp CapacityPool) MarshalJSON() ([]byte, error) { 464 objectMap := make(map[string]interface{}) 465 if cp.Location != nil { 466 objectMap["location"] = cp.Location 467 } 468 if cp.Tags != nil { 469 objectMap["tags"] = cp.Tags 470 } 471 if cp.PoolProperties != nil { 472 objectMap["properties"] = cp.PoolProperties 473 } 474 return json.Marshal(objectMap) 475} 476 477// UnmarshalJSON is the custom unmarshaler for CapacityPool struct. 478func (cp *CapacityPool) UnmarshalJSON(body []byte) error { 479 var m map[string]*json.RawMessage 480 err := json.Unmarshal(body, &m) 481 if err != nil { 482 return err 483 } 484 for k, v := range m { 485 switch k { 486 case "location": 487 if v != nil { 488 var location string 489 err = json.Unmarshal(*v, &location) 490 if err != nil { 491 return err 492 } 493 cp.Location = &location 494 } 495 case "id": 496 if v != nil { 497 var ID string 498 err = json.Unmarshal(*v, &ID) 499 if err != nil { 500 return err 501 } 502 cp.ID = &ID 503 } 504 case "name": 505 if v != nil { 506 var name string 507 err = json.Unmarshal(*v, &name) 508 if err != nil { 509 return err 510 } 511 cp.Name = &name 512 } 513 case "type": 514 if v != nil { 515 var typeVar string 516 err = json.Unmarshal(*v, &typeVar) 517 if err != nil { 518 return err 519 } 520 cp.Type = &typeVar 521 } 522 case "tags": 523 if v != nil { 524 var tags map[string]*string 525 err = json.Unmarshal(*v, &tags) 526 if err != nil { 527 return err 528 } 529 cp.Tags = tags 530 } 531 case "properties": 532 if v != nil { 533 var poolProperties PoolProperties 534 err = json.Unmarshal(*v, &poolProperties) 535 if err != nil { 536 return err 537 } 538 cp.PoolProperties = &poolProperties 539 } 540 } 541 } 542 543 return nil 544} 545 546// CapacityPoolList list of capacity pool resources 547type CapacityPoolList struct { 548 autorest.Response `json:"-"` 549 // Value - List of Capacity pools 550 Value *[]CapacityPool `json:"value,omitempty"` 551} 552 553// CapacityPoolPatch capacity pool patch resource 554type CapacityPoolPatch struct { 555 // Location - Resource location 556 Location *string `json:"location,omitempty"` 557 // ID - READ-ONLY; Resource Id 558 ID *string `json:"id,omitempty"` 559 // Name - READ-ONLY; Resource name 560 Name *string `json:"name,omitempty"` 561 // Type - READ-ONLY; Resource type 562 Type *string `json:"type,omitempty"` 563 // Tags - Resource tags 564 Tags map[string]*string `json:"tags"` 565 // PoolPatchProperties - Capacity pool properties 566 *PoolPatchProperties `json:"properties,omitempty"` 567} 568 569// MarshalJSON is the custom marshaler for CapacityPoolPatch. 570func (cpp CapacityPoolPatch) MarshalJSON() ([]byte, error) { 571 objectMap := make(map[string]interface{}) 572 if cpp.Location != nil { 573 objectMap["location"] = cpp.Location 574 } 575 if cpp.Tags != nil { 576 objectMap["tags"] = cpp.Tags 577 } 578 if cpp.PoolPatchProperties != nil { 579 objectMap["properties"] = cpp.PoolPatchProperties 580 } 581 return json.Marshal(objectMap) 582} 583 584// UnmarshalJSON is the custom unmarshaler for CapacityPoolPatch struct. 585func (cpp *CapacityPoolPatch) UnmarshalJSON(body []byte) error { 586 var m map[string]*json.RawMessage 587 err := json.Unmarshal(body, &m) 588 if err != nil { 589 return err 590 } 591 for k, v := range m { 592 switch k { 593 case "location": 594 if v != nil { 595 var location string 596 err = json.Unmarshal(*v, &location) 597 if err != nil { 598 return err 599 } 600 cpp.Location = &location 601 } 602 case "id": 603 if v != nil { 604 var ID string 605 err = json.Unmarshal(*v, &ID) 606 if err != nil { 607 return err 608 } 609 cpp.ID = &ID 610 } 611 case "name": 612 if v != nil { 613 var name string 614 err = json.Unmarshal(*v, &name) 615 if err != nil { 616 return err 617 } 618 cpp.Name = &name 619 } 620 case "type": 621 if v != nil { 622 var typeVar string 623 err = json.Unmarshal(*v, &typeVar) 624 if err != nil { 625 return err 626 } 627 cpp.Type = &typeVar 628 } 629 case "tags": 630 if v != nil { 631 var tags map[string]*string 632 err = json.Unmarshal(*v, &tags) 633 if err != nil { 634 return err 635 } 636 cpp.Tags = tags 637 } 638 case "properties": 639 if v != nil { 640 var poolPatchProperties PoolPatchProperties 641 err = json.Unmarshal(*v, &poolPatchProperties) 642 if err != nil { 643 return err 644 } 645 cpp.PoolPatchProperties = &poolPatchProperties 646 } 647 } 648 } 649 650 return nil 651} 652 653// Dimension dimension of blobs, possibly be blob type or access tier. 654type Dimension struct { 655 // Name - Display name of dimension. 656 Name *string `json:"name,omitempty"` 657 // DisplayName - Display name of dimension. 658 DisplayName *string `json:"displayName,omitempty"` 659} 660 661// ExportPolicyRule volume Export Policy Rule 662type ExportPolicyRule struct { 663 // RuleIndex - Order index 664 RuleIndex *int32 `json:"ruleIndex,omitempty"` 665 // UnixReadOnly - Read only access 666 UnixReadOnly *bool `json:"unixReadOnly,omitempty"` 667 // UnixReadWrite - Read and write access 668 UnixReadWrite *bool `json:"unixReadWrite,omitempty"` 669 // Cifs - Allows CIFS protocol 670 Cifs *bool `json:"cifs,omitempty"` 671 // Nfsv3 - Allows NFSv3 protocol 672 Nfsv3 *bool `json:"nfsv3,omitempty"` 673 // Nfsv41 - Allows NFSv4.1 protocol 674 Nfsv41 *bool `json:"nfsv41,omitempty"` 675 // AllowedClients - Client ingress specification as comma separated string with IPv4 CIDRs, IPv4 host addresses and host names 676 AllowedClients *string `json:"allowedClients,omitempty"` 677} 678 679// MetricSpecification metric specification of operation. 680type MetricSpecification struct { 681 // Name - Name of metric specification. 682 Name *string `json:"name,omitempty"` 683 // DisplayName - Display name of metric specification. 684 DisplayName *string `json:"displayName,omitempty"` 685 // DisplayDescription - Display description of metric specification. 686 DisplayDescription *string `json:"displayDescription,omitempty"` 687 // Unit - Unit could be Bytes or Count. 688 Unit *string `json:"unit,omitempty"` 689 // Dimensions - Dimensions of blobs, including blob type and access tier. 690 Dimensions *[]Dimension `json:"dimensions,omitempty"` 691 // AggregationType - Aggregation type could be Average. 692 AggregationType *string `json:"aggregationType,omitempty"` 693 // FillGapWithZero - The property to decide fill gap with zero or not. 694 FillGapWithZero *bool `json:"fillGapWithZero,omitempty"` 695 // Category - The category this metric specification belong to, could be Capacity. 696 Category *string `json:"category,omitempty"` 697 // ResourceIDDimensionNameOverride - Account Resource Id. 698 ResourceIDDimensionNameOverride *string `json:"resourceIdDimensionNameOverride,omitempty"` 699} 700 701// MountTarget mount Target 702type MountTarget struct { 703 // Location - Resource location 704 Location *string `json:"location,omitempty"` 705 // ID - READ-ONLY; Resource Id 706 ID *string `json:"id,omitempty"` 707 // Name - READ-ONLY; Resource name 708 Name *string `json:"name,omitempty"` 709 // Type - READ-ONLY; Resource type 710 Type *string `json:"type,omitempty"` 711 // Tags - Resource tags 712 Tags map[string]*string `json:"tags"` 713 // MountTargetProperties - Mount Target Properties 714 *MountTargetProperties `json:"properties,omitempty"` 715} 716 717// MarshalJSON is the custom marshaler for MountTarget. 718func (mt MountTarget) MarshalJSON() ([]byte, error) { 719 objectMap := make(map[string]interface{}) 720 if mt.Location != nil { 721 objectMap["location"] = mt.Location 722 } 723 if mt.Tags != nil { 724 objectMap["tags"] = mt.Tags 725 } 726 if mt.MountTargetProperties != nil { 727 objectMap["properties"] = mt.MountTargetProperties 728 } 729 return json.Marshal(objectMap) 730} 731 732// UnmarshalJSON is the custom unmarshaler for MountTarget struct. 733func (mt *MountTarget) UnmarshalJSON(body []byte) error { 734 var m map[string]*json.RawMessage 735 err := json.Unmarshal(body, &m) 736 if err != nil { 737 return err 738 } 739 for k, v := range m { 740 switch k { 741 case "location": 742 if v != nil { 743 var location string 744 err = json.Unmarshal(*v, &location) 745 if err != nil { 746 return err 747 } 748 mt.Location = &location 749 } 750 case "id": 751 if v != nil { 752 var ID string 753 err = json.Unmarshal(*v, &ID) 754 if err != nil { 755 return err 756 } 757 mt.ID = &ID 758 } 759 case "name": 760 if v != nil { 761 var name string 762 err = json.Unmarshal(*v, &name) 763 if err != nil { 764 return err 765 } 766 mt.Name = &name 767 } 768 case "type": 769 if v != nil { 770 var typeVar string 771 err = json.Unmarshal(*v, &typeVar) 772 if err != nil { 773 return err 774 } 775 mt.Type = &typeVar 776 } 777 case "tags": 778 if v != nil { 779 var tags map[string]*string 780 err = json.Unmarshal(*v, &tags) 781 if err != nil { 782 return err 783 } 784 mt.Tags = tags 785 } 786 case "properties": 787 if v != nil { 788 var mountTargetProperties MountTargetProperties 789 err = json.Unmarshal(*v, &mountTargetProperties) 790 if err != nil { 791 return err 792 } 793 mt.MountTargetProperties = &mountTargetProperties 794 } 795 } 796 } 797 798 return nil 799} 800 801// MountTargetList list of Mount Targets 802type MountTargetList struct { 803 autorest.Response `json:"-"` 804 // Value - A list of Mount targets 805 Value *[]MountTarget `json:"value,omitempty"` 806} 807 808// MountTargetProperties mount target properties 809type MountTargetProperties struct { 810 // MountTargetID - READ-ONLY; UUID v4 used to identify the MountTarget 811 MountTargetID *string `json:"mountTargetId,omitempty"` 812 // FileSystemID - UUID v4 used to identify the MountTarget 813 FileSystemID *string `json:"fileSystemId,omitempty"` 814 // IPAddress - READ-ONLY; The mount target's IPv4 address 815 IPAddress *string `json:"ipAddress,omitempty"` 816 // Subnet - The subnet 817 Subnet *string `json:"subnet,omitempty"` 818 // StartIP - The start of IPv4 address range to use when creating a new mount target 819 StartIP *string `json:"startIp,omitempty"` 820 // EndIP - The end of IPv4 address range to use when creating a new mount target 821 EndIP *string `json:"endIp,omitempty"` 822 // Gateway - The gateway of the IPv4 address range to use when creating a new mount target 823 Gateway *string `json:"gateway,omitempty"` 824 // Netmask - The netmask of the IPv4 address range to use when creating a new mount target 825 Netmask *string `json:"netmask,omitempty"` 826 // SmbServerFqdn - The SMB server's Fully Qualified Domain Name, FQDN 827 SmbServerFqdn *string `json:"smbServerFqdn,omitempty"` 828 // ProvisioningState - READ-ONLY; Azure lifecycle management 829 ProvisioningState *string `json:"provisioningState,omitempty"` 830} 831 832// Operation microsoft.NetApp REST API operation definition. 833type Operation struct { 834 // Name - Operation name: {provider}/{resource}/{operation} 835 Name *string `json:"name,omitempty"` 836 // Display - Display metadata associated with the operation. 837 Display *OperationDisplay `json:"display,omitempty"` 838 // Origin - The origin of operations. 839 Origin *string `json:"origin,omitempty"` 840 // OperationProperties - Properties of operation, include metric specifications. 841 *OperationProperties `json:"properties,omitempty"` 842} 843 844// MarshalJSON is the custom marshaler for Operation. 845func (o Operation) MarshalJSON() ([]byte, error) { 846 objectMap := make(map[string]interface{}) 847 if o.Name != nil { 848 objectMap["name"] = o.Name 849 } 850 if o.Display != nil { 851 objectMap["display"] = o.Display 852 } 853 if o.Origin != nil { 854 objectMap["origin"] = o.Origin 855 } 856 if o.OperationProperties != nil { 857 objectMap["properties"] = o.OperationProperties 858 } 859 return json.Marshal(objectMap) 860} 861 862// UnmarshalJSON is the custom unmarshaler for Operation struct. 863func (o *Operation) UnmarshalJSON(body []byte) error { 864 var m map[string]*json.RawMessage 865 err := json.Unmarshal(body, &m) 866 if err != nil { 867 return err 868 } 869 for k, v := range m { 870 switch k { 871 case "name": 872 if v != nil { 873 var name string 874 err = json.Unmarshal(*v, &name) 875 if err != nil { 876 return err 877 } 878 o.Name = &name 879 } 880 case "display": 881 if v != nil { 882 var display OperationDisplay 883 err = json.Unmarshal(*v, &display) 884 if err != nil { 885 return err 886 } 887 o.Display = &display 888 } 889 case "origin": 890 if v != nil { 891 var origin string 892 err = json.Unmarshal(*v, &origin) 893 if err != nil { 894 return err 895 } 896 o.Origin = &origin 897 } 898 case "properties": 899 if v != nil { 900 var operationProperties OperationProperties 901 err = json.Unmarshal(*v, &operationProperties) 902 if err != nil { 903 return err 904 } 905 o.OperationProperties = &operationProperties 906 } 907 } 908 } 909 910 return nil 911} 912 913// OperationDisplay display metadata associated with the operation. 914type OperationDisplay struct { 915 // Provider - Service provider: Microsoft NetApp. 916 Provider *string `json:"provider,omitempty"` 917 // Resource - Resource on which the operation is performed etc. 918 Resource *string `json:"resource,omitempty"` 919 // Operation - Type of operation: get, read, delete, etc. 920 Operation *string `json:"operation,omitempty"` 921 // Description - Operation description. 922 Description *string `json:"description,omitempty"` 923} 924 925// OperationListResult result of the request to list Cloud Volume operations. It contains a list of 926// operations and a URL link to get the next set of results. 927type OperationListResult struct { 928 autorest.Response `json:"-"` 929 // Value - List of Storage operations supported by the Storage resource provider. 930 Value *[]Operation `json:"value,omitempty"` 931} 932 933// OperationProperties properties of operation, include metric specifications. 934type OperationProperties struct { 935 // ServiceSpecification - One property of operation, include metric specifications. 936 ServiceSpecification *ServiceSpecification `json:"serviceSpecification,omitempty"` 937} 938 939// PoolPatchProperties patchable pool properties 940type PoolPatchProperties struct { 941 // Size - Provisioned size of the pool (in bytes). Allowed values are in 4TiB chunks (value must be multiply of 4398046511104). 942 Size *int64 `json:"size,omitempty"` 943 // ServiceLevel - The service level of the file system. Possible values include: 'Standard', 'Premium', 'Ultra' 944 ServiceLevel ServiceLevel `json:"serviceLevel,omitempty"` 945} 946 947// PoolProperties pool properties 948type PoolProperties struct { 949 // PoolID - READ-ONLY; UUID v4 used to identify the Pool 950 PoolID *string `json:"poolId,omitempty"` 951 // Size - Provisioned size of the pool (in bytes). Allowed values are in 4TiB chunks (value must be multiply of 4398046511104). 952 Size *int64 `json:"size,omitempty"` 953 // ServiceLevel - The service level of the file system. Possible values include: 'Standard', 'Premium', 'Ultra' 954 ServiceLevel ServiceLevel `json:"serviceLevel,omitempty"` 955 // ProvisioningState - READ-ONLY; Azure lifecycle management 956 ProvisioningState *string `json:"provisioningState,omitempty"` 957} 958 959// PoolsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 960// operation. 961type PoolsCreateOrUpdateFuture struct { 962 azure.Future 963} 964 965// Result returns the result of the asynchronous operation. 966// If the operation has not completed it will return an error. 967func (future *PoolsCreateOrUpdateFuture) Result(client PoolsClient) (cp CapacityPool, err error) { 968 var done bool 969 done, err = future.DoneWithContext(context.Background(), client) 970 if err != nil { 971 err = autorest.NewErrorWithError(err, "netapp.PoolsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 972 return 973 } 974 if !done { 975 err = azure.NewAsyncOpIncompleteError("netapp.PoolsCreateOrUpdateFuture") 976 return 977 } 978 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 979 if cp.Response.Response, err = future.GetResult(sender); err == nil && cp.Response.Response.StatusCode != http.StatusNoContent { 980 cp, err = client.CreateOrUpdateResponder(cp.Response.Response) 981 if err != nil { 982 err = autorest.NewErrorWithError(err, "netapp.PoolsCreateOrUpdateFuture", "Result", cp.Response.Response, "Failure responding to request") 983 } 984 } 985 return 986} 987 988// PoolsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. 989type PoolsDeleteFuture struct { 990 azure.Future 991} 992 993// Result returns the result of the asynchronous operation. 994// If the operation has not completed it will return an error. 995func (future *PoolsDeleteFuture) Result(client PoolsClient) (ar autorest.Response, err error) { 996 var done bool 997 done, err = future.DoneWithContext(context.Background(), client) 998 if err != nil { 999 err = autorest.NewErrorWithError(err, "netapp.PoolsDeleteFuture", "Result", future.Response(), "Polling failure") 1000 return 1001 } 1002 if !done { 1003 err = azure.NewAsyncOpIncompleteError("netapp.PoolsDeleteFuture") 1004 return 1005 } 1006 ar.Response = future.Response() 1007 return 1008} 1009 1010// ReplicationObject replication properties 1011type ReplicationObject struct { 1012 // ReplicationID - Id 1013 ReplicationID *string `json:"replicationId,omitempty"` 1014 // EndpointType - Indicates whether the local volume is the source or destination for the Volume Replication. Possible values include: 'Src', 'Dst' 1015 EndpointType EndpointType `json:"endpointType,omitempty"` 1016 // ReplicationSchedule - Schedule. Possible values include: '10minutely', 'Hourly', 'Daily', 'Weekly', 'Monthly' 1017 ReplicationSchedule ReplicationSchedule `json:"replicationSchedule,omitempty"` 1018 // RemoteVolumeResourceID - The resource ID of the remote volume. 1019 RemoteVolumeResourceID *string `json:"remoteVolumeResourceId,omitempty"` 1020 // RemoteVolumeRegion - The remote region for the other end of the Volume Replication. 1021 RemoteVolumeRegion *string `json:"remoteVolumeRegion,omitempty"` 1022} 1023 1024// ReplicationStatus replication status 1025type ReplicationStatus struct { 1026 autorest.Response `json:"-"` 1027 // Healthy - Replication health check 1028 Healthy *bool `json:"healthy,omitempty"` 1029 // RelationshipStatus - Status of the mirror relationship. Possible values include: 'Idle', 'Transferring' 1030 RelationshipStatus RelationshipStatus `json:"relationshipStatus,omitempty"` 1031 // MirrorState - The status of the replication. Possible values include: 'Uninitialized', 'Mirrored', 'Broken' 1032 MirrorState MirrorState `json:"mirrorState,omitempty"` 1033 // TotalProgress - The progress of the replication 1034 TotalProgress *string `json:"totalProgress,omitempty"` 1035 // ErrorMessage - Displays error message if the replication is in an error state 1036 ErrorMessage *string `json:"errorMessage,omitempty"` 1037} 1038 1039// ResourceNameAvailability information regarding availability of a resource name. 1040type ResourceNameAvailability struct { 1041 autorest.Response `json:"-"` 1042 // IsAvailable - <code>true</code> indicates name is valid and available. <code>false</code> indicates the name is invalid, unavailable, or both. 1043 IsAvailable *bool `json:"isAvailable,omitempty"` 1044 // Reason - <code>Invalid</code> indicates the name provided does not match Azure App Service naming requirements. <code>AlreadyExists</code> indicates that the name is already in use and is therefore unavailable. Possible values include: 'Invalid', 'AlreadyExists' 1045 Reason InAvailabilityReasonType `json:"reason,omitempty"` 1046 // Message - If reason == invalid, provide the user with the reason why the given name is invalid, and provide the resource naming requirements so that the user can select a valid name. If reason == AlreadyExists, explain that resource name is already in use, and direct them to select a different name. 1047 Message *string `json:"message,omitempty"` 1048} 1049 1050// ResourceNameAvailabilityRequest resource name availability request content. 1051type ResourceNameAvailabilityRequest struct { 1052 // Name - Resource name to verify. 1053 Name *string `json:"name,omitempty"` 1054 // Type - Resource type used for verification. Possible values include: 'MicrosoftNetAppnetAppAccounts', 'MicrosoftNetAppnetAppAccountscapacityPools', 'MicrosoftNetAppnetAppAccountscapacityPoolsvolumes', 'MicrosoftNetAppnetAppAccountscapacityPoolsvolumessnapshots' 1055 Type CheckNameResourceTypes `json:"type,omitempty"` 1056 // ResourceGroup - Resource group name. 1057 ResourceGroup *string `json:"resourceGroup,omitempty"` 1058} 1059 1060// ServiceSpecification one property of operation, include metric specifications. 1061type ServiceSpecification struct { 1062 // MetricSpecifications - Metric specifications of operation. 1063 MetricSpecifications *[]MetricSpecification `json:"metricSpecifications,omitempty"` 1064} 1065 1066// Snapshot snapshot of a Volume 1067type Snapshot struct { 1068 autorest.Response `json:"-"` 1069 // Location - Resource location 1070 Location *string `json:"location,omitempty"` 1071 // ID - READ-ONLY; Resource Id 1072 ID *string `json:"id,omitempty"` 1073 // Name - READ-ONLY; Resource name 1074 Name *string `json:"name,omitempty"` 1075 // Type - READ-ONLY; Resource type 1076 Type *string `json:"type,omitempty"` 1077 // Tags - Resource tags 1078 Tags map[string]*string `json:"tags"` 1079 // SnapshotProperties - Snapshot Properties 1080 *SnapshotProperties `json:"properties,omitempty"` 1081} 1082 1083// MarshalJSON is the custom marshaler for Snapshot. 1084func (s Snapshot) MarshalJSON() ([]byte, error) { 1085 objectMap := make(map[string]interface{}) 1086 if s.Location != nil { 1087 objectMap["location"] = s.Location 1088 } 1089 if s.Tags != nil { 1090 objectMap["tags"] = s.Tags 1091 } 1092 if s.SnapshotProperties != nil { 1093 objectMap["properties"] = s.SnapshotProperties 1094 } 1095 return json.Marshal(objectMap) 1096} 1097 1098// UnmarshalJSON is the custom unmarshaler for Snapshot struct. 1099func (s *Snapshot) UnmarshalJSON(body []byte) error { 1100 var m map[string]*json.RawMessage 1101 err := json.Unmarshal(body, &m) 1102 if err != nil { 1103 return err 1104 } 1105 for k, v := range m { 1106 switch k { 1107 case "location": 1108 if v != nil { 1109 var location string 1110 err = json.Unmarshal(*v, &location) 1111 if err != nil { 1112 return err 1113 } 1114 s.Location = &location 1115 } 1116 case "id": 1117 if v != nil { 1118 var ID string 1119 err = json.Unmarshal(*v, &ID) 1120 if err != nil { 1121 return err 1122 } 1123 s.ID = &ID 1124 } 1125 case "name": 1126 if v != nil { 1127 var name string 1128 err = json.Unmarshal(*v, &name) 1129 if err != nil { 1130 return err 1131 } 1132 s.Name = &name 1133 } 1134 case "type": 1135 if v != nil { 1136 var typeVar string 1137 err = json.Unmarshal(*v, &typeVar) 1138 if err != nil { 1139 return err 1140 } 1141 s.Type = &typeVar 1142 } 1143 case "tags": 1144 if v != nil { 1145 var tags map[string]*string 1146 err = json.Unmarshal(*v, &tags) 1147 if err != nil { 1148 return err 1149 } 1150 s.Tags = tags 1151 } 1152 case "properties": 1153 if v != nil { 1154 var snapshotProperties SnapshotProperties 1155 err = json.Unmarshal(*v, &snapshotProperties) 1156 if err != nil { 1157 return err 1158 } 1159 s.SnapshotProperties = &snapshotProperties 1160 } 1161 } 1162 } 1163 1164 return nil 1165} 1166 1167// SnapshotPatch snapshot patch 1168type SnapshotPatch struct { 1169 // Tags - Resource tags 1170 Tags map[string]*string `json:"tags"` 1171} 1172 1173// MarshalJSON is the custom marshaler for SnapshotPatch. 1174func (sp SnapshotPatch) MarshalJSON() ([]byte, error) { 1175 objectMap := make(map[string]interface{}) 1176 if sp.Tags != nil { 1177 objectMap["tags"] = sp.Tags 1178 } 1179 return json.Marshal(objectMap) 1180} 1181 1182// SnapshotProperties snapshot properties 1183type SnapshotProperties struct { 1184 // SnapshotID - READ-ONLY; UUID v4 used to identify the Snapshot 1185 SnapshotID *string `json:"snapshotId,omitempty"` 1186 // FileSystemID - UUID v4 used to identify the FileSystem 1187 FileSystemID *string `json:"fileSystemId,omitempty"` 1188 // Created - READ-ONLY; The creation date of the snapshot 1189 Created *date.Time `json:"created,omitempty"` 1190 // ProvisioningState - READ-ONLY; Azure lifecycle management 1191 ProvisioningState *string `json:"provisioningState,omitempty"` 1192} 1193 1194// SnapshotsCreateFuture an abstraction for monitoring and retrieving the results of a long-running 1195// operation. 1196type SnapshotsCreateFuture struct { 1197 azure.Future 1198} 1199 1200// Result returns the result of the asynchronous operation. 1201// If the operation has not completed it will return an error. 1202func (future *SnapshotsCreateFuture) Result(client SnapshotsClient) (s Snapshot, err error) { 1203 var done bool 1204 done, err = future.DoneWithContext(context.Background(), client) 1205 if err != nil { 1206 err = autorest.NewErrorWithError(err, "netapp.SnapshotsCreateFuture", "Result", future.Response(), "Polling failure") 1207 return 1208 } 1209 if !done { 1210 err = azure.NewAsyncOpIncompleteError("netapp.SnapshotsCreateFuture") 1211 return 1212 } 1213 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 1214 if s.Response.Response, err = future.GetResult(sender); err == nil && s.Response.Response.StatusCode != http.StatusNoContent { 1215 s, err = client.CreateResponder(s.Response.Response) 1216 if err != nil { 1217 err = autorest.NewErrorWithError(err, "netapp.SnapshotsCreateFuture", "Result", s.Response.Response, "Failure responding to request") 1218 } 1219 } 1220 return 1221} 1222 1223// SnapshotsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 1224// operation. 1225type SnapshotsDeleteFuture struct { 1226 azure.Future 1227} 1228 1229// Result returns the result of the asynchronous operation. 1230// If the operation has not completed it will return an error. 1231func (future *SnapshotsDeleteFuture) Result(client SnapshotsClient) (ar autorest.Response, err error) { 1232 var done bool 1233 done, err = future.DoneWithContext(context.Background(), client) 1234 if err != nil { 1235 err = autorest.NewErrorWithError(err, "netapp.SnapshotsDeleteFuture", "Result", future.Response(), "Polling failure") 1236 return 1237 } 1238 if !done { 1239 err = azure.NewAsyncOpIncompleteError("netapp.SnapshotsDeleteFuture") 1240 return 1241 } 1242 ar.Response = future.Response() 1243 return 1244} 1245 1246// SnapshotsList list of Snapshots 1247type SnapshotsList struct { 1248 autorest.Response `json:"-"` 1249 // Value - A list of Snapshots 1250 Value *[]Snapshot `json:"value,omitempty"` 1251} 1252 1253// Volume volume resource 1254type Volume struct { 1255 autorest.Response `json:"-"` 1256 // Location - Resource location 1257 Location *string `json:"location,omitempty"` 1258 // ID - READ-ONLY; Resource Id 1259 ID *string `json:"id,omitempty"` 1260 // Name - READ-ONLY; Resource name 1261 Name *string `json:"name,omitempty"` 1262 // Type - READ-ONLY; Resource type 1263 Type *string `json:"type,omitempty"` 1264 // Tags - Resource tags 1265 Tags map[string]*string `json:"tags"` 1266 // VolumeProperties - Volume properties 1267 *VolumeProperties `json:"properties,omitempty"` 1268} 1269 1270// MarshalJSON is the custom marshaler for Volume. 1271func (vVar Volume) MarshalJSON() ([]byte, error) { 1272 objectMap := make(map[string]interface{}) 1273 if vVar.Location != nil { 1274 objectMap["location"] = vVar.Location 1275 } 1276 if vVar.Tags != nil { 1277 objectMap["tags"] = vVar.Tags 1278 } 1279 if vVar.VolumeProperties != nil { 1280 objectMap["properties"] = vVar.VolumeProperties 1281 } 1282 return json.Marshal(objectMap) 1283} 1284 1285// UnmarshalJSON is the custom unmarshaler for Volume struct. 1286func (vVar *Volume) UnmarshalJSON(body []byte) error { 1287 var m map[string]*json.RawMessage 1288 err := json.Unmarshal(body, &m) 1289 if err != nil { 1290 return err 1291 } 1292 for k, v := range m { 1293 switch k { 1294 case "location": 1295 if v != nil { 1296 var location string 1297 err = json.Unmarshal(*v, &location) 1298 if err != nil { 1299 return err 1300 } 1301 vVar.Location = &location 1302 } 1303 case "id": 1304 if v != nil { 1305 var ID string 1306 err = json.Unmarshal(*v, &ID) 1307 if err != nil { 1308 return err 1309 } 1310 vVar.ID = &ID 1311 } 1312 case "name": 1313 if v != nil { 1314 var name string 1315 err = json.Unmarshal(*v, &name) 1316 if err != nil { 1317 return err 1318 } 1319 vVar.Name = &name 1320 } 1321 case "type": 1322 if v != nil { 1323 var typeVar string 1324 err = json.Unmarshal(*v, &typeVar) 1325 if err != nil { 1326 return err 1327 } 1328 vVar.Type = &typeVar 1329 } 1330 case "tags": 1331 if v != nil { 1332 var tags map[string]*string 1333 err = json.Unmarshal(*v, &tags) 1334 if err != nil { 1335 return err 1336 } 1337 vVar.Tags = tags 1338 } 1339 case "properties": 1340 if v != nil { 1341 var volumeProperties VolumeProperties 1342 err = json.Unmarshal(*v, &volumeProperties) 1343 if err != nil { 1344 return err 1345 } 1346 vVar.VolumeProperties = &volumeProperties 1347 } 1348 } 1349 } 1350 1351 return nil 1352} 1353 1354// VolumeList list of volume resources 1355type VolumeList struct { 1356 autorest.Response `json:"-"` 1357 // Value - List of volumes 1358 Value *[]Volume `json:"value,omitempty"` 1359} 1360 1361// VolumePatch volume patch resource 1362type VolumePatch struct { 1363 // Location - Resource location 1364 Location *string `json:"location,omitempty"` 1365 // ID - READ-ONLY; Resource Id 1366 ID *string `json:"id,omitempty"` 1367 // Name - READ-ONLY; Resource name 1368 Name *string `json:"name,omitempty"` 1369 // Type - READ-ONLY; Resource type 1370 Type *string `json:"type,omitempty"` 1371 // Tags - Resource tags 1372 Tags map[string]*string `json:"tags"` 1373 // VolumePatchProperties - Patchable volume properties 1374 *VolumePatchProperties `json:"properties,omitempty"` 1375} 1376 1377// MarshalJSON is the custom marshaler for VolumePatch. 1378func (vp VolumePatch) MarshalJSON() ([]byte, error) { 1379 objectMap := make(map[string]interface{}) 1380 if vp.Location != nil { 1381 objectMap["location"] = vp.Location 1382 } 1383 if vp.Tags != nil { 1384 objectMap["tags"] = vp.Tags 1385 } 1386 if vp.VolumePatchProperties != nil { 1387 objectMap["properties"] = vp.VolumePatchProperties 1388 } 1389 return json.Marshal(objectMap) 1390} 1391 1392// UnmarshalJSON is the custom unmarshaler for VolumePatch struct. 1393func (vp *VolumePatch) UnmarshalJSON(body []byte) error { 1394 var m map[string]*json.RawMessage 1395 err := json.Unmarshal(body, &m) 1396 if err != nil { 1397 return err 1398 } 1399 for k, v := range m { 1400 switch k { 1401 case "location": 1402 if v != nil { 1403 var location string 1404 err = json.Unmarshal(*v, &location) 1405 if err != nil { 1406 return err 1407 } 1408 vp.Location = &location 1409 } 1410 case "id": 1411 if v != nil { 1412 var ID string 1413 err = json.Unmarshal(*v, &ID) 1414 if err != nil { 1415 return err 1416 } 1417 vp.ID = &ID 1418 } 1419 case "name": 1420 if v != nil { 1421 var name string 1422 err = json.Unmarshal(*v, &name) 1423 if err != nil { 1424 return err 1425 } 1426 vp.Name = &name 1427 } 1428 case "type": 1429 if v != nil { 1430 var typeVar string 1431 err = json.Unmarshal(*v, &typeVar) 1432 if err != nil { 1433 return err 1434 } 1435 vp.Type = &typeVar 1436 } 1437 case "tags": 1438 if v != nil { 1439 var tags map[string]*string 1440 err = json.Unmarshal(*v, &tags) 1441 if err != nil { 1442 return err 1443 } 1444 vp.Tags = tags 1445 } 1446 case "properties": 1447 if v != nil { 1448 var volumePatchProperties VolumePatchProperties 1449 err = json.Unmarshal(*v, &volumePatchProperties) 1450 if err != nil { 1451 return err 1452 } 1453 vp.VolumePatchProperties = &volumePatchProperties 1454 } 1455 } 1456 } 1457 1458 return nil 1459} 1460 1461// VolumePatchProperties patchable volume properties 1462type VolumePatchProperties struct { 1463 // ServiceLevel - The service level of the file system. Possible values include: 'Standard', 'Premium', 'Ultra' 1464 ServiceLevel ServiceLevel `json:"serviceLevel,omitempty"` 1465 // UsageThreshold - Maximum storage quota allowed for a file system in bytes. This is a soft quota used for alerting only. Minimum size is 100 GiB. Upper limit is 100TiB. Specified in bytes. 1466 UsageThreshold *int64 `json:"usageThreshold,omitempty"` 1467 // ExportPolicy - Set of export policy rules 1468 ExportPolicy *VolumePatchPropertiesExportPolicy `json:"exportPolicy,omitempty"` 1469} 1470 1471// VolumePatchPropertiesExportPolicy set of export policy rules 1472type VolumePatchPropertiesExportPolicy struct { 1473 // Rules - Export policy rule 1474 Rules *[]ExportPolicyRule `json:"rules,omitempty"` 1475} 1476 1477// VolumeProperties volume properties 1478type VolumeProperties struct { 1479 // FileSystemID - READ-ONLY; Unique FileSystem Identifier. 1480 FileSystemID *string `json:"fileSystemId,omitempty"` 1481 // CreationToken - A unique file path for the volume. Used when creating mount targets 1482 CreationToken *string `json:"creationToken,omitempty"` 1483 // ServiceLevel - The service level of the file system. Possible values include: 'Standard', 'Premium', 'Ultra' 1484 ServiceLevel ServiceLevel `json:"serviceLevel,omitempty"` 1485 // UsageThreshold - Maximum storage quota allowed for a file system in bytes. This is a soft quota used for alerting only. Minimum size is 100 GiB. Upper limit is 100TiB. Specified in bytes. 1486 UsageThreshold *int64 `json:"usageThreshold,omitempty"` 1487 // ExportPolicy - Set of export policy rules 1488 ExportPolicy *VolumePropertiesExportPolicy `json:"exportPolicy,omitempty"` 1489 // ProtocolTypes - Set of protocol types 1490 ProtocolTypes *[]string `json:"protocolTypes,omitempty"` 1491 // ProvisioningState - READ-ONLY; Azure lifecycle management 1492 ProvisioningState *string `json:"provisioningState,omitempty"` 1493 // SnapshotID - UUID v4 or resource identifier used to identify the Snapshot. 1494 SnapshotID *string `json:"snapshotId,omitempty"` 1495 // BaremetalTenantID - READ-ONLY; Unique Baremetal Tenant Identifier. 1496 BaremetalTenantID *string `json:"baremetalTenantId,omitempty"` 1497 // SubnetID - The Azure Resource URI for a delegated subnet. Must have the delegation Microsoft.NetApp/volumes 1498 SubnetID *string `json:"subnetId,omitempty"` 1499 // MountTargets - List of mount targets 1500 MountTargets *[]MountTargetProperties `json:"mountTargets,omitempty"` 1501 // VolumeType - What type of volume is this 1502 VolumeType *string `json:"volumeType,omitempty"` 1503 // DataProtection - DataProtection type volumes include an object containing details of the replication 1504 DataProtection *VolumePropertiesDataProtection `json:"dataProtection,omitempty"` 1505 // IsRestoring - Restoring 1506 IsRestoring *bool `json:"isRestoring,omitempty"` 1507} 1508 1509// VolumePropertiesDataProtection dataProtection type volumes include an object containing details of the 1510// replication 1511type VolumePropertiesDataProtection struct { 1512 // Replication - Replication properties 1513 Replication *ReplicationObject `json:"replication,omitempty"` 1514} 1515 1516// VolumePropertiesExportPolicy set of export policy rules 1517type VolumePropertiesExportPolicy struct { 1518 // Rules - Export policy rule 1519 Rules *[]ExportPolicyRule `json:"rules,omitempty"` 1520} 1521 1522// VolumesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running 1523// operation. 1524type VolumesCreateOrUpdateFuture struct { 1525 azure.Future 1526} 1527 1528// Result returns the result of the asynchronous operation. 1529// If the operation has not completed it will return an error. 1530func (future *VolumesCreateOrUpdateFuture) Result(client VolumesClient) (vVar Volume, err error) { 1531 var done bool 1532 done, err = future.DoneWithContext(context.Background(), client) 1533 if err != nil { 1534 err = autorest.NewErrorWithError(err, "netapp.VolumesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 1535 return 1536 } 1537 if !done { 1538 err = azure.NewAsyncOpIncompleteError("netapp.VolumesCreateOrUpdateFuture") 1539 return 1540 } 1541 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 1542 if vVar.Response.Response, err = future.GetResult(sender); err == nil && vVar.Response.Response.StatusCode != http.StatusNoContent { 1543 vVar, err = client.CreateOrUpdateResponder(vVar.Response.Response) 1544 if err != nil { 1545 err = autorest.NewErrorWithError(err, "netapp.VolumesCreateOrUpdateFuture", "Result", vVar.Response.Response, "Failure responding to request") 1546 } 1547 } 1548 return 1549} 1550 1551// VolumesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 1552// operation. 1553type VolumesDeleteFuture struct { 1554 azure.Future 1555} 1556 1557// Result returns the result of the asynchronous operation. 1558// If the operation has not completed it will return an error. 1559func (future *VolumesDeleteFuture) Result(client VolumesClient) (ar autorest.Response, err error) { 1560 var done bool 1561 done, err = future.DoneWithContext(context.Background(), client) 1562 if err != nil { 1563 err = autorest.NewErrorWithError(err, "netapp.VolumesDeleteFuture", "Result", future.Response(), "Polling failure") 1564 return 1565 } 1566 if !done { 1567 err = azure.NewAsyncOpIncompleteError("netapp.VolumesDeleteFuture") 1568 return 1569 } 1570 ar.Response = future.Response() 1571 return 1572} 1573