機械翻訳について

資格証明の更新

put

/api/v2/credentials/{id}/

このリソースに対してPUTまたはPATCHリクエストを行って、この資格証明を更新します。 次のフィールドを変更できます。

  • name: この資格証明の名前。(文字列、必須)
  • description: この資格証明のオプションの説明。(文字列、デフォルト="")
  • organization: (id、デフォルト=None)
  • credential_type: 作成する資格証明のタイプを指定します。 各タイプの詳細は、ドキュメントを参照してください。(id、必須)

  • inputs: JSONまたはYAML構文を使用して入力を入力します。 構文の例については、ドキュメントを参照してください。(json、デフォルト={})

PUTリクエストの場合は、リクエストにすべてのフィールドを含めます。

リクエスト

サポートされているメディア・タイプ
パス・パラメータ
問合せパラメータ
本文()
ルート・スキーマ : schema
例:
{
    "credential_type":1,
    "inputs":{
        "ssh_key_data":"$encrypted$",
        "ssh_key_unlock":"new-unlock",
        "username":"joe"
    },
    "name":"Best credential ever",
    "organization":1
}
先頭に戻る

レスポンス

サポートされているメディア・タイプ

200レスポンス

本文
レスポンスの例(application/json)
{
    "cloud":false,
    "created":"2018-02-01T08:00:00.000000Z",
    "credential_type":1,
    "description":"",
    "id":1,
    "inputs":{
        "ssh_key_data":"$encrypted$",
        "ssh_key_unlock":"$encrypted$",
        "username":"joe"
    },
    "kind":"ssh",
    "kubernetes":false,
    "managed":false,
    "modified":"2018-02-01T08:00:00.000000Z",
    "name":"Best credential ever",
    "organization":1,
    "related":{
        "access_list":"/api/v2/credentials/1/access_list/",
        "activity_stream":"/api/v2/credentials/1/activity_stream/",
        "copy":"/api/v2/credentials/1/copy/",
        "credential_type":"/api/v2/credential_types/1/",
        "input_sources":"/api/v2/credentials/1/input_sources/",
        "object_roles":"/api/v2/credentials/1/object_roles/",
        "organization":"/api/v2/organizations/1/",
        "owner_teams":"/api/v2/credentials/1/owner_teams/",
        "owner_users":"/api/v2/credentials/1/owner_users/"
    },
    "summary_fields":{
        "credential_type":{
            "description":"",
            "id":1,
            "name":"Machine"
        },
        "object_roles":{
            "admin_role":{
                "description":"Can manage all aspects of the credential",
                "id":16,
                "name":"Admin"
            },
            "read_role":{
                "description":"May view settings for the credential",
                "id":18,
                "name":"Read"
            },
            "use_role":{
                "description":"Can use the credential in a job template",
                "id":17,
                "name":"Use"
            }
        },
        "organization":{
            "description":"test-org-desc",
            "id":1,
            "name":"test-org"
        },
        "owners":[
            {
                "description":"test-org-desc",
                "id":1,
                "name":"test-org",
                "type":"organization",
                "url":"/api/v2/organizations/1/"
            }
        ],
        "user_capabilities":{
            "copy":true,
            "delete":true,
            "edit":true,
            "use":true
        }
    },
    "type":"credential",
    "url":"/api/v2/credentials/1/"
}

400レスポンス

本文
レスポンスの例(application/json)
{
    "inputs":{
        "ssh_key_data":[
            "Invalid certificate or key: invalid-key..."
        ]
    }
}
先頭に戻る