Help Center/ CodeArts Req/ API Reference/ API/ IPD Configuration Management/ Obtaining the Model Tree Configuration
Updated on 2026-10-13 GMT+08:00

Obtaining the Model Tree Configuration

Function

This API is used to obtain the model tree configuration.

Calling Method

For details, see Calling APIs.

Authorization Information

Each account root user has all the permissions required to call all APIs, but IAM users must be assigned the following required identity policy-based permissions. For details about the required permissions, see Permissions Policies and Supported Actions.

Action

Access Level

Resource Type (*: required)

Condition Key

Alias

Dependencies

codeartsreq:configuration:get

Read

-

  • codeartsreq:Model

  • codeartsreq:ProjectId

-

-

URI

GET /v1/ipdprojectservice/projects/{project_id}/model-config

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Definition

32-character ID of a project, which must be unique. Obtain the value by calling the API for querying the IPD project list. The value of id in the response message body is the project ID.

Constraints

N/A

Range

A string of 32 characters consisting of letters and digits.

Default Value

N/A

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

Definition

User token. Obtain a token by calling the IAM API for obtaining a user token. The value of X-Subject-Token in the response header is the user token.

Constraints

N/A

Range

10 to 32,768 characters

Default Value

N/A

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

status

String

Definition

Response status.

Range

N/A

result

ModelConfigDTO object

Definition

Response status.

Range

N/A

message

String

Definition

Response message.

Range

N/A

Table 4 ModelConfigDTO

Parameter

Type

Description

categories

Array of BaseCategory objects

Definition

Work item property.

Range

N/A

category_layer_config

Array of CategoryLayerDTO objects

Definition

Work item hierarchy.

Range

N/A

feature_page_link_template

String

Definition

Template for the link to the work item function page.

Range

N/A

Table 5 BaseCategory

Parameter

Type

Description

tenant_id

String

Definition

Tenant ID.

Range

N/A

modified_by

String

Definition

Modifier.

Range

N/A

modified_date

Long

Definition

Modification time.

Range

N/A

created_by

String

Definition

Creator.

Range

N/A

created_date

String

Definition

Creation time.

Range

N/A

code

String

Definition

Object type code.

Range

N/A

classification_id

Long

Definition

Type classification ID.

Range

N/A

prefix

String

Definition

Number prefix.

Range

N/A

domain_id

Long

Definition

Unique ID of a project space under a tenant.

Range

N/A

icon

String

Definition

Icon.

Range

N/A

color

String

Definition

Color.

Range

N/A

description

String

Definition

Description.

Range

N/A

definition_type

String

Definition

Definition type.

Range

  • 1 to 3: system level

  • 4: tenant level

type_id

Long

Definition

Type ID.

Range

N/A

Table 6 CategoryLayerDTO

Parameter

Type

Description

category

BaseCategory object

Definition

Information about the object type.

Range

N/A

link_parent_field

String

Definition

Parent class field.

Range

N/A

code

String

Definition

Layer object type code.

Range

N/A

category_code

String

Definition

Object type code.

Range

N/A

category_id

Long

Definition

Object type ID.

Range

N/A

layer_type

String

Definition

Layer type.

Range

N/A

parent_id

Long

Definition

Parent ID.

Range

N/A

root_id

Long

Definition

Root work item ID.

Range

N/A

position_x

Integer

Definition

X-axis coordinate of the canvas.

Range

N/A

position_y

Integer

Definition

Y-axis coordinate of the canvas.

Range

N/A

Status code: 400

Table 7 Response body parameters

Parameter

Type

Description

error_code

String

Definition

Error code.

Range

N/A

error_msg

String

Definition

Error description, which is a supplement to error_code.

Range

N/A

Example Requests

Assume that the project ID is 26f251d688044d6ca53f7b1b8829d168. Query the model tree configuration of the project.

GET https://{endpoint}/v1/ipdprojectservice/projects/26f251d688044d6ca53f7b1b8829d168/model-config

Example Responses

Status code: 200

