aliyun / aliyun/aliyun-openapi-java-sdk

CreateRepositoryRequest 需要必填InstanceId,公共服务没有这个参数

Open
#542 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
1.4k
Forks
1.1k
PR merge metrics
No merged PRs in 30d

Description

  • 产品和接口: 容器服务ACR 公共版 CreateRepositoryRequest
  • 平台: win10
  • 最小代码:

image

创建容器镜像仓库接口需要必填InstanceId,公共服务的这个InstanceId参数是哪里看呢?感谢.

代码:

            CreateRepositoryRequest createRepoRequest = new CreateRepositoryRequest();
            createRepoRequest.setRepoNamespaceName("lan-k8s");
            createRepoRequest.setRepoName("prometheus-operator");
            createRepoRequest.setSummary("1");
            createRepoRequest.setRepoType("PUBLIC");

            HttpResponse response2 = client.doAction(createRepoRequest);
            // 处理结果
            System.out.println(new String(response2.getHttpContent()));

得到:

{"RequestId":"09965506-6DBB-4562-B816-10F4E0F6434A","Message":"InstanceId is mandatory for this action.","Recommend":"https://error-center.aliyun.com/status/search?Keyword=MissingInstanceId&source=PopGw","HostId":"cr.cn-shenzhen.aliyuncs.com","Code":"MissingInstanceId"}
Disconnected from the target VM, address: '127.0.0.1:61841', transport: 'socket'

其他: maven依赖

        <!-- https://mvnrepository.com/artifact/com.aliyun/aliyun-java-sdk-cr -->
        <dependency>
            <groupId>com.aliyun</groupId>
            <artifactId>aliyun-java-sdk-cr</artifactId>
            <version>4.1.2</version>
        </dependency>
        <!-- https://mvnrepository.com/artifact/com.aliyun/aliyun-java-sdk-core -->
        <dependency>
            <groupId>com.aliyun</groupId>
            <artifactId>aliyun-java-sdk-core</artifactId>
            <version>4.5.18</version>
        </dependency>

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the CreateRepositoryRequest usage and the Maven dependencies shown in the issue, then trace the request sent to the ACR public CreateRepository API. Confirm whether InstanceId is required for public repositories and document or correct the request behavior so the reported MissingInstanceId response is resolved.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api, cloud
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.