github.com/huaweicloud/golangsdk@v0.0.0-20210831081626-d823fe11ceba/openstack/csbs/v1/backup/doc.go (about)

     1  /*
     2  Package backup enables management and retrieval of
     3  back up resources.
     4  
     5  Example to List Backup
     6  	listbackup := backup.ListOpts{ID: "7b99acfd-18c3-4f26-9d39-b4ebd2ea3e12"}
     7  	allbackups, err := backup.List(client,listbackup)
     8  	if err != nil {
     9  		panic(err)
    10  	}
    11  	fmt.Println(allbackups)
    12  
    13  
    14  
    15  Example to Create a Backup
    16  	createBackup:=backup.CreateOpts{BackupName: "c2c-backup", Description: "mybackup"}
    17  	out,err:=backup.Create(client,"fc4d5750-22e7-4798-8a46-f48f62c4c1da", "f8ddc472-cf00-4384-851e-5f2a68c33762",
    18  							createBackup).Extract()
    19  	fmt.Println(out)
    20  	fmt.Println(err)
    21  
    22  Example to Query if resources can be backed up
    23  	createQuery:=backup.ResourceBackupCapOpts{CheckProtectable:[]backup.ResourceCapQueryParams{{ResourceId: "069e678a-f1d1-4a38-880b-459bde82fcc6",
    24  											ResourceType: "OS::Nova::Server"}}}
    25  	out,err:=backup.QueryResourceBackupCapability(client,"fc4d5750-22e7-4798-8a46-f48f62c4c1da",
    26  		createQuery).ExtractQueryResponse()
    27  	fmt.Println(out)
    28  	fmt.Println(err)
    29  
    30  
    31  Example to Delete a Backup
    32  	out:=backup.Delete(client,"fc4d5750-22e7-4798-8a46-f48f62c4c1da")
    33  	fmt.Println(out)
    34  	if err != nil {
    35  		panic(err)
    36  	}
    37  
    38  Example to Get Backup
    39  	result:=backup.Get(client,"7b99acfd-18c3-4f26-9d39-b4ebd2ea3e12")
    40  	out,err:=result.ExtractBackup()
    41  	fmt.Println(out)
    42  
    43  */
    44  package backup