{
  "status" : "success",
  "result" : {
    "categories" : [ {
      "id" : "1188444320469135361",
      "region" : "xx-xx-xx",
      "enabled" : 1,
      "tenant_id" : "4e919d73499648e3b0292cd3cbef806a",
      "modified_by" : "a360371833bf4c558f796fd707b44daf",
      "modified_date" : "1766559565636",
      "created_by" : "a360371833bf4c558f796fd707b44daf",
      "created_date" : "1761276806227",
      "code" : "c7380365137905545216",
      "prefix" : "ZR",
      "domain_id" : "-1",
      "icon" : "ZR",
      "color" : "#86CAFF",
      "description" : "1",
      "display_name" : "ZR",
      "definition_type" : 4,
      "type_id" : "10026"
    }, {
      "id" : "1188444430468952065",
      "region" : "xx-xx-xx",
      "enabled" : 1,
      "tenant_id" : "4e919d73499648e3b0292cd3cbef806a",
      "modified_by" : "a360371833bf4c558f796fd707b44daf",
      "modified_date" : "1761276832453",
      "created_by" : "a360371833bf4c558f796fd707b44daf",
      "created_date" : "1761276832453",
      "code" : "c7380365247985053696",
      "prefix" : "CCR",
      "domain_id" : "-1",
      "icon" : "CCR",
      "color" : "#6DDEBB",
      "description" : "",
      "display_name" : "CCR",
      "definition_type" : 4,
      "type_id" : "10026"
    }, {
      "id" : "1188444469958324225",
      "region" : "xx-xx-xx",
      "enabled" : 1,
      "tenant_id" : "4e919d73499648e3b0292cd3cbef806a",
      "modified_by" : "a360371833bf4c558f796fd707b44daf",
      "modified_date" : "1761276841868",
      "created_by" : "a360371833bf4c558f796fd707b44daf",
      "created_date" : "1761276841868",
      "code" : "c7380365287323430912",
      "prefix" : "VVR",
      "domain_id" : "-1",
      "icon" : "VVR",
      "color" : "#A6DD82",
      "description" : "",
      "display_name" : "VVR",
      "definition_type" : 4,
      "type_id" : "10026"
    }, {
      "id" : "1192859851372670977",
      "region" : "xx-xx-xx",
      "enabled" : 1,
      "tenant_id" : "4e919d73499648e3b0292cd3cbef806a",
      "modified_by" : "a360371833bf4c558f796fd707b44daf",
      "modified_date" : "1762329550831",
      "created_by" : "a360371833bf4c558f796fd707b44daf",
      "created_date" : "1762329550831",
      "code" : "c7384780668794400768",
      "prefix" : "QY",
      "domain_id" : "-1",
      "icon" : "QY",
      "color" : "#86CAFF",
      "description" : "",
      "display_name" : "QY",
      "definition_type" : 4,
      "type_id" : "10026"
    }, {
      "id" : "1192859886432858112",
      "region" : "xx-xx-xx",
      "enabled" : 1,
      "tenant_id" : "4e919d73499648e3b0292cd3cbef806a",
      "modified_by" : "a360371833bf4c558f796fd707b44daf",
      "modified_date" : "1762329559190",
      "created_by" : "a360371833bf4c558f796fd707b44daf",
      "created_date" : "1762329559190",
      "code" : "c7384780703795867648",
      "prefix" : "WY",
      "domain_id" : "-1",
      "icon" : "WY",
      "color" : "#6DDEBB",
      "description" : "",
      "display_name" : "WY",
      "definition_type" : 4,
      "type_id" : "10026"
    }, {
      "id" : "1192859911804203008",
      "region" : "xx-xx-xx",
      "enabled" : 1,
      "tenant_id" : "4e919d73499648e3b0292cd3cbef806a",
      "modified_by" : "a360371833bf4c558f796fd707b44daf",
      "modified_date" : "1762329565239",
      "created_by" : "a360371833bf4c558f796fd707b44daf",
      "created_date" : "1762329565239",
      "code" : "c7384780729121075200",
      "prefix" : "EY",
      "domain_id" : "-1",
      "icon" : "EY",
      "color" : "#A6DD82",
      "description" : "",
      "display_name" : "EY",
      "definition_type" : 4,
      "type_id" : "10026"
    }, {
      "id" : "1192859944242950144",
      "region" : "xx-xx-xx",
      "enabled" : 1,
      "tenant_id" : "4e919d73499648e3b0292cd3cbef806a",
      "modified_by" : "a360371833bf4c558f796fd707b44daf",
      "modified_date" : "1762329572973",
      "created_by" : "a360371833bf4c558f796fd707b44daf",
      "created_date" : "1762329572973",
      "code" : "c7384780761601765376",
      "prefix" : "RY",
      "domain_id" : "-1",
      "icon" : "RY",
      "color" : "#FAC20A",
      "description" : "",
      "display_name" : "RY",
      "definition_type" : 4,
      "type_id" : "10026"
    }, {
      "id" : "1196449663501512704",
      "region" : "xx-xx-xx",
      "enabled" : 1,
      "tenant_id" : "4e919d73499648e3b0292cd3cbef806a",
      "modified_by" : "a360371833bf4c558f796fd707b44daf",
      "modified_date" : "1763185428738",
      "created_by" : "a360371833bf4c558f796fd707b44daf",
      "created_date" : "1763185428738",
      "code" : "c7388370480791121920",
      "prefix" : "QU",
      "domain_id" : "-1",
      "icon" : "QU",
      "color" : "#6DDEBB",
      "description" : "",
      "display_name" : "QU",
      "definition_type" : 4,
      "type_id" : "10026"
    }, {
      "id" : "10020",
      "region" : "0",
      "enabled" : 1,
      "tenant_id" : "0",
      "modified_by" : "system",
      "modified_date" : "1643094460",
      "created_by" : "system",
      "created_date" : "1643094460",
      "code" : "IR",
      "prefix" : "IR",
      "domain_id" : "0",
      "icon" : "IR",
      "color" : "#FFE1C7",
      "description" : "Initial requirements (IRs) are re-described accurately, with complete background, in standard format, and from the perspective of customers/markets.",
      "display_name" : "Initial requirement",
      "definition_type" : 3,
      "type_id" : "10013"
    }, {
      "id" : "10021",
      "region" : "0",
      "enabled" : 1,
      "tenant_id" : "0",
      "modified_by" : "system",
      "modified_date" : "1643094460",
      "created_by" : "system",
      "created_date" : "1643094460",
      "code" : "RR",
      "prefix" : "RR",
      "domain_id" : "0",
      "icon" : "RR",
      "color" : "#E1E8FD",
      "description" : "Raw requirements (RRs) are raw problems or requirements described from the perspective of internal and external customers. Customer requirements are a type of RRs. This type of requirement needs to be analyzed and reviewed by the RMT/RAT.",
      "display_name" : "Raw requirement",
      "definition_type" : 3,
      "type_id" : "10012"
    }, {
      "id" : "10022",
      "region" : "0",
      "enabled" : 1,
      "tenant_id" : "0",
      "modified_by" : "system",
      "modified_date" : "1643094460",
      "created_by" : "system",
      "created_date" : "1643094460",
      "code" : "SR",
      "prefix" : "SR",
      "domain_id" : "0",
      "icon" : "SR",
      "color" : "#CFFCEE",
      "description" : "System requirements (SRs) are functional and non-functional requirements that are presented externally, can be tested, and are described from the perspective of R&D. Functional requirements are scenario-specific requirements for functions provided by the system. Non-functional requirements include requirements for system costs, global quality attributes (mainly DFX), and technical restrictions.",
      "display_name" : "System requirement",
      "definition_type" : 3,
      "type_id" : "10013"
    }, {
      "id" : "10027",
      "region" : "0",
      "enabled" : 1,
      "tenant_id" : "0",
      "modified_by" : "system",
      "modified_date" : "1643094460",
      "created_by" : "system",
      "created_date" : "1643094460",
      "code" : "Task",
      "prefix" : "TASK",
      "domain_id" : "0",
      "icon" : "Task",
      "color" : "#D8FCC0",
      "description" : "A task is an activity undertaken to achieve a specific goal. It is typically process-oriented and represents the minimum work unit in R&D and production.",
      "display_name" : "Task",
      "definition_type" : 3,
      "type_id" : "10014"
    }, {
      "id" : "10029",
      "region" : "0",
      "enabled" : 1,
      "tenant_id" : "0",
      "modified_by" : "system",
      "modified_date" : "1643094460",
      "created_by" : "system",
      "created_date" : "1643094460",
      "code" : "AR",
      "prefix" : "AR",
      "domain_id" : "0",
      "icon" : "AR",
      "color" : "#D1EBFF",
      "description" : "Allocated requirements (ARs) are functional or non-functional requirements broken down to sub-systems/modules by SRs from the perspective of deliverability based on the division of responsibilities of entry-level organizations.",
      "display_name" : "Allocated requirement",
      "definition_type" : 3,
      "type_id" : "10013"
    }, {
      "id" : "10033",
      "region" : "0",
      "enabled" : 1,
      "tenant_id" : "0",
      "modified_by" : "system",
      "modified_date" : "1643094460",
      "created_by" : "system",
      "created_date" : "1643094460",
      "code" : "Bug",
      "prefix" : "BUG",
      "domain_id" : "0",
      "icon" : "Bug",
      "color" : "#FFBCBA",
      "description" : "In project management, particularly in agile development and software project management, a bug is an error, fault, or issue in a product or system that causes it to malfunction or produce unexpected results.",
      "display_name" : "Bug",
      "definition_type" : 3,
      "type_id" : "10015"
    }, {
      "id" : "10065",
      "region" : "0",
      "enabled" : 1,
      "tenant_id" : "0",
      "modified_by" : "system",
      "modified_date" : "1643094460",
      "created_by" : "system",
      "created_date" : "1643094460",
      "code" : "SF",
      "prefix" : "SF",
      "domain_id" : "0",
      "icon" : "SF",
      "color" : "#E7D9FF",
      "description" : "System features (SFs) describe the main selling points and highlights of a product. It keeps iterating as the product evolves.",
      "display_name" : "System feature",
      "definition_type" : 3,
      "type_id" : "10001"
    } ],
    "category_layer_config" : [ {
      "id" : "1196425853033295873",
      "path" : "/1196425853033295873",
      "enabled" : true,
      "children" : [ {
        "id" : "1196425853033295875",
        "path" : "/1196425853033295873/1196425853033295875",
        "enabled" : true,
        "children" : [ {
          "id" : "1196425853033295878",
          "path" : "/1196425853033295873/1196425853033295875/1196425853033295878",
          "enabled" : true,
          "children" : [ ],
          "link_parent_field" : "parent_id",
          "code" : "af96edc9b0364841a9cfb51ccb6dd80b",
          "category_code" : "AR",
          "category_id" : "10029",
          "parent_id" : "1196425853033295875",
          "root_id" : "1196425853033295873",
          "position_x" : -607,
          "position_y" : 422
        } ],
        "link_parent_field" : "parent_id",
        "code" : "6cf2ef794d1443f6bb35983fdbeb6feb",
        "category_code" : "SR",
        "category_id" : "10022",
        "parent_id" : "1196425853033295873",
        "root_id" : "1196425853033295873",
        "position_x" : -607,
        "position_y" : 286
      } ],
      "link_parent_field" : "parent_id",
      "code" : "22faeb024989486191cceddf4c731bae",
      "category_code" : "IR",
      "category_id" : "10020",
      "root_id" : "1196425853033295873",
      "position_x" : -607,
      "position_y" : 150
    }, {
      "id" : "1196425853033295874",
      "path" : "/1196425853033295874",
      "enabled" : true,
      "children" : [ ],
      "link_parent_field" : "parent_id",
      "code" : "f0a3bf7b53e04a2288ad41c4d6f9d602",
      "category_code" : "RR",
      "category_id" : "10021",
      "root_id" : "1196425853033295874",
      "position_x" : -445,
      "position_y" : 150
    }, {
      "id" : "1196425853033295876",
      "path" : "/1196425853033295876",
      "enabled" : true,
      "children" : [ {
        "id" : "1196425853033295877",
        "path" : "/1196425853033295876/1196425853033295877",
        "enabled" : true,
        "children" : [ {
          "id" : "1200897868364558337",
          "path" : "/1196425853033295876/1196425853033295877/1200897868364558337",
          "enabled" : true,
          "children" : [ {
            "id" : "1200897868364558336",
            "path" : "/1196425853033295876/1196425853033295877/1200897868364558337/1200897868364558336",
            "enabled" : true,
            "children" : [ ],
            "link_parent_field" : "parent_id",
            "category_code" : "Task",
            "category_id" : "10027",
            "parent_id" : "1200897868364558337",
            "root_id" : "1196425853033295876",
            "position_x" : -282,
            "position_y" : 558
          } ],
          "link_parent_field" : "parent_id",
          "category_code" : "Task",
          "category_id" : "10027",
          "parent_id" : "1196425853033295877",
          "root_id" : "1196425853033295876",
          "position_x" : -282,
          "position_y" : 422
        } ],
        "link_parent_field" : "parent_id",
        "code" : "9a851a94d5fe47348c4abcc8f6506d0a",
        "category_code" : "Task",
        "category_id" : "10027",
        "parent_id" : "1196425853033295876",
        "root_id" : "1196425853033295876",
        "position_x" : -282,
        "position_y" : 286
      } ],
      "link_parent_field" : "parent_id",
      "code" : "9a851a94d5fe47348c4abcc8f6506d0a",
      "category_code" : "Task",
      "category_id" : "10027",
      "root_id" : "1196425853033295876",
      "position_x" : -282,
      "position_y" : 150
    }, {
      "id" : "1196425853033295879",
      "path" : "/1196425853033295879",
      "enabled" : true,
      "children" : [ ],
      "link_parent_field" : "parent_id",
      "code" : "2d981e00439c4799bf7088c6e9e87570",
      "category_code" : "Bug",
      "category_id" : "10033",
      "root_id" : "1196425853033295879",
      "position_x" : -135,
      "position_y" : 150
    }, {
      "id" : "1196425853033295880",
      "path" : "/1196425853033295880",
      "enabled" : true,
      "children" : [ ],
      "link_parent_field" : "parent_id",
      "code" : "6fb084e99bb648e786c1d7b59cf4197c",
      "category_code" : "SF",
      "category_id" : "10065",
      "root_id" : "1196425853033295880",
      "position_x" : 7,
      "position_y" : 150
    }, {
      "id" : "1196425853033295881",
      "path" : "/1196425853033295881",
      "enabled" : true,
      "children" : [ {
        "id" : "1196425853033295882",
        "path" : "/1196425853033295881/1196425853033295882",
        "enabled" : true,
        "children" : [ {
          "id" : "1196425853033295883",
          "path" : "/1196425853033295881/1196425853033295882/1196425853033295883",
          "enabled" : true,
          "children" : [ ],
          "link_parent_field" : "parent_id",
          "category_code" : "c7380365287323430912",
          "category_id" : "1188444469958324225",
          "parent_id" : "1196425853033295882",
          "root_id" : "1196425853033295881",
          "position_x" : 90,
          "position_y" : 422
        } ],
        "link_parent_field" : "parent_id",
        "category_code" : "c7380365247985053696",
        "category_id" : "1188444430468952065",
        "parent_id" : "1196425853033295881",
        "root_id" : "1196425853033295881",
        "position_x" : 88,
        "position_y" : 286
      }, {
        "id" : "1196449973783539712",
        "path" : "/1196425853033295881/1196449973783539712",
        "enabled" : true,
        "children" : [ ],
        "link_parent_field" : "parent_id",
        "category_code" : "c7388370480791121920",
        "category_id" : "1196449663501512704",
        "parent_id" : "1196425853033295881",
        "root_id" : "1196425853033295881",
        "position_x" : 238,
        "position_y" : 286
      } ],
      "link_parent_field" : "parent_id",
      "category_code" : "c7380365137905545216",
      "category_id" : "1188444320469135361",
      "root_id" : "1196425853033295881",
      "position_x" : 169,
      "position_y" : 150
    }, {
      "id" : "1196425853033295884",
      "path" : "/1196425853033295884",
      "enabled" : true,
      "children" : [ {
        "id" : "1196425853033295885",
        "path" : "/1196425853033295884/1196425853033295885",
        "enabled" : true,
        "children" : [ {
          "id" : "1196425853033295887",
          "path" : "/1196425853033295884/1196425853033295885/1196425853033295887",
          "enabled" : true,
          "children" : [ ],
          "link_parent_field" : "parent_id",
          "category_code" : "c7384780729121075200",
          "category_id" : "1192859911804203008",
          "parent_id" : "1196425853033295885",
          "root_id" : "1196425853033295884",
          "position_x" : 376,
          "position_y" : 422
        } ],
        "link_parent_field" : "parent_id",
        "category_code" : "c7384780703795867648",
        "category_id" : "1192859886432858112",
        "parent_id" : "1196425853033295884",
        "root_id" : "1196425853033295884",
        "position_x" : 372,
        "position_y" : 286
      } ],
      "link_parent_field" : "parent_id",
      "category_code" : "c7384780668794400768",
      "category_id" : "1192859851372670977",
      "root_id" : "1196425853033295884",
      "position_x" : 374,
      "position_y" : 150
    }, {
      "id" : "1196425853033295886",
      "path" : "/1196425853033295886",
      "enabled" : true,
      "children" : [ {
        "id" : "1196425853033295888",
        "path" : "/1196425853033295886/1196425853033295888",
        "enabled" : true,
        "children" : [ {
          "id" : "1196425853033295889",
          "path" : "/1196425853033295886/1196425853033295888/1196425853033295889",
          "enabled" : true,
          "children" : [ ],
          "link_parent_field" : "parent_id",
          "category_code" : "c7384780761601765376",
          "category_id" : "1192859944242950144",
          "parent_id" : "1196425853033295888",
          "root_id" : "1196425853033295886",
          "position_x" : 510,
          "position_y" : 422
        } ],
        "link_parent_field" : "parent_id",
        "category_code" : "c7384780729121075200",
        "category_id" : "1192859911804203008",
        "parent_id" : "1196425853033295886",
        "root_id" : "1196425853033295886",
        "position_x" : 511,
        "position_y" : 286
      } ],
      "link_parent_field" : "parent_id",
      "category_code" : "c7384780703795867648",
      "category_id" : "1192859886432858112",
      "root_id" : "1196425853033295886",
      "position_x" : 507,
      "position_y" : 150
    } ],
    "feature_page_link_template" : "https://{endpoint}/ipdproject/openapi/v1/projects/ea7320ff143048a289add875b56b5f76/redirect-feature-link?issue_id={issue_id}"
  }
}

