列出 Composer 映像版本

列出 Cloud Composer 的映像版本

代码示例

Node.js

如需向 Cloud Composer 进行身份验证,请设置应用默认凭据。 如需了解详情,请参阅为本地开发环境设置身份验证

// Imports the Google Cloud client library

// remove this line after package is released
// eslint-disable-next-line node/no-missing-require
const {ImageVersionsClient} = require('@google-cloud/orchestration-airflow');

// TODO(developer): replace with your prefered project ID.
// const projectId = 'my-project'

// Creates a client
// eslint-disable-next-line no-unused-vars
const client = new ImageVersionsClient();

async function listImageVersions() {
  const [versions] = await client.listImageVersions({
    parent: `projects/${projectId}/locations/${location}`,
  });
  console.info(versions);
}
listImageVersions();

后续步骤

如需搜索和过滤其他 Google Cloud 产品的代码示例,请参阅 Google Cloud 示例浏览器