資格証明の更新
patch
/api/v2/credentials/{id}/
このリソースに対してPUTまたはPATCHリクエストを行って、この資格証明を更新します。 次のフィールドを変更できます。
name
: この資格証明の名前。(文字列、必須)description
: この資格証明のオプションの説明。(文字列、デフォルト=""
)organization
: (id、デフォルト=None
)-
credential_type
: 作成する資格証明のタイプを指定します。 各タイプの詳細は、ドキュメントを参照してください。(id、必須) -
inputs
: JSONまたはYAML構文を使用して入力を入力します。 構文の例については、ドキュメントを参照してください。(json、デフォルト={}
)
PATCHリクエストの場合は、変更中のフィールドのみを含めます。
リクエスト
サポートされているメディア・タイプ
- application/json
パス・パラメータ
問合せパラメータ
- search(オプション): 文字列
検索条件。
ルート・スキーマ : schema
例:
{
"inputs":{
"password":"$encrypted$",
"username":"joe"
}
}
レスポンス
サポートされているメディア・タイプ
- application/json
200レスポンス
レスポンスの例(application/json)
{
"cloud":false,
"created":"2018-02-01T08:00:00.000000Z",
"credential_type":1,
"description":"",
"id":1,
"inputs":{
"password":"$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)
{
"credential_type":[
"You cannot change the credential type of the credential, as it may break the functionality of the resources using it."
]
}