Status code: 400

{
  "error_code" : "PM.02174103",
  "error_msg" : "No permission."
}

SDK Sample Code

The SDK sample code is as follows.

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
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.projectman.v4.region.ProjectManRegion;
import com.huaweicloud.sdk.projectman.v4.*;
import com.huaweicloud.sdk.projectman.v4.model.*;


public class GetModelConfigSolution {

    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);

        ProjectManClient client = ProjectManClient.newBuilder()
                .withCredential(auth)
                .withRegion(ProjectManRegion.valueOf("<YOUR REGION>"))
                .build();
        GetModelConfigRequest request = new GetModelConfigRequest();
        request.withProjectId("{project_id}");
        try {
            GetModelConfigResponse response = client.getModelConfig(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
# coding: utf-8

import os
from huaweicloudsdkcore.auth.credentials import BasicCredentials
from huaweicloudsdkprojectman.v4.region.projectman_region import ProjectManRegion
from huaweicloudsdkcore.exceptions import exceptions
from huaweicloudsdkprojectman.v4 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.environ["CLOUD_SDK_AK"]
    sk = os.environ["CLOUD_SDK_SK"]

    credentials = BasicCredentials(ak, sk)

    client = ProjectManClient.new_builder() \
        .with_credentials(credentials) \
        .with_region(ProjectManRegion.value_of("<YOUR REGION>")) \
        .build()

    try:
        request = GetModelConfigRequest()
        request.project_id = "{project_id}"
        response = client.get_model_config(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
48
package main

import (
	"fmt"
	"github.com/huaweicloud/huaweicloud-sdk-go-v3/core/auth/basic"
    projectman "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/projectman/v4"
	"github.com/huaweicloud/huaweicloud-sdk-go-v3/services/projectman/v4/model"
    region "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/projectman/v4/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, err := basic.NewCredentialsBuilder().
        WithAk(ak).
        WithSk(sk).
        SafeBuild()

    if err != nil {
        fmt.Println(err)
        return
    }

    hcClient, err := projectman.ProjectManClientBuilder().
         WithRegion(region.ValueOf("<YOUR REGION>")).
         WithCredential(auth).
         SafeBuild()


    if err != nil {
        fmt.Println(err)
        return
    }

    client := projectman.NewProjectManClient(hcClient)

    request := &model.GetModelConfigRequest{}
	request.ProjectId = "{project_id}"
	response, err := client.GetModelConfig(request)
	if err == nil {
        fmt.Printf("%+v\n", response)
    } else {
        fmt.Println(err)
    }
}

More

For SDK sample code of more programming languages, see the Sample Code tab in API Explorer. SDK sample code can be automatically generated.

Status Codes

Status Code

Description

200

Response to a successful request for obtaining the model tree configuration.

400

Response upon a request failure. For example, the user does not have the operation permission or the project does not exist.

Error Codes

See Error Codes.