forked from docs/doc-exports
Reviewed-by: Pruthi, Vineet <vineet.pruthi@t-systems.com> Co-authored-by: Wuwan, Qi <wuwanqi1@noreply.gitea.eco.tsi-dev.otc-service.com> Co-committed-by: Wuwan, Qi <wuwanqi1@noreply.gitea.eco.tsi-dev.otc-service.com>
83 lines
12 KiB
HTML
83 lines
12 KiB
HTML
<a name="EN-US_TOPIC_0000001402185790"></a><a name="EN-US_TOPIC_0000001402185790"></a>
|
|
|
|
<h1 class="topictitle1">Managing ModelArts Authorization</h1>
|
|
<div id="body0000001121150486"><p id="EN-US_TOPIC_0000001402185790__p7401580272">This section describes how to manage agency authorization by calling ModelArts APIs.</p>
|
|
<div class="section" id="EN-US_TOPIC_0000001402185790__section1584656102611"><h4 class="sectiontitle">Overview</h4><p id="EN-US_TOPIC_0000001402185790__p6171183914104">The process of managing ModelArts authorization is as follows:</p>
|
|
<ol id="EN-US_TOPIC_0000001402185790__ol51731432121217"><li id="EN-US_TOPIC_0000001402185790__li15913193817196">, which will be added in a request header for authentication.</li><li id="EN-US_TOPIC_0000001402185790__li6173123211219">Call the API for <a href="CreateModelArtsAgency.html">creating a ModelArts agency</a> to create an agency for ModelArts-dependent services, such as OBS and SWR.</li><li id="EN-US_TOPIC_0000001402185790__li11901135831418">Call the API for <a href="CreateAuthorization.html">configuring authorization</a> to configure ModelArts authorization. The administrator can use this API to set an agency for IAM users and set the access key of the current user.<div class="note" id="EN-US_TOPIC_0000001402185790__note1488674683311"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="EN-US_TOPIC_0000001402185790__p178861746133316">ModelArts functions, such as data management, training management, development environment, and real-time services, can be used only after being authorized.</p>
|
|
</div></div>
|
|
</li><li id="EN-US_TOPIC_0000001402185790__li33722031111515">Call the API for <a href="GetAuthorizations.html">obtaining the authorization list</a> to view the authorization.</li><li id="EN-US_TOPIC_0000001402185790__li62310211161">Call the API for <a href="DeleteAuthorizations.html">deleting authorization</a> to delete the authorization of a specified user or all users.</li></ol>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001402185790__section8774173316262"><h4 class="sectiontitle">Prerequisites</h4><ul id="EN-US_TOPIC_0000001402185790__ul1645122742017"><li id="EN-US_TOPIC_0000001402185790__en-us_topic_0000001121150482_li1054032119297">You have obtained the .</li><li id="EN-US_TOPIC_0000001402185790__en-us_topic_0000001121150482_li178815407564">The following information is available: region where ModelArts is deployed, <a href="modelarts_03_0147.html">project name and ID</a>, <a href="modelarts_03_0148.html">account name and ID</a>, and <a href="modelarts_03_0006.html">username and ID</a>.</li></ul>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0000001402185790__section18521459111613"><h4 class="sectiontitle">Procedure</h4><ol id="EN-US_TOPIC_0000001402185790__ol17536101715260"><li id="EN-US_TOPIC_0000001402185790__li18535142116290">Call the API for <a href="CreateModelArtsAgency.html">creating a ModelArts agency</a> to create an agency for ModelArts-dependent services, such as OBS, SWR, and IEF.<ol type="a" id="EN-US_TOPIC_0000001402185790__ol650610528715"><li id="EN-US_TOPIC_0000001402185790__li050614529717">Request body:<p id="EN-US_TOPIC_0000001402185790__p10690193044319"><a name="EN-US_TOPIC_0000001402185790__li050614529717"></a><a name="li050614529717"></a>URI: POST https://<em id="EN-US_TOPIC_0000001402185790__i1886757594">{endpoint}</em>/v2/<em id="EN-US_TOPIC_0000001402185790__i15954103106">{project_id}</em>/agency</p>
|
|
<div class="p" id="EN-US_TOPIC_0000001402185790__p52671814154315">Request header:<ul id="EN-US_TOPIC_0000001402185790__ul1527191819430"><li id="EN-US_TOPIC_0000001402185790__li102771884319">X-auth-Token →<em id="EN-US_TOPIC_0000001402185790__i2074319437540">MIIZmgYJKoZIhvcNAQcCoIIZizCCGYcCAQExDTALBglghkgBZQMEAgEwgXXXXXX...</em></li><li id="EN-US_TOPIC_0000001402185790__li152771824311">Content-Type →application/json</li></ul>
|
|
</div>
|
|
<p id="EN-US_TOPIC_0000001402185790__p124311310546">Request body:</p>
|
|
<pre class="screen" id="EN-US_TOPIC_0000001402185790__screen10893816165410">{
|
|
"agency_name_suffix" : "<em id="EN-US_TOPIC_0000001402185790__i038318011114">iam-user01</em>"
|
|
}</pre>
|
|
<div class="p" id="EN-US_TOPIC_0000001402185790__p15935045514">Set the italic parameters based on site requirements.<ul id="EN-US_TOPIC_0000001402185790__ul593170155518"><li id="EN-US_TOPIC_0000001402185790__li179315014550"><em id="EN-US_TOPIC_0000001402185790__i1374185114137">endpoint</em>: ModelArts endpoint</li><li id="EN-US_TOPIC_0000001402185790__li1993809553"><em id="EN-US_TOPIC_0000001402185790__i1737412191414">project_id</em>: Your project ID</li><li id="EN-US_TOPIC_0000001402185790__li194170155520"><span class="parmname" id="EN-US_TOPIC_0000001402185790__parmname8385143419118"><b>X-auth-Token</b></span>: Token obtained in the previous step</li><li id="EN-US_TOPIC_0000001402185790__li7167141191117"><span class="parmname" id="EN-US_TOPIC_0000001402185790__parmname17899417191212"><b>agency_name_suffix</b></span>: Customized suffix of the agency name</li></ul>
|
|
</div>
|
|
</li><li id="EN-US_TOPIC_0000001402185790__li105084521376">Response body with status code <span class="parmvalue" id="EN-US_TOPIC_0000001402185790__parmvalue493812991217"><b>200 OK</b></span> returned (indicating that <span class="parmvalue" id="EN-US_TOPIC_0000001402185790__parmvalue98291535243"><b>ma_agency_iam-user01</b></span> has been created):<pre class="screen" id="EN-US_TOPIC_0000001402185790__screen1172139162116">{
|
|
"agency_name": "ma_agency_iam-user01"
|
|
}</pre>
|
|
</li></ol>
|
|
</li><li id="EN-US_TOPIC_0000001402185790__li1793443912335">Call the API for <a href="CreateAuthorization.html">configuring authorization</a> to configure ModelArts authorization. The administrator can use this API to set an agency for IAM users and set the access key of the current user.<ol type="a" id="EN-US_TOPIC_0000001402185790__ol15049401515"><li id="EN-US_TOPIC_0000001402185790__li18355738813">Request body:<p id="EN-US_TOPIC_0000001402185790__p13776527115517"><a name="EN-US_TOPIC_0000001402185790__li18355738813"></a><a name="li18355738813"></a>URI: POST https://<em id="EN-US_TOPIC_0000001402185790__i10144122731415">{endpoint}</em>/v2/<em id="EN-US_TOPIC_0000001402185790__i5921123061419">{project_id}</em>/authorizations</p>
|
|
<div class="p" id="EN-US_TOPIC_0000001402185790__p7899125313146">Request header:<ul id="EN-US_TOPIC_0000001402185790__ul1389935321411"><li id="EN-US_TOPIC_0000001402185790__li128991153151418">X-auth-Token →<em id="EN-US_TOPIC_0000001402185790__i1489975320149">MIIZmgYJKoZIhvcNAQcCoIIZizCCGYcCAQExDTALBglghkgBZQMEAgEwgXXXXXX...</em></li><li id="EN-US_TOPIC_0000001402185790__li11899135341417">Content-Type →application/json</li></ul>
|
|
</div>
|
|
<div class="p" id="EN-US_TOPIC_0000001402185790__p759951113169">Request body:<pre class="screen" id="EN-US_TOPIC_0000001402185790__screen688272312156">{
|
|
"user_id": "<em id="EN-US_TOPIC_0000001402185790__i588193011525">****af917080f5d21f55c018ba19****</em>",
|
|
"type": "agency",
|
|
"content": "ma_agency_iam-user01"
|
|
}</pre>
|
|
</div>
|
|
<p id="EN-US_TOPIC_0000001402185790__p12840161703119">Set the italic parameters based on site requirements. Set <span class="parmname" id="EN-US_TOPIC_0000001402185790__parmname1512174714212"><b>user_id</b></span> to the IAM user ID and <span class="parmname" id="EN-US_TOPIC_0000001402185790__parmname751374702114"><b>content</b></span> to the ModelArts agency created in the previous step.</p>
|
|
</li><li id="EN-US_TOPIC_0000001402185790__li13666204915115">Response body with status code <span class="parmvalue" id="EN-US_TOPIC_0000001402185790__parmvalue5836244131710"><b>200 OK</b></span> returned (indicating that the authorization configuration is complete):<pre class="screen" id="EN-US_TOPIC_0000001402185790__screen20325171784317">{
|
|
"result": true
|
|
}</pre>
|
|
</li></ol>
|
|
</li><li id="EN-US_TOPIC_0000001402185790__li6820184616018">Call the API for <a href="GetAuthorizations.html">obtaining the authorization list</a> to view the authorization.<ol type="a" id="EN-US_TOPIC_0000001402185790__ol62263412810"><li id="EN-US_TOPIC_0000001402185790__li695423811814">Request body:<p id="EN-US_TOPIC_0000001402185790__p923873819511"><a name="EN-US_TOPIC_0000001402185790__li695423811814"></a><a name="li695423811814"></a>URI: GET https://<em id="EN-US_TOPIC_0000001402185790__i13545241395">{endpoint}</em>/v2/<em id="EN-US_TOPIC_0000001402185790__i12545149913">{project_id}</em>/authorizations</p>
|
|
<p id="EN-US_TOPIC_0000001402185790__p98361011104220">Request header: X-auth-Token →<em id="EN-US_TOPIC_0000001402185790__i592153016291">MIIZmgYJKoZIhvcNAQcCoIIZizCCGYcCAQExDTALBglghkgBZQMEAgEwgXXXXXX...</em></p>
|
|
<p id="EN-US_TOPIC_0000001402185790__p228223773119">Set the italic parameters based on site requirements.</p>
|
|
</li><li id="EN-US_TOPIC_0000001402185790__li1259615515912">Response body with status code <span class="parmvalue" id="EN-US_TOPIC_0000001402185790__parmvalue165721615181918"><b>200 OK</b></span> returned:<pre class="screen" id="EN-US_TOPIC_0000001402185790__screen55041929111011">{
|
|
"auth": [
|
|
{
|
|
"create_time": 1622804433221,
|
|
"user_id": "all-users",
|
|
"user_name": "all-users",
|
|
"type": "agency",
|
|
"content": "modelarts_agency"
|
|
},
|
|
{
|
|
"create_time": 1625457065365,
|
|
"user_id": "<strong id="EN-US_TOPIC_0000001402185790__b02001939145315">****af917080f5d21f55c018ba19****</strong>",
|
|
"user_name": null,
|
|
"type": "agency",
|
|
"content": "<strong id="EN-US_TOPIC_0000001402185790__b75881142125311">ma_agency_iam-user01</strong>"
|
|
}
|
|
],
|
|
"total_count": 2
|
|
}</pre>
|
|
<p id="EN-US_TOPIC_0000001402185790__p364510972614">Obtain the authorization information based on the response.</p>
|
|
</li></ol>
|
|
</li><li id="EN-US_TOPIC_0000001402185790__li995518261044">Call the API for <a href="DeleteAuthorizations.html">deleting authorization</a> to delete the authorization of a specified user or all users.<ol type="a" id="EN-US_TOPIC_0000001402185790__ol142018238111"><li id="EN-US_TOPIC_0000001402185790__li184842051119">Request body:<p id="EN-US_TOPIC_0000001402185790__p198661134243"><a name="EN-US_TOPIC_0000001402185790__li184842051119"></a><a name="li184842051119"></a>URI: DELETE https://<em id="EN-US_TOPIC_0000001402185790__i151154562814">{endpoint}</em>/v2/<em id="EN-US_TOPIC_0000001402185790__i127181648192818">{project_id}</em>/authorizations?user_id=<em id="EN-US_TOPIC_0000001402185790__i20348191713295">****d80fb058844ae8b82aa66d9fe****</em></p>
|
|
<p id="EN-US_TOPIC_0000001402185790__p19207184416817">Request header: X-auth-Token →<em id="EN-US_TOPIC_0000001402185790__i1320719442082">MIIZmgYJKoZIhvcNAQcCoIIZizCCGYcCAQExDTALBglghkgBZQMEAgEwgXXXXXX...</em></p>
|
|
<p id="EN-US_TOPIC_0000001402185790__p2028191213513">Set the italic parameters based on site requirements. Set <em id="EN-US_TOPIC_0000001402185790__i41291926202219">****d80fb058844ae8b82aa66d9fe****</em> to the IAM user ID of the specified user.</p>
|
|
</li><li id="EN-US_TOPIC_0000001402185790__li137415307114">Response body with status code <span class="parmvalue" id="EN-US_TOPIC_0000001402185790__parmvalue325522972013"><b>200 OK</b></span> returned (indicating that the authorization has been deleted):<pre class="screen" id="EN-US_TOPIC_0000001402185790__screen4155921118">{
|
|
"result": true
|
|
}</pre>
|
|
</li><li id="EN-US_TOPIC_0000001402185790__li433133719461">If **user_id** is set to **all-users**, the authorization of all IAM users will be deleted. Response body with status code <strong id="EN-US_TOPIC_0000001402185790__b935901012244">200 OK</strong> returned (indicating that the authorization has been deleted):<pre class="screen" id="EN-US_TOPIC_0000001402185790__screen20290549192512">{
|
|
"result": true,
|
|
"success_message": "Delete all-users auth info successfully!"
|
|
}</pre>
|
|
</li></ol>
|
|
</li></ol>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="modelarts_03_0400.html">Use Cases</a></div>
|
|
</div>
|
|
</div>
|
|
|