Skip to main content
Astra Automation
此產品有較新版本可以使用。
本繁體中文版使用機器翻譯,譯文僅供參考,若與英文版本牴觸,應以英文版本為準。

擷取憑證

GET /accounts/{account_id}/core/v1/certificates/{certificate_id}

在 JSON 回應本文中傳回已儲存的 Certificate API 資源。

參數

Name 類型 必要 說明

account_id

字串

路徑

True

包含帳戶資源的 ID

  • 範例:{{.Account}}

certificate_id

字串

路徑

True

要列出的憑證集合 ID

回應

Status: 200, Returns the stored Certificate API resource in the JSON response body.
Name 類型 必要 說明

類型

字串

True

資源的媒體類型。定義的值為:

  • 「application/astra-certificate」

版本

字串

True

資源版本。定義的值為:

  • "1.0"

  • "1.1"

ID

字串

True

資源的全域唯一識別碼。定義的值為:

  • 符合 UUIDv4 架構

certUse

字串

True

指示憑證用途的 JSON 字串。如果未指定,則預設為 "rootCA"。定義的值為:

  • 「rootCA」- 憑證是憑證授權單位(CA)憑證,用於信任由該 CA 簽署的任何憑證。

  • 「intermediateCA」- 此憑證是由根 CA 所頒發的中間 CA 憑證。

憑證

字串

True

包含經過 base64 編碼的 PKCS-11 格式憑證(PEM)的 JSON 字串。定義的值為:

  • 符合 base64 編碼資料架構

cn

字串

True

包含從憑證中擷取的通用名稱的 JSON 字串。定義的值為:

  • 最短長度:1

  • 最大長度:511

expiryTimestamp

字串

True

包含時間戳記的 JSON 字串,指示憑證的過期時間。定義的值為:

  • 符合 ISO-8601 日期時間架構

isSelfSigned

字串

True

指示憑證是否為自簽名憑證的 JSON 字串。如果在建立時未提供,則預設值為 "false"。更新時:

  • 如果提供了值,則會使用該值。

  • 如果未提供該值,且更新中包含「cert」欄位,則該值將設定為「false」。

  • 如果未提供該值,且更新中未包含「cert」欄位,則將保留現有值。定義的值為:

  • 「true」- 憑證為自我簽署。

  • "false" - 此憑證不是自簽名憑證。

trustState

字串

True

包含一組列舉值之一的 JSON 字串,指示憑證是否受信任。定義的值為:

  • 「untrusted」- 憑證不受信任。

  • 「trusted」- 憑證標記為受信任。

  • 「已過期」- 憑證已過期,因此既不受信任也不不受信任。

trustStateTransitions

陣列["type_astra_stateTransition"]

True

JSON 物件的 JSON 陣列,每個物件代表從給定已定義狀態允許的狀態轉換集。每個 JSON 物件包含「from」和「to」欄位,其中「from」值是狀態名稱,「to」值是允許的目標狀態陣列。

trustStateDesired

字串

錯誤

JSON 字串包含一個值,指示憑證是否受信任。如果在建立時未指定,則預設值為 "trusted"。定義的值為:

  • 「untrusted」- 憑證不受信任。

  • 「trusted」- 憑證標記為受信任。

trustStateDetails

陣列["type_astra_stateDetail"]

True

包含 JSON 物件的 JSON 陣列,其中列出了憑證信任狀態的其他詳細資料。如果沒有可用的詳細資料,此陣列將為空白。

  • 最低項目數:0

中繼資料

"type_astra_metadata_update"

True

與資源相關聯的用戶端和服務指定中繼資料。定義的值為:

  • 符合 Astra Metadata Schema。如果在建立時未指定、則會建立沒有標籤的中繼資料物件。如果在更新時未指定,元資料物件的標籤、creationTimestamp 和 createdBy 將保持不變。

