可列出 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 範例瀏覽器