Skip to content

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

Open
@liangyuanpeng

Description

@liangyuanpeng
  • 产品和接口: 容器服务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>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions