Updated on 2026-01-22 GMT+08:00

Querying Details about a File

Function

Query details about a file.

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

codeartsartifact:releaseRepo:read

Read

-

-

-

-

URI

GET /devreposerver/v5/files/{id}/info

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

id

Yes

String

Definition:

File ID.

Constraints:

N/A

Value range:

N/A

Default value:

N/A

Request Parameters

None

Response Parameters

Status code: 200

Table 2 Response body parameters

Parameter

Type

Description

status

String

Definition

Request status.

Range

success: The request is successful.

error: The request fails.

trace_id

String

Definition

Request ID, which uniquely identifies the current request.

Range

A string of digits and hyphens (-).

result

RepoFileDOV5 object

Definition

File information.

Range

N/A.

Table 3 RepoFileDOV5

Parameter

Type

Description

id

String

Definition

id.

Range

N/A.

file_id

String

Definition

File ID.

Range

N/A.

repo_name

String

Definition

Repository ID.

Range

N/A.

project_name

String

Definition

Project name.

Range

N/A.

parent_id

String

Definition

Parent directory ID.

Range

N/A.

name

String

Definition

File name.

Range

N/A.

file_name

String

Definition

File name.

Range

N/A.

type

String

Definition

File type. folder indicates a directory, and file indicates a file.

Range

N/A.

category

String

Definition

Release package status. test indicates a test package, and prod indicates a release package.

Range

N/A.

extension

String

Definition

File name extension.

Range

N/A.

path

String

Definition

File path.

Range

N/A.

full_path

String

Definition

File path (including the project).

Range

N/A.

size

Long

Definition

File size (in bytes).

Range

N/A.

md5

String

Definition

MD5.

Range

N/A.

sha256

String

Definition

SHA-256.

Range

N/A.

download_url

String

Definition

Download URL.

Range

N/A.

download_url_with_id

String

Definition

Download URL with an ID.

Range

N/A.

web_url

String

Definition

web_url.

Range

N/A.

version_enable

Boolean

Definition

version_enable.

Range

N/A.

migrated_state

Integer

Definition

migrated_state.

Range

N/A.

upload_id

String

Definition

upload_id.

Range

N/A.

Example Requests

Query details about a file.

https://{URL}/devreposerver/v5/files/a3770843d8594b0a9b3a1131a613689a/info

Example Responses

Status code: 200

OK

{
  "status" : "success",
  "trace_id" : "28312d02ba6144bdbeee358f8be2d052",
  "result" : {
    "status" : "active",
    "region" : "xx-xxxxx-x",
    "id" : "a3770843d8594b0a9b3a1131a613689a",
    "name" : "tool_version.json",
    "type" : "file",
    "category" : "test",
    "extension" : "json",
    "path" : "/",
    "size" : 157,
    "md5" : "c25d932898e4b63d1447d9c37b957513",
    "sha256" : "bd992ba958893fa9aabdf63fecbfdaf91583959b9c383054c5a5f66c9b109887",
    "domain_id" : "09d2ca2f5080d5b60f51c00ae5bad0a0",
    "created_time" : "2025-05-13 16:55:53",
    "modified_time" : "2025-05-13 16:55:53",
    "created_user_id" : "09d2ca2ffd00d3c21ff8c00a4dd1e080",
    "created_user_name" : "devcloud_devcloud_y00226182_05",
    "created_user_nick_name" : "Repository helper",
    "created_user_domain_name" : "devcloud_devcloud_y00226182_05",
    "modified_user_id" : "09d2ca2ffd00d3c21ff8c00a4dd1e080",
    "modified_user_name" : "devcloud_devcloud_y00226182_05",
    "modified_user_nick_name" : "Repository helper",
    "modified_user_domain_name" : "devcloud_devcloud_y00226182_05",
    "build_version" : "latest",
    "repo_url" : "",
    "project_id" : "f132b62084774001b84c294c0eef27f2",
    "file_id" : "3fe9d7a21bf04df2b0159ae958b6f9ad",
    "repo_name" : "xx-xxxxx-x_f132b62084774001b84c294c0eef27f2_generic_0",
    "project_name" : "test-jk2",
    "parent_id" : "0",
    "download_url" : "DevRepoServer/v1/files/download?filename=f132b62084774001b84c294c0eef27f2/tool_version.json",
    "download_url_with_id" : "DevRepoServer/v1/files/download?file_id=a3770843d8594b0a9b3a1131a613689a",
    "web_url" : "releaseman/project/f132b62084774001b84c294c0eef27f2/private/general?parentId=0",
    "version_enable" : false,
    "migrated_state" : 3,
    "repo_same_trash_file_name" : "trash_3fe9d7a21bf04df2b0159ae958b6f9ad_tool_version.json",
    "repo_file_path" : "/tool_version.json"
  }
}

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.codeartsartifact.v2.region.CodeArtsArtifactRegion;
import com.huaweicloud.sdk.codeartsartifact.v2.*;
import com.huaweicloud.sdk.codeartsartifact.v2.model.*;


public class ShowFileDetailSolution {

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

        CodeArtsArtifactClient client = CodeArtsArtifactClient.newBuilder()
                .withCredential(auth)
                .withRegion(CodeArtsArtifactRegion.valueOf("<YOUR REGION>"))
                .build();
        ShowFileDetailRequest request = new ShowFileDetailRequest();
        request.withId("{id}");
        try {
            ShowFileDetailResponse response = client.showFileDetail(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 huaweicloudsdkcodeartsartifact.v2.region.codeartsartifact_region import CodeArtsArtifactRegion
from huaweicloudsdkcore.exceptions import exceptions
from huaweicloudsdkcodeartsartifact.v2 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 = CodeArtsArtifactClient.new_builder() \
        .with_credentials(credentials) \
        .with_region(CodeArtsArtifactRegion.value_of("<YOUR REGION>")) \
        .build()

    try:
        request = ShowFileDetailRequest()
        request.id = "{id}"
        response = client.show_file_detail(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
package main

import (
	"fmt"
	"github.com/huaweicloud/huaweicloud-sdk-go-v3/core/auth/basic"
    codeartsartifact "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/codeartsartifact/v2"
	"github.com/huaweicloud/huaweicloud-sdk-go-v3/services/codeartsartifact/v2/model"
    region "github.com/huaweicloud/huaweicloud-sdk-go-v3/services/codeartsartifact/v2/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 := codeartsartifact.NewCodeArtsArtifactClient(
        codeartsartifact.CodeArtsArtifactClientBuilder().
            WithRegion(region.ValueOf("<YOUR REGION>")).
            WithCredential(auth).
            Build())

    request := &model.ShowFileDetailRequest{}
	request.Id = "{id}"
	response, err := client.ShowFileDetail(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

OK

Error Codes

See Error Codes.