Oracle Cloud 命令行接口
oci 是 Oracle Cloud Infrastructure CLI,按服务组织命令,例如 oci compute、oci os、oci ce。它依赖 profile、tenancy OCID、region 和认证方式。
oci setup config
oci iam user list
oci compute instance list --compartment-id <compartment-ocid>
oci compute instance launch \
--compartment-id <compartment-ocid> \
--availability-domain <ad> \
--shape VM.Standard.E4.Flex \
--image-id <image-ocid>
oci os object put --bucket-name my-bucket --file ./app.zip
oci os object get --bucket-name my-bucket --name app.zip --file ./app.zip
oci ce cluster create-kubeconfig \
--cluster-id <cluster-ocid> --file ~/.kube/config
oci --profile prod --output table compute instance list \
--compartment-id <compartment-ocid> --all
--compartment-id 会看不到或建错位置。--all,否则只拿到第一页。--output table 适合人看,脚本用 --output json 并固定字段。~/.oci/config 权限要收紧。aws / gcloud / az — 其他云 CLIkubectl — OKE 集群操作terraform — 声明式管理 OCI 资源