云服务器内容精选

  • 请求示例 PUT https://metastudio.cn-east-3.myhuaweicloud.com/v1/6a6a1f8354f64dd9b9a614def7b59d83/digital-assets/93769b5a-c8c6-4692-9c95-53933a1f0c93 { "asset_name" : "云笙模型", "asset_description" : "华为云数字人员工", "asset_type" : "HUMAN_MODEL", "tags" : [ "数字人员工" ] }
  • 响应示例 状态码: 200 成功。 { "asset_id" : "93769b5a-c8c6-4692-9c95-53933a1f0c93", "asset_name" : "男教师", "asset_description" : "男教师模型", "create_time" : "2021-10-30T12:30:35Z", "asset_type" : "HUMAN_MODEL", "asset_state" : "ACTIVED", "files" : [ { "file_id" : "24bad716-87b1-45e5-8912-6102f7693265", "file_name" : "male001.bin", "file_md5" : "38b8c2c1093dd0fec383a9d9ac940515", "file_size" : 31032142, "file_type" : "bin", "asset_file_category" : "MAIN", "download_url" : "https://vr-dac-gamma.obs.cn-north-6.myhuaweicloud.com:443/05a8ae5925000fb72f83c0091083231a/ca40212e1cdb64ab5f74446bcddb8eb9/model/image/24bad716-87b1-45e5-8912-6102f7693265.bin?AccessKeyId=F8DE4LGO7EOYY0CM9ERJ&Expires=1657527524&Signature=BWgSQpc4lMFFrtj2ae67fw679%2Bc%3D" }, { "file_id" : "6dd0c018-7b8e-46aa-8a45-3075c161c500", "file_name" : "male001.png", "file_md5" : "38b8c2c1093dd0fec383a9d9ac940515", "file_size" : 110321, "file_type" : "png", "asset_file_category" : "COVER", "download_url" : "https://vr-dac-gamma.obs.cn-north-6.myhuaweicloud.com:443/05a8ae5925000fb72f83c0091083231a/ca40212e1cdb64ab5f74446bcddb8eb9/model/image/6dd0c018-7b8e-46aa-8a45-3075c161c500.png?AccessKeyId=F8DE4LGO7EOYY0CM9ERJ&Expires=1657527524&Signature=BWgSQpc4lMFFrtj2ae67fw679%2Bc%3D" } ] } 状态码: 400 { "error_code" : "MSS.00000003", "error_msg" : "Invalid Parameter" }
  • Python 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 # coding: utf-8 from huaweicloudsdkcore.auth.credentials import BasicCredentials from huaweicloudsdkmetastudio.v1.region.metastudio_region import MetaStudioRegion from huaweicloudsdkcore.exceptions import exceptions from huaweicloudsdkmetastudio.v1 import * if __name__ == "__main__": # The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security. # In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment ak = os.getenv("CLOUD_SDK_AK") sk = os.getenv("CLOUD_SDK_SK") credentials = BasicCredentials(ak, sk) \ client = MetaStudioClient.new_builder() \ .with_credentials(credentials) \ .with_region(MetaStudioRegion.value_of("cn-north-4")) \ .build() try: request = UpdateDigitalAssetRequest() listTagsbody = [ "数字人员工" ] request.body = UpdateDigitalAssetRequestBody( tags=listTagsbody, asset_type="HUMAN_MODEL", asset_description="华为云数字人员工", asset_name="云笙模型" ) response = client.update_digital_asset(request) print(response) except exceptions.ClientRequestException as e: print(e.status_code) print(e.request_id) print(e.error_code) print(e.error_msg)
  • Go 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 package main import ( "fmt" "github.com/huaweicloud/huaweicloud-sdk-go-v3/core/auth/basic" metastudio "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/metastudio/v1" "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/metastudio/v1/model" region "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/metastudio/v1/region" ) func main() { // The AK and SK used for authentication are hard-coded or stored in plaintext, which has great security risks. It is recommended that the AK and SK be stored in ciphertext in configuration files or environment variables and decrypted during use to ensure security. // In this example, AK and SK are stored in environment variables for authentication. Before running this example, set environment variables CLOUD_SDK_AK and CLOUD_SDK_SK in the local environment ak := os.Getenv("CLOUD_SDK_AK") sk := os.Getenv("CLOUD_SDK_SK") auth := basic.NewCredentialsBuilder(). WithAk(ak). WithSk(sk). Build() client := metastudio.NewMetaStudioClient( metastudio.MetaStudioClientBuilder(). WithRegion(region.ValueOf("cn-north-4")). WithCredential(auth). Build()) request := &model.UpdateDigitalAssetRequest{} var listTagsbody = []string{ "数字人员工", } assetTypeUpdateDigitalAssetRequestBody:= model.GetUpdateDigitalAssetRequestBodyAssetTypeEnum().HUMAN_MODEL assetDescriptionUpdateDigitalAssetRequestBody:= "华为云数字人员工" assetNameUpdateDigitalAssetRequestBody:= "云笙模型" request.Body = &model.UpdateDigitalAssetRequestBody{ Tags: &listTagsbody, AssetType: &assetTypeUpdateDigitalAssetRequestBody, AssetDescription: &assetDescriptionUpdateDigitalAssetRequestBody, AssetName: &assetNameUpdateDigitalAssetRequestBody, } response, err := client.UpdateDigitalAsset(request) if err == nil { fmt.Printf("%+v\n", response) } else { fmt.Println(err) } }