github.com/opentelekomcloud/gophertelekomcloud@v0.9.3/openstack/ims/v1/members/BatchUpdateMembers.go (about)

     1  package members
     2  
     3  import (
     4  	golangsdk "github.com/opentelekomcloud/gophertelekomcloud"
     5  	"github.com/opentelekomcloud/gophertelekomcloud/internal/build"
     6  	"github.com/opentelekomcloud/gophertelekomcloud/openstack/ims/v1/others"
     7  )
     8  
     9  type BatchUpdateMembersOpts struct {
    10  	// Specifies the image IDs.
    11  	Images []string `json:"images" required:"true"`
    12  	// Specifies the project ID.
    13  	ProjectId string `json:"project_id" required:"true"`
    14  	// Specifies whether a shared image will be accepted or declined.
    15  	//
    16  	// The value can be one of the following:
    17  	//
    18  	// accepted: indicates that a shared image is accepted. After an image is accepted, the image is displayed in the image list. You can use the image to create ECSs.
    19  	//
    20  	// rejected: indicates that a shared image is declined. After an image is declined, the image is not displayed in the image list. However, you can still use the image to create ECSs.
    21  	Status string `json:"status" required:"true"`
    22  	// Specifies the ID of a vault.
    23  	//
    24  	// This parameter is mandatory if you want to accept a shared full-ECS image created from a CBR backup.
    25  	//
    26  	// You can obtain the vault ID from the CBR console or section "Querying the Vault List" in Cloud Backup and Recovery API Reference.
    27  	VaultId string `json:"vault_id,omitempty"`
    28  }
    29  
    30  func BatchUpdateMembers(client *golangsdk.ServiceClient, opts BatchUpdateMembersOpts) (*string, error) {
    31  	b, err := build.RequestBody(opts, "")
    32  	if err != nil {
    33  		return nil, err
    34  	}
    35  
    36  	// PUT /v1/cloudimages/members
    37  	raw, err := client.Put(client.ServiceURL("cloudimages", "members"), b, nil, &golangsdk.RequestOpts{
    38  		OkCodes: []int{200},
    39  	})
    40  	return others.ExtractJobId(err, raw)
    41  }