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

如何访问容器镜像服务个人版API #714

Closed
yousong opened this issue May 24, 2023 · 7 comments
Closed

如何访问容器镜像服务个人版API #714

yousong opened this issue May 24, 2023 · 7 comments

Comments

@yousong
Copy link

yousong commented May 24, 2023

  • 需求类型:

增加特性

  • 需求描述:

容器镜像服务(cr)提供企业版和个人版实例服务,企业版API和个人版API是分开的,不能相互混用。当前aliyun cr子命令只支持访问企业版实例。新版本aliyun-cli如何访问个人版实例服务呢?

  • 设计方案:

@TsinghuaDream
Copy link
Contributor

强制调用
aliyun mockproduct GET /regions --version 2016-06-07 --endpoint cr.cn-beijing.aliyuncs.com --force

@yousong
Copy link
Author

yousong commented Jun 7, 2023

强制调用 aliyun mockproduct GET /regions --version 2016-06-07 --endpoint cr.cn-beijing.aliyuncs.com --force

我这里没有mockproduct这个子命令,是需要开启什么隐藏通道吗?

➜  ~ aliyun --version | grep Version
Alibaba Cloud Command Line Interface Version 3.0.165
➜  ~ aliyun --help | grep mockproduct
➜  ~ aliyun --help | grep mock
➜  ~ aliyun mockproduct --help
Alibaba Cloud Command Line Interface Version 3.0.165
ERROR: 'mockproduct' is not a valid command or product. See `aliyun help`.
➜  ~ aliyun mockproduct GET
ERROR: 'mockproduct' is not a valid command or product. See `aliyun help`.
➜  ~
@TsinghuaDream
Copy link
Contributor

不需要 这个命令就是隐藏通道 没有help提示的

@yousong
Copy link
Author

yousong commented Jun 7, 2023

不需要 这个命令就是隐藏通道 没有help提示的

多谢。没有文档,这个体验不是很好,比如POST传参之类

而且……

  • 这个mockproduct在仓库的源码里面都没有找到
  • 相同的命令使用从源码编译的二进制去执行会报错

难道release页面的二进制不是这里仓库编译出来的吗 ;(

@TsinghuaDream
Copy link
Contributor

TsinghuaDream commented Jun 7, 2023

不需要 这个命令就是隐藏通道 没有help提示的

多谢。没有文档,这个体验不是很好,比如POST传参之类

而且……

  • 这个mockproduct在仓库的源码里面都没有找到
  • 相同的命令使用从源码编译的二进制去执行会报错

���道release页面的二进制不是这里仓库编译出来的吗 ;(

你加了--force吗 应该不会报错的
这块主要原因是 个人版CR 元数据没接入CLI 所以需要使用类似公共调用方法强行调用

@yousong
Copy link
Author

yousong commented Jun 8, 2023

不需要 这个命令就是隐藏通道 没有help提示的

多谢。没有文档,这个体验不是很好,比如POST传参之类
而且……

  • 这个mockproduct在仓库的源码里面都没有找到
  • 相同的命令使用从源码编译的二进制去执行会报错

难道release页面的二进制不是这里仓库编译出来的吗 ;(

你加了--force吗 应该不会报错的 这块主要原因是 个人版CR 元数据没接入CLI 所以需要使用类似公共调用方法强行调用

刚才再确认了下,是因为当时执行的环境没有做aliyun configure。实际是可以用的。

补充一些信息

代码入口

if !force {
return nil, &InvalidProductError{Code: productCode, library: c.library}
}
//
// force call on unknown product, use temporary product info
product = meta.Product{
Code: productCode,
}

@yousong
Copy link
Author

yousong commented Jun 16, 2023

估计使用GET/POST是可以达到效果的,先关闭issue。

@TsinghuaDream ,感谢提供帮助!

@yousong yousong closed this as completed Jun 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants