华为云用户手册

  • 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 # 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 = RestoreAssetRequest() response = client.restore_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 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.RestoreAssetRequest{} response, err := client.RestoreAsset(request) if err == nil { fmt.Printf("%+v\n", response) } else { fmt.Println(err) } }
  • 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 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.ShowSmartLiveRoomRequest{} response, err := client.ShowSmartLiveRoom(request) if err == nil { fmt.Printf("%+v\n", response) } else { fmt.Println(err) } }
  • Java 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 package com.huaweicloud.sdk.test; import com.huaweicloud.sdk.core.auth.ICredential; import com.huaweicloud.sdk.core.auth.BasicCredentials; import com.huaweicloud.sdk.core.exception.ConnectionException; import com.huaweicloud.sdk.core.exception.RequestTimeoutException; import com.huaweicloud.sdk.core.exception.ServiceResponseException; import com.huaweicloud.sdk.metastudio.v1.region.MetaStudioRegion; import com.huaweicloud.sdk.metastudio.v1.*; import com.huaweicloud.sdk.metastudio.v1.model.*; public class ShowSmartLiveRoomSolution { public static void main(String[] args) { // 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 String ak = System.getenv("CLOUD_SDK_AK"); String sk = System.getenv("CLOUD_SDK_SK"); ICredential auth = new BasicCredentials() .withAk(ak) .withSk(sk); MetaStudioClient client = MetaStudioClient.newBuilder() .withCredential(auth) .withRegion(MetaStudioRegion.valueOf("cn-north-4")) .build(); ShowSmartLiveRoomRequest request = new ShowSmartLiveRoomRequest(); try { ShowSmartLiveRoomResponse response = client.showSmartLiveRoom(request); System.out.println(response.toString()); } catch (ConnectionException e) { e.printStackTrace(); } catch (RequestTimeoutException e) { e.printStackTrace(); } catch (ServiceResponseException e) { e.printStackTrace(); System.out.println(e.getHttpStatusCode()); System.out.println(e.getRequestId()); System.out.println(e.getErrorCode()); System.out.println(e.getErrorMsg()); } } }
  • 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 # 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 = ShowSmartLiveRoomRequest() response = client.show_smart_live_room(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 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.CreateDigitalAssetRequest{} var listTagsbody = []string{ "数字人员工", } assetDescriptionCreateDigitalAssetRequestBody:= "华为云数字人员工" request.Body = &model.CreateDigitalAssetRequestBody{ Tags: &listTagsbody, AssetType: model.GetCreateDigitalAssetRequestBodyAssetTypeEnum().HUMAN_MODEL, AssetDescription: &assetDescriptionCreateDigitalAssetRequestBody, AssetName: "云笙模型", } response, err := client.CreateDigitalAsset(request) if err == nil { fmt.Printf("%+v\n", response) } else { fmt.Println(err) } }
  • 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 = CreateDigitalAssetRequest() listTagsbody = [ "数字人员工" ] request.body = CreateDigitalAssetRequestBody( tags=listTagsbody, asset_type="HUMAN_MODEL", asset_description="华为云数字人员工", asset_name="云笙模型" ) response = client.create_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)
  • Java 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 48 49 50 51 52 53 package com.huaweicloud.sdk.test; import com.huaweicloud.sdk.core.auth.ICredential; import com.huaweicloud.sdk.core.auth.BasicCredentials; import com.huaweicloud.sdk.core.exception.ConnectionException; import com.huaweicloud.sdk.core.exception.RequestTimeoutException; import com.huaweicloud.sdk.core.exception.ServiceResponseException; import com.huaweicloud.sdk.metastudio.v1.region.MetaStudioRegion; import com.huaweicloud.sdk.metastudio.v1.*; import com.huaweicloud.sdk.metastudio.v1.model.*; public class CreateFileSolution { public static void main(String[] args) { // 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 String ak = System.getenv("CLOUD_SDK_AK"); String sk = System.getenv("CLOUD_SDK_SK"); ICredential auth = new BasicCredentials() .withAk(ak) .withSk(sk); MetaStudioClient client = MetaStudioClient.newBuilder() .withCredential(auth) .withRegion(MetaStudioRegion.valueOf("cn-north-4")) .build(); CreateFileRequest request = new CreateFileRequest(); FilesCreateReq body = new FilesCreateReq(); body.withAssetFileCategory("MAIN"); body.withAssetId("8cb2f48a2cb006154794741933421100"); body.withFileType("png"); body.withFileSize(1048576L); body.withFileMd5("n58IG6hfM7vqI4K0vnWpog=="); body.withFileName("1.png"); request.withBody(body); try { CreateFileResponse response = client.createFile(request); System.out.println(response.toString()); } catch (ConnectionException e) { e.printStackTrace(); } catch (RequestTimeoutException e) { e.printStackTrace(); } catch (ServiceResponseException e) { e.printStackTrace(); System.out.println(e.getHttpStatusCode()); System.out.println(e.getRequestId()); System.out.println(e.getErrorCode()); System.out.println(e.getErrorMsg()); } } }
  • 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 # 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 = CreateFileRequest() request.body = FilesCreateReq( asset_file_category="MAIN", asset_id="8cb2f48a2cb006154794741933421100", file_type="png", file_size=1048576, file_md5="n58IG6hfM7vqI4K0vnWpog==", file_name="1.png" ) response = client.create_file(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 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.CreateFileRequest{} request.Body = &model.FilesCreateReq{ AssetFileCategory: "MAIN", AssetId: "8cb2f48a2cb006154794741933421100", FileType: "png", FileSize: int64(1048576), FileMd5: "n58IG6hfM7vqI4K0vnWpog==", FileName: "1.png", } response, err := client.CreateFile(request) if err == nil { fmt.Printf("%+v\n", response) } else { fmt.Println(err) } }
  • 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 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.DeleteDigitalHumanBusinessCardRequest{} response, err := client.DeleteDigitalHumanBusinessCard(request) if err == nil { fmt.Printf("%+v\n", response) } else { fmt.Println(err) } }
  • 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 # 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 = DeleteDigitalHumanBusinessCardRequest() response = client.delete_digital_human_business_card(request) print(response) except exceptions.ClientRequestException as e: print(e.status_code) print(e.request_id) print(e.error_code) print(e.error_msg)
  • Java 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 package com.huaweicloud.sdk.test; import com.huaweicloud.sdk.core.auth.ICredential; import com.huaweicloud.sdk.core.auth.BasicCredentials; import com.huaweicloud.sdk.core.exception.ConnectionException; import com.huaweicloud.sdk.core.exception.RequestTimeoutException; import com.huaweicloud.sdk.core.exception.ServiceResponseException; import com.huaweicloud.sdk.metastudio.v1.region.MetaStudioRegion; import com.huaweicloud.sdk.metastudio.v1.*; import com.huaweicloud.sdk.metastudio.v1.model.*; public class DeleteDigitalHumanBusinessCardSolution { public static void main(String[] args) { // 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 String ak = System.getenv("CLOUD_SDK_AK"); String sk = System.getenv("CLOUD_SDK_SK"); ICredential auth = new BasicCredentials() .withAk(ak) .withSk(sk); MetaStudioClient client = MetaStudioClient.newBuilder() .withCredential(auth) .withRegion(MetaStudioRegion.valueOf("cn-north-4")) .build(); DeleteDigitalHumanBusinessCardRequest request = new DeleteDigitalHumanBusinessCardRequest(); try { DeleteDigitalHumanBusinessCardResponse response = client.deleteDigitalHumanBusinessCard(request); System.out.println(response.toString()); } catch (ConnectionException e) { e.printStackTrace(); } catch (RequestTimeoutException e) { e.printStackTrace(); } catch (ServiceResponseException e) { e.printStackTrace(); System.out.println(e.getHttpStatusCode()); System.out.println(e.getRequestId()); System.out.println(e.getErrorCode()); System.out.println(e.getErrorMsg()); } } }
  • 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 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.ShowSmartLiveRequest{} response, err := client.ShowSmartLive(request) if err == nil { fmt.Printf("%+v\n", response) } else { fmt.Println(err) } }
  • 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 # 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 = ShowSmartLiveRequest() response = client.show_smart_live(request) print(response) except exceptions.ClientRequestException as e: print(e.status_code) print(e.request_id) print(e.error_code) print(e.error_msg)
  • 错误码 当您调用API时,如果遇到“APIGW”开头的错误码,请参见API网关错误码进行处理。 更多服务错误码请参见API错误中心。 状态码 错误码 错误信息 描述 处理措施 400 MSS.00000002 Invalid body 请求Body无效 请填写正确的请求Body 400 MSS.00000003 Invalid parameter 请求参数无效 请填写正确的请求参数 400 MSS.00010003 SR.api not found SR服务未找到相应的API 请检查请求URL是否正确 400 MSS.00010004 SR.method not allowed 请求方法错误 请检查请求方法是否正确 400 MSS.00010008 Invalid token in the header. 请求头中的Token无效 请检查Token或鉴权信息是否正确 400 MSS.00010009 urlTenantId is not equal tokenTenantId Token中的租户ID非法 请检查Token是否正确 400 MSS.10000002 Request JSON exception 请求Body应该是Json类型 请确认请求头中的content-type是否正确 400 MSS.10000003 Parameter validation abnormal 请求参数检查错误 请检查请求参数是否正确 400 MSS.10001001 Asset not found 资产ID在资产库中未找到 请检查资产ID是否正确 400 MSS.10001002 Illegal URL parameter, please check 请求URL中的参数错误 请检查URL中的请求参数是否正确 400 MSS.10001003 The file type are empty, please check 文件类型为空 请检查文件类型参数填写是否正确 400 MSS.10001004 The file not found 文件未找到 请检查文件ID是否正确 400 MSS.10001005 Asset name already exists 资产名称已存在 请更换其他资产名称 400 MSS.10001006 Asset create job failed 资产创建作业失败 请检查请求参数是否正确,或者重试 400 MSS.10001007 Asset file too large, please do not exceed 5242880 bytes 资产文件太大,请不要超过5242880字节 请确认文件大小是否下于5242880 字节 400 MSS.10001008 Asset main file already exists 资产主文件已经存在 请确认请求参数是否正确 400 MSS.10001009 Asset cover file already exists 资产封面文件已存在 请确认请求参数是否正确 400 MSS.10001010 Asset state unavailable 资产状态未知 请确认请求参数是否正确 400 MSS.10001011 Asset main file not found 找不到资产主文件 请确认请求参数是否正确 400 MSS.10001012 Asset file already exists 资产文件已存在 请确认请求参数是否正确 400 MSS.10001013 Asset state invalid change 资产状态非法 请确认设置的资产状态是否合法 400 MSS.10001014 Asset state error update 资产状态刷新失败 请确认请求参数是否正确 400 MSS.10001015 Asset name do not support special characters 资产名中含有特殊字符 请检查资产名称字符是否正确 400 MSS.10001016 File not found in OBS 文件不存在 请确认请求参数是否正确 400 MSS.10010002 The request parameter is abnormal. Please check 请求参数异常,请检查 请确认请求参数是否正确 400 MSS.10010003 URL is empty, please check URL为空,请检查 请确认请求参数是否正确 400 MSS.10010004 Illegal URL parameter, please check URL参数非法,请检查 请确认请求参数是否正确 400 MSS.10010005 File transfer exception 文件传输出现异常 请重新上传文件 400 MSS.10011001 No asset information has been transferred, please check 没传入资产信息,请检查 请确认请求参数是否正确 400 MSS.10011002 The asset information obtained from DAC service is empty, please check 从DAC服务获取的资产信息为空,请检查 请确认请求参数是否正确 400 MSS.10011003 The asset type enumeration was passed in incorrectly. Please check 资产类型枚举传入有误,请检查 请检查资产类型取值是否正确 400 MSS.10011004 Timeout or task does not exist 超时或任务不存在 请检查任务ID是否正确 400 MSS.20010001 name include invalid symbol 名称包含特殊字符/去除名称中的特殊字符 请确认请求参数是否正确 400 MSS.20010003 no match template 没有匹配的模板/检查枚举是否正确 请建模模板ID是否正确 400 MSS.20010005 script name duplicate 剧本名称重复/请勿使用重复剧本名称 请更换其他的剧本名称 400 MSS.20010006 Text review failed 文本审核失败 请确认是否包含敏感词汇 400 MSS.20010007 text include sensitive word 包含敏感词汇/删除讲解词中的敏感词汇 请确认是否包含敏感词汇 400 MSS.20010008 asset name duplicate 资产名重复/请勿使用重复资产名称 请更换资产名称 400 MSS.20010009 animation task not exist 动画任务不存在 请确认请求参数是否正确 400 MSS.20010010 Asset query failed 资产查询失败 请确认请求参数是否正确 400 MSS.20010011 exceed waiting task upper limit 超过视频制作任务,等待数上限/请过会再创建视频任务 请稍后再尝试 400 MSS.20010012 scene and material do not match 场景不支持演示素材 请检查场景标签 400 MSS.20010013 models and animation do not match 角色模型和动作不匹配 请检查角色模型和动作style_id 是否相同 400 MSS.20010014 material is not exist 演示素材不存在,演示素材已被彻底删除 请确认请求参数是否正确 400 MSS.20010015 xml parse fail xml解析失败,文本中包含未封闭xml标签 请检查xml封闭标签是否存在 400 MSS.20010016 asset contains multiple engines 剧本中资产包含多个渲染引擎 检查资产引擎属性保证一个剧本下统一引擎资产 400 MSS.20010017 the script name contains sensitive characters 剧本名称、视频任务名称包含敏感词汇 请检查名称是否包含敏感信息 400 MSS.20010018 query digital human error 查询dhms 失败 查询dhms 失败 400 MSS.20030001 Some request parameter is illegal in some part of the program. 请求参数不符合规范,检查请求参数 请确认请求参数是否正确 400 MSS.20030003 Exceed maximal concurrency. 超过最大并发数 请稍后重试 400 MSS.20030004 Picture size is larger than 6MB. 照片大小超过6M 照片过大,更换成小一点的照片 400 MSS.20030005 Picture format is not supported. 照片格式不正确 请使用jpg/jpeg/png格式的照片 400 MSS.20030006 Old job found in RDS is still under processing / waiting. 相同model_asset_id查询到的旧任务在处理,请等待 相同model_asset_id查询到的旧任务在处理,请等待 400 MSS.20030008 C++ model returns non-zero. C++算法返回非0(程序没崩) 请更换照片后再尝试 400 MSS.20030009 File process error.(Fail to obtain MD5 of bin file or MD5 length is not 24.) MD5获取失败(文件异常) 请确认文件上传是否正常 400 MSS.20030010 Fail to show asset. 查询资产失败 请确认资产ID是否正确 400 MSS.20030011 Fail to delete main file. 删除资产库文件失败 请确认资产下文件是否存在 400 MSS.20030012 Fail to create main file. 创建资产库文件失败 请确认请求参数是否正确 400 MSS.20030013 Fail to upload file. 上传文件失败 请确认文件是否正确,或者上传URL是否正确 400 MSS.20030014 Fail to confirm upload file. 确认上传文件失败 请确认文件上传是否已完成 400 MSS.20030015 Fail to update digital asset. 更新资产失败 请确认资产ID是否正确,或者请求参数是否正确 400 MSS.20030016 Fail to create snapshot job to RenderWorker (UE) 创建拍照任务失败 请确认请求参数是否正确 400 MSS.20030017 Fail to show model snapshot job. 查询拍照任务失败 请确认请求参数是否正确 400 MSS.20030018 Fail to check images through content manager api 内容审核api调用失败 请确认请求参数是否正确 400 MSS.20030019 Picture upload contains some illegal information. 照片含有非法信息,换张照片试一下 请更换照片 400 MSS.20030020 Fail to get token (X-Auth-Token). 查询子账号token失败 请检查X-Auth-Token头是否正确 400 MSS.20030021 Digital asset name repeated! Please enter a different name! 创建资产名字重复 请确认请求参数是否正确 400 MSS.20030023 Fail to create other (json) file 创建ids.json失败 请确认请求参数是否正确 400 MSS.20050001 GET_MODEL_CFG_FROM_OBS_FAILED 从OBS获取模型数据失败 请确认请求参数是否正确 400 MSS.20050005 GET_ASSET_INFO_FAILED_ASSETID_OR_PROJECTID_INVALID 获取资产信息失败, 资产ID或项目ID无效 请确认请求参数是否正确 400 MSS.20050006 GET_MODEL_INFO_FAILED 获取模型信息失败 请确认请求参数是否正确 400 MSS.20050007 UNZIP_MODEL_CFG_FAILED 解压缩模型数据失败 确认资产库里的音色资产压缩包是否正常 400 MSS.20050008 GET_MODEL_FAILED_SIZE_EXCEED_MAX_VALUE 获取模型数据失败,大小超过最大值 请确认请求参数是否正确 400 MSS.20050009 GET_DAC_URL_FAILED 获取DAC URL失败 确认是否正确配置DAC URL 400 MSS.20050010 TEXT_LANGUAGE_FORMAT_INVALID 文本语言格式非法(使用英文模型时输入的Text中包含中文字符) 请检查输入的Text中是否包含中文字符 400 MSS.20050011 COMMON_MODEL_NOT_EXIST 确认产品包里是否包含该通用音色模型 确认产品包里是否包含该通用音色模型 400 MSS.20060001 parameter is invalid 参数异常 请确认请求参数是否正确 400 MSS.20080003 Tenant ID cannot be empty 租户id不能为空 请确认请求参数是否正确 400 MSS.20080005 Failed to call DAC to get asset information 调用DAC获取资产信息失败 请检查资产ID是否正确 400 MSS.20080006 Illegal request parameters 请求参数不合法 请确认请求参数是否正确 400 MSS.20080007 Style does not exist 风格查询不存在 请检查风格ID是否正确 400 MSS.20080008 Style name already exists 风格名称已存在 请更换其他风格名称 400 MSS.20080009 Illegal asset id 资产id不合法 请确认请求参数是否正确 400 MSS.20080010 Invalid Asset ID 无效的资产ID 请检查资产ID是否正确 400 MSS.30000001 parameter is invalid 参数异常 请确认请求参数是否正确 400 MSS.30000005 no match template 没有匹配模板 请填写正确的模板ID 400 MSS.30000006 timeout,no engine service to process task 任务超时 任务超时,请重试 401 MSS.00010001 SR.unauthorized 未鉴权 请填写正确的鉴权信息 401 MSS.00010007 Your account is not allowed to access the service, because it is frozen, deleted, or has insufficient balance. 帐号已冻结 请更换其他帐号尝试 401 MSS.10000005 Token authentication failed 鉴权失败 请填写正确的鉴权信息 500 MSS.00000004 Internal Error 服务器内部错误 请联系华为支撑人员 500 MSS.00010002 SR.no available instance 无可用服务实例 请联系华为支撑人员 500 MSS.00010005 SR.service unavailable 服务未找到 请联系华为支撑人员 500 MSS.00010006 SR.internal server error 服务器内部错误 请联系华为支撑人员 500 MSS.10000001 System problem, please contact Huawei engineers 系统错误 请联系华为支撑人员 500 MSS.10000004 Public communication error 内部通讯错误 请联系华为支撑人员 500 MSS.10000101 IAM service processing error IAM服务访问错误 请联系华为支撑人员 500 MSS.10000102 OBS service processing error OBS访问错误 请联系华为支撑人员 500 MSS.10010001 System problem 系统问题 请联系华为支撑人员 500 MSS.10010006 OBS service processing exception OBS服务处理异常 请联系华为工程师 500 MSS.20030002 Server internal error. 服务器内部错误 服务内部异常,联系华为云支撑人员 500 MSS.20030007 Start C++ model exception 调用C++算法库excpetion(可能程序崩了) 服务器内部除外,请联系华为支撑人员 500 MSS.20030022 Running out of time. 任务超时 请联系华为支撑人员 500 MSS.20050002 CREATE_TTS_RAW_FAILED 创建TTS原生语音数据流失败 请联系华为支撑人员 500 MSS.20050003 NETWORK_ACCESS_FAILED 内部网络错误 请联系华为支撑人员 500 MSS.20050004 GET_ASSET_INFO_FAILED 获取资产信息失败 请联系华为支撑人员 500 MSS.20060002 server internal error 服务内部异常 请联系华为支撑人员 500 MSS.20060003 stream broken RTSA/RTC断流超过1分钟 请联系华为支撑人员 500 MSS.30000002 server internal error 服务内部异常 请联系华为支撑人员 500 MSS.30000003 database mongo unavailable mongodb异常 请联系华为支撑人员 500 MSS.30000004 database redis unavailable redis异常 请联系华为支撑人员 父主题: 附录
  • 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 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.StopVideoMotionCaptureJobRequest{} response, err := client.StopVideoMotionCaptureJob(request) if err == nil { fmt.Printf("%+v\n", response) } else { fmt.Println(err) } }
  • 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 # 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 = StopVideoMotionCaptureJobRequest() response = client.stop_video_motion_capture_job(request) print(response) except exceptions.ClientRequestException as e: print(e.status_code) print(e.request_id) print(e.error_code) print(e.error_msg)
  • Java 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 package com.huaweicloud.sdk.test; import com.huaweicloud.sdk.core.auth.ICredential; import com.huaweicloud.sdk.core.auth.BasicCredentials; import com.huaweicloud.sdk.core.exception.ConnectionException; import com.huaweicloud.sdk.core.exception.RequestTimeoutException; import com.huaweicloud.sdk.core.exception.ServiceResponseException; import com.huaweicloud.sdk.metastudio.v1.region.MetaStudioRegion; import com.huaweicloud.sdk.metastudio.v1.*; import com.huaweicloud.sdk.metastudio.v1.model.*; public class StopVideoMotionCaptureJobSolution { public static void main(String[] args) { // 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 String ak = System.getenv("CLOUD_SDK_AK"); String sk = System.getenv("CLOUD_SDK_SK"); ICredential auth = new BasicCredentials() .withAk(ak) .withSk(sk); MetaStudioClient client = MetaStudioClient.newBuilder() .withCredential(auth) .withRegion(MetaStudioRegion.valueOf("cn-north-4")) .build(); StopVideoMotionCaptureJobRequest request = new StopVideoMotionCaptureJobRequest(); try { StopVideoMotionCaptureJobResponse response = client.stopVideoMotionCaptureJob(request); System.out.println(response.toString()); } catch (ConnectionException e) { e.printStackTrace(); } catch (RequestTimeoutException e) { e.printStackTrace(); } catch (ServiceResponseException e) { e.printStackTrace(); System.out.println(e.getHttpStatusCode()); System.out.println(e.getRequestId()); System.out.println(e.getErrorCode()); System.out.println(e.getErrorMsg()); } } }
  • 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 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 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.CreatePhotoDigitalHumanVideoRequest{} outputAssetConfigbody := &model.OutputAssetConfig{ AssetName: "云玲自我介绍", } textConfigShootScript := &model.TextConfig{ Text: "大家好,我是云玲。", } shootScriptShootScripts := &model.ShootScript{ TextConfig: textConfigShootScript, } sequenceNoShootScripts:= int32(0) var listShootScriptsbody = []model.ShootScriptItem{ { SequenceNo: &sequenceNoShootScripts, ShootScript: shootScriptShootScripts, }, } videoConfigbody := &model.PhotoVideoConfig{ Codec: model.GetPhotoVideoConfigCodecEnum().H264, } speedVoiceConfig:= int32(100) pitchVoiceConfig:= int32(100) volumeVoiceConfig:= int32(140) voiceConfigbody := &model.VoiceConfig{ VoiceAssetId: "394f3a27cd0b3d6164ca75c3db1edf6c", Speed: &speedVoiceConfig, Pitch: &pitchVoiceConfig, Volume: &volumeVoiceConfig, } request.Body = &model.CreatePhotoDigitalHumanVideoReq{ OutputAssetConfig: outputAssetConfigbody, ShootScripts: listShootScriptsbody, VideoConfig: videoConfigbody, VoiceConfig: voiceConfigbody, } response, err := client.CreatePhotoDigitalHumanVideo(request) if err == nil { fmt.Printf("%+v\n", response) } else { fmt.Println(err) } }
  • 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 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 # 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 = CreatePhotoDigitalHumanVideoRequest() outputAssetConfigbody = OutputAssetConfig( asset_name="云玲自我介绍" ) textConfigShootScript = TextConfig( text="大家好,我是云玲。" ) shootScriptShootScripts = ShootScript( text_config=textConfigShootScript ) listShootScriptsbody = [ ShootScriptItem( sequence_no=0, shoot_script=shootScriptShootScripts ) ] videoConfigbody = PhotoVideoConfig( codec="H264" ) voiceConfigbody = VoiceConfig( voice_asset_id="394f3a27cd0b3d6164ca75c3db1edf6c", speed=100, pitch=100, volume=140 ) request.body = CreatePhotoDigitalHumanVideoReq( output_asset_config=outputAssetConfigbody, shoot_scripts=listShootScriptsbody, video_config=videoConfigbody, voice_config=voiceConfigbody ) response = client.create_photo_digital_human_video(request) print(response) except exceptions.ClientRequestException as e: print(e.status_code) print(e.request_id) print(e.error_code) print(e.error_msg)
  • Java 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 package com.huaweicloud.sdk.test; import com.huaweicloud.sdk.core.auth.ICredential; import com.huaweicloud.sdk.core.auth.BasicCredentials; import com.huaweicloud.sdk.core.exception.ConnectionException; import com.huaweicloud.sdk.core.exception.RequestTimeoutException; import com.huaweicloud.sdk.core.exception.ServiceResponseException; import com.huaweicloud.sdk.metastudio.v1.region.MetaStudioRegion; import com.huaweicloud.sdk.metastudio.v1.*; import com.huaweicloud.sdk.metastudio.v1.model.*; public class DeleteSmartLiveRoomSolution { public static void main(String[] args) { // 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 String ak = System.getenv("CLOUD_SDK_AK"); String sk = System.getenv("CLOUD_SDK_SK"); ICredential auth = new BasicCredentials() .withAk(ak) .withSk(sk); MetaStudioClient client = MetaStudioClient.newBuilder() .withCredential(auth) .withRegion(MetaStudioRegion.valueOf("cn-north-4")) .build(); DeleteSmartLiveRoomRequest request = new DeleteSmartLiveRoomRequest(); try { DeleteSmartLiveRoomResponse response = client.deleteSmartLiveRoom(request); System.out.println(response.toString()); } catch (ConnectionException e) { e.printStackTrace(); } catch (RequestTimeoutException e) { e.printStackTrace(); } catch (ServiceResponseException e) { e.printStackTrace(); System.out.println(e.getHttpStatusCode()); System.out.println(e.getRequestId()); System.out.println(e.getErrorCode()); System.out.println(e.getErrorMsg()); } } }
  • 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 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.DeleteSmartLiveRoomRequest{} response, err := client.DeleteSmartLiveRoom(request) if err == nil { fmt.Printf("%+v\n", response) } else { fmt.Println(err) } }
  • 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 # 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 = DeleteSmartLiveRoomRequest() response = client.delete_smart_live_room(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 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.ExecuteSmartLiveCommandRequest{} var paramsControlSmartLiveReq interface{} = "{\"text_config\":{\"text\":\"看到评论区有观众问问题,我来响应下。\"}}" request.Body = &model.ControlSmartLiveReq{ Params: ¶msControlSmartLiveReq, Command: model.GetControlSmartLiveReqCommandEnum().INSERT_PLAY_SCRIPT, } response, err := client.ExecuteSmartLiveCommand(request) if err == nil { fmt.Printf("%+v\n", response) } else { fmt.Println(err) } }
  • Java 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 48 49 package com.huaweicloud.sdk.test; import com.huaweicloud.sdk.core.auth.ICredential; import com.huaweicloud.sdk.core.auth.BasicCredentials; import com.huaweicloud.sdk.core.exception.ConnectionException; import com.huaweicloud.sdk.core.exception.RequestTimeoutException; import com.huaweicloud.sdk.core.exception.ServiceResponseException; import com.huaweicloud.sdk.metastudio.v1.region.MetaStudioRegion; import com.huaweicloud.sdk.metastudio.v1.*; import com.huaweicloud.sdk.metastudio.v1.model.*; public class ExecuteSmartLiveCommandSolution { public static void main(String[] args) { // 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 String ak = System.getenv("CLOUD_SDK_AK"); String sk = System.getenv("CLOUD_SDK_SK"); ICredential auth = new BasicCredentials() .withAk(ak) .withSk(sk); MetaStudioClient client = MetaStudioClient.newBuilder() .withCredential(auth) .withRegion(MetaStudioRegion.valueOf("cn-north-4")) .build(); ExecuteSmartLiveCommandRequest request = new ExecuteSmartLiveCommandRequest(); ControlSmartLiveReq body = new ControlSmartLiveReq(); body.withParams("{\"text_config\":{\"text\":\"看到评论区有观众问问题,我来响应下。\"}}"); body.withCommand(ControlSmartLiveReq.CommandEnum.fromValue("INSERT_PLAY_SCRIPT")); request.withBody(body); try { ExecuteSmartLiveCommandResponse response = client.executeSmartLiveCommand(request); System.out.println(response.toString()); } catch (ConnectionException e) { e.printStackTrace(); } catch (RequestTimeoutException e) { e.printStackTrace(); } catch (ServiceResponseException e) { e.printStackTrace(); System.out.println(e.getHttpStatusCode()); System.out.println(e.getRequestId()); System.out.println(e.getErrorCode()); System.out.println(e.getErrorMsg()); } } }
  • 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 # 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 = ExecuteSmartLiveCommandRequest() request.body = ControlSmartLiveReq( params="{\"text_config\":{\"text\":\"看到评论区有观众问问题,我来响应下。\"}}", command="INSERT_PLAY_SCRIPT" ) response = client.execute_smart_live_command(request) print(response) except exceptions.ClientRequestException as e: print(e.status_code) print(e.request_id) print(e.error_code) print(e.error_msg)
  • Java 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 package com.huaweicloud.sdk.test; import com.huaweicloud.sdk.core.auth.ICredential; import com.huaweicloud.sdk.core.auth.BasicCredentials; import com.huaweicloud.sdk.core.exception.ConnectionException; import com.huaweicloud.sdk.core.exception.RequestTimeoutException; import com.huaweicloud.sdk.core.exception.ServiceResponseException; import com.huaweicloud.sdk.metastudio.v1.region.MetaStudioRegion; import com.huaweicloud.sdk.metastudio.v1.*; import com.huaweicloud.sdk.metastudio.v1.model.*; public class ShowDigitalHumanBusinessCardSolution { public static void main(String[] args) { // 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 String ak = System.getenv("CLOUD_SDK_AK"); String sk = System.getenv("CLOUD_SDK_SK"); ICredential auth = new BasicCredentials() .withAk(ak) .withSk(sk); MetaStudioClient client = MetaStudioClient.newBuilder() .withCredential(auth) .withRegion(MetaStudioRegion.valueOf("cn-north-4")) .build(); ShowDigitalHumanBusinessCardRequest request = new ShowDigitalHumanBusinessCardRequest(); try { ShowDigitalHumanBusinessCardResponse response = client.showDigitalHumanBusinessCard(request); System.out.println(response.toString()); } catch (ConnectionException e) { e.printStackTrace(); } catch (RequestTimeoutException e) { e.printStackTrace(); } catch (ServiceResponseException e) { e.printStackTrace(); System.out.println(e.getHttpStatusCode()); System.out.println(e.getRequestId()); System.out.println(e.getErrorCode()); System.out.println(e.getErrorMsg()); } } }
  • 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 # 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 = ShowDigitalHumanBusinessCardRequest() response = client.show_digital_human_business_card(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 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.ShowDigitalHumanBusinessCardRequest{} response, err := client.ShowDigitalHumanBusinessCard(request) if err == nil { fmt.Printf("%+v\n", response) } else { fmt.Println(err) } }
共100000条