範例回應
{
  "type": "application/astra-certificate",
  "version": "1.1",
  "id": "a26cbed4-2183-58ce-aa19-e37ca8b0531a",
  "certUse": "rootCA",
  "cert": "LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUZyVENDQTVXZ0F3MVJHbnFGbUJSSWRyV1kwPQotLS0tLUVORCBDRVJUSUZJQ0FURS0tLS0t",
  "cn": "vcenter.example.com",
  "expiryTimestamp": "2022-03-23T16:48:38.5233461Z",
  "isSelfSigned": "true",
  "trustState": "untrusted",
  "trustStateTransitions": [
    {
      "from": "untrusted",
      "to": [
        "trusted"
      ]
    },
    {
      "from": "trusted",
      "to": [
        "untrusted"
      ]
    }
  ],
  "trustStateDetails": [],
  "metadata": {
    "labels": [],
    "creationTimestamp": "2022-10-06T20:58:16.305662Z",
    "modificationTimestamp": "2022-10-06T20:58:16.305662Z",
    "createdBy": "8f84cf09-8036-51e4-b579-bd30cb07b269"
  }
}

回應

Status: 401, Unauthorized
Name 類型 必要 說明

類型

字串

True

標題

字串

True

詳細資料

字串

True

狀態

字串

True

correlationID

字串

錯誤

範例回應
{
  "type": "https://astra.netapp.io/problems/3",
  "title": "Missing bearer token",
  "detail": "The request is missing the required bearer token.",
  "status": "401"
}

回應

Status: 400, Bad request
Name 類型 必要 說明

類型

字串

True

標題

字串

True

詳細資料

字串

True

狀態

字串

True

correlationID

字串

錯誤

invalidParams

陣列["invalidParams"]

錯誤

無效查詢參數清單

範例回應
{
  "type": "https://astra.netapp.io/problems/5",
  "title": "Invalid query parameters",
  "detail": "The supplied query parameters are invalid.",
  "status": "400"
}

回應

Status: 403, Forbidden
Name 類型 必要 說明

類型

字串

True

標題

字串

True

詳細資料

字串

True

狀態

字串

True

correlationID

字串

錯誤

範例回應
{
  "type": "https://astra.netapp.io/problems/11",
  "title": "Operation not permitted",
  "detail": "The requested operation isn't permitted.",
  "status": "403"
}

回應

Status: 503, Service unavailable
Name 類型 必要 說明

類型

字串

True

標題

字串

True

詳細資料

字串

True

狀態

字串

True

correlationID

字串

錯誤

範例回應
{
  "type": "https://astra.netapp.io/problems/41",
  "title": "Service not ready",
  "detail": "Currently, the service can't respond to this request.",
  "status": "503"
}

回應

Status: 409, Conflict
Name 類型 必要 說明

類型

字串

True

標題

字串

True

詳細資料

字串

True

狀態

字串

True

correlationID

字串

錯誤

範例回應
{
  "type": "https://astra.netapp.io/problems/164",
  "title": "Requested resource in unexpected state",
  "detail": "The requested resource can't be returned because it isn't in the expected state. Wait for the conflict to be resolved and retry the request.",
  "status": "409"
}

錯誤

Status: 404, Not found
Name 類型 必要 說明

類型

字串

True

標題

字串

True

詳細資料

字串

True

狀態

字串

True

correlationID

字串

錯誤

範例錯誤回應
{
  "type": "https://astra.netapp.io/problems/2",
  "title": "Collection not found",
  "detail": "The collection specified in the request URI wasn't found.",
  "status": "404"
}

定義

請參閱定義

type_astra_stateTransition

Name 類型 必要 說明

字串

True

陣列[string]

True

additionalDetails

type_astra_stateDetail

Name 類型 必要 說明

類型

字串

True

標題

字串

True

詳細資料

字串

True

additionalDetails

"additionalDetails"

錯誤

type_astra_label

Name 類型 必要 說明

姓名

字串

True

字串

True

type_astra_metadata_update

與資源相關聯的用戶端和服務指定中繼資料。定義的值為:

  • 符合 Astra Metadata Schema。如果在建立時未指定、則會建立沒有標籤的中繼資料物件。如果在更新時未指定,元資料物件的標籤、creationTimestamp 和 createdBy 將保持不變。

Name 類型 必要 說明

標籤

陣列["type_astra_label"]

錯誤

建立時間戳記

字串

錯誤

修改時間戳記

字串

錯誤

建立者

字串

錯誤

modifiedBy

字串

錯誤

invalidParams

Name 類型 必要 說明

姓名

字串

True

無效查詢參數的名稱

原因

字串

True

查詢參數無效的原因