Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
liangyuanpeng opened this issue Jan 31, 2021 · 1 comment

Comments

@liangyuanpeng
Copy link

liangyuanpeng commented Jan 31, 2021

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

有人可以帮忙回答下这个InstanceId是在哪里看吗?Thanks,需要InstanceId的请求接口都是这样的问题.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant