Workload Management(ワークロード管理)API
ワークロードルールを使用して、次のオペレーションを実行できます。
GET /enable
このAPIは、ワークロード管理の有効なステータスを取得するために使用されます。
パラメーター:
なし
ワークロード管理のステータスを取得する例
curl -X GET -u admin:admin "http://localhost:9400/rest/workload/v1/enable"
PUT /enable
このAPIは、ワークロード管理を有効または無効にするために使用されます。
パラメーター:
名前 |
説明 |
パラメータータイプ |
データタイプ |
body |
|
body |
integer |
ワークロードを有効にする例
curl -X PUT -u admin:admin "http://localhost:9400/rest/workload/v1/enable" -H "Content-Type:application/json" -d "1"
ワークロードを無効にする例
curl -X PUT -u admin:admin "http://localhost:9400/rest/workload/v1/enable" -H "Content-Type:application/json" -d "0"
GET /rules
このAPIは、ワークロードルールを取得するために使用されます。
パラメーター:
名前 |
説明 |
パラメータータイプ |
データタイプ |
ruleName |
|
query |
string |
サーバーに存在するすべてのワークロードルールを取得する例
curl -X GET -u admin:admin "http://localhost:9400/rest/workload/v1/rules"
ワークロードルール「rule1」を取得する例
curl -X GET -u admin:admin "http://localhost:9400/rest/workload/v1/rules?ruleName=rule1"
POST /rules
このAPIは、フィルター、リソース、およびメンバーの割り当てを指定することにより、ワークロードルールを作成するために使用されます。
パラメーター:
名前 |
説明 |
パラメータータイプ |
データタイプ |
body |
ワークロードルール |
body |
Array[#/definitions/WorkloadRuleBean] |
リクエスト本文
値の例-スキーマ
{
“ ruleName”:“ string”、
“ ruleType:“ ROW_LIMIT”、
“ maxRowCount”:0、
“ enabled”:true、
「annotation」:「string」、
「memberAssignments」:[
{
「domainName」:「string」、
「memberName」:「string」、
“ group”:true
}
]、
“ resourceAssignments”:[
{
“ resourcePath”:“ string”、
“ resourceType” :“ string”
}
]、
“ memoryLimitPercentage”:0、
“ actionTypes”:“ NOOP”
]、
“ emailActionData”: {
“ from”:“ string”、
“ replyTo”:“ string”、
“ to”:[
“ string”
]、
“ cc”:[
“ string”
]、
“ bcc”:[
“ string”
]、
“ subject”:“ string”、
“ content”:“ string”
}、
“ maxRequestTime” 0、
“ maxRequestTimeUnit”:“ NANOSECONDS”、
“ newRuleName”:“ string”、
“ customMessage”:“ string”
}
]
ワークロードルール「rule1」を作成する例
curl -X POST -u admin:admin "http://localhost:9400/rest/workload/v1/rules" -H "Content-Type:application/json" -d "[{\"ruleName\":\"rule1\",\"enabled\":\"true\", \"actionTypes\":[\"NOOP\"], \"ruleType\":\"FULL_TABLE_SCAN\", \"annotation\":\"Rule to disallow select *\", \"memberAssignments\":[{\"domainName\":\"composite\", \"memberName\":\"customuser\", \"group\":\"false\"}], \"resourceAssignments\":[{\"resourcePath\":\"/services/databases/foo/customers\", \"resourceType\":\"TABLE\"}] }]"
PUT /rules
このAPIは、ワークロードルールを更新するために使用されます。
パラメーター:
なし
リクエスト本文
値の例-スキーマ
{
“ ruleName”:“ string”、
“ ruleType:“ ROW_LIMIT”、
“ maxRowCount”:0、
“ enabled”:true、
「annotation」:「string」、
「memberAssignments」:[
{
「domainName」:「string」、
「memberName」:「string」、
“ group”:true
}
]、
“ resourceAssignments”:[
{
“ resourcePath”:“ string”、
“ resourceType” :“ string”
}
]、
“ memoryLimitPercentage”:0、
“ actionTypes”:“ NOOP”
]、
“ emailActionData”: {
“ from”:“ string”、
“ replyTo”:“ string”、
“ to”:[
“ string”
]、
“ cc”:[
“ string”
]、
“ bcc”:[
“ string”
]、
“ subject”:“ string”、
“ content”:“ string”
}、
“ maxRequestTime” 0、
“ maxRequestTimeUnit”:“ NANOSECONDS”、
“ newRuleName”:“ string”、
“ customMessage”:“ string”
}
]
ワークロードルール「/policy/workload/rule1」が有効なステータスとルールタイプを更新する例
curl -X PUT -u admin:admin "http://localhost:9400/rest/workload/v1/rules" -H "Content-Type:application/json" -d "[{\"ruleName\":\"rule1\",\"enabled\":\"false\", \"actionTypes\":[\"NOOP\"], \"ruleType\":\"ROW_LIMIT\", \"annotation\":\"Rule to limit rows\", \"maxRowCount\":\"10\", \"memberAssignments\":[{\"domainName\":\"composite\", \"memberName\":\"customuser\", \"group\":\"false\"}], \"resourceAssignments\":[{\"resourcePath\":\"/services/databases/foo/customers\", \"resourceType\":\"TABLE\"}] }]"
ワークロードルールの名前を「/policy/workload/rule1」から「/policy/workload/rule2」に変更する例
curl -X PUT -u admin:admin "http://localhost:9400/rest/workload/v1/rules" -H "Content-Type:application/json" -d "[{\"ruleName\":\"rule1\",\"newRuleName\":\"rule2\", \"enabled\":\"true\", \"actionTypes\":[\"NOOP\"], \"ruleType\":\"ROW_LIMIT\", \"annotation\":\"Rule to limit rows\", \"maxRowCount\":\"10\", \"memberAssignments\":[{\"domainName\":\"composite\", \"memberName\":\"customuser\", \"group\":\"false\"}], \"resourceAssignments\":[{\"resourcePath\":\"/services/databases/foo/customers\", \"resourceType\":\"TABLE\"}] }]"
削除/rules
このAPIは、ワークロードルールを削除するために使用されます。
パラメーター:
なし
リクエスト本文
値の例-スキーマ
[
「文字列」
]
ワークロードルールを削除する例
curl -X DELETE -u admin:admin "http://localhost:9400/rest/workload/v1/rules" -H "Content-Type:application/json" -d "[\"rule1\", \"rule2\"]"
GET /rules/effective
このAPIは、リソースの効果的なルールを取得するために使用されます。
パラメーター:
名前 |
説明 |
パラメータータイプ |
データタイプ |
resourceIds |
リソースID |
query |
Array[integer] |
リソースの効果的なルールを取得する例
curl -X GET -u admin:admin "http://localhost:9400/rest/workload/v1/rules/effective?resourceIds=10128&resourceIds=10138"
GET /rules/effective/member
このAPIは、ユーザー/グループのワークロードルールを取得するために使用されます。
パラメーター:
名前 |
説明 |
パラメータータイプ |
データタイプ |
memberDomain |
ユーザーのドメイン。 |
query |
string |
memberName |
ユーザーの名前 |
query |
string |
サーバーに存在するすべてのワークロードルールを取得する例
curl -X GET -u admin:admin "http://localhost:9400/rest/workload/v1/rules/effective/member"
ユーザー「u1」の効果的なワークロードルールを取得する例
curl -X GET -u admin:admin "http://localhost:9400/rest/workload/v1/rules/effective/member?memberDomain=composite&memberName=u1"
GET /rules/effective/member/resource
このAPIは、指定されたリソースパスタイプのユーザー/グループの効果的なワークロードルールを取得するために使用されます。
パラメーター:
名前 |
説明 |
パラメータータイプ |
データタイプ |
memberDomain |
ユーザー/グループのドメイン名。 |
query |
string |
memberName |
ユーザー/グループの名前 |
query |
string |
resourcePath |
リソースパス |
query |
string |
resourceType |
リソースタイプ |
query |
string |
サーバーに存在するすべてのワークロードルールを取得する例
curl -X GET -u admin:admin "http://localhost:9400/rest/workload/v1/rules/effective/member/resource" -H "Content-Type:application/json" -d "[]"
指定されたリソースパスタイプのすべての有効なワークロードルールを取得する例
curl -X GET -u admin:admin "http://localhost:9400/rest/workload/v1/rules/effective/member/resource?memberDomain=composite&memberName=u1&resourcePath=/services/databases/foo/customers&resourceType=TABLE""