Orchestrator API๋ฅผ ์ฐ๋ ์ด์ ?
Orchestrator๋ Cloud ์น ํ๊ฒฝ์ด ์๊ตฌ์ฑ๋์ด ์๊ณ App๋ ๋ฐ๋ก ๊ตฌํ๋์ด ์์ด์ ์ฌ์ค ํ์ฌ ์ฌ์ฉํจ์ ์์ด์๋ ๋ถํธํจ์ด ์์ต๋๋ค. ํ์ง๋ง ์ ํ์ ์ธ ๊ธฐ๋ฅ์ ์ฃผ๊ฑฐ๋ ๊ด๋ฆฌ ์ธก๋ฉด์์ API๋ฅผ ์ฌ์ฉํ๋ฉด ๋ ์ ์ฉํ ๊ฒ์ด๋ฉฐ, ๋ API๋ฅผ ์ด์ฉํ์ฌ ๊ฐ๋ฐ์ ํ๋ค๋ฉด ๋ค๋ฅธ API๋ ๋ด๊ฐ ์ํ๋ ๊ธฐ๋ฅ์ ๋น ๋ฅด๊ฒ ์ ์ฉํ๊ณ ํ์ฉํ ์ ์๊ธฐ ๋๋ฌธ์ API๋ฅผ ์ด์ฉํด๋ดค์ต๋๋ค.
๋ณธ ํฌ์คํ ์ ์ธ์ฆ๋ถํฐ Robot ์คํ๊น์ง์ ๋ด์ฉ์ด ๋ด๊ฒจ์์ต๋๋ค.
Cloud ์๋ฒ์์ Orchestrator API๋ฅผ ์ฌ์ฉํ๋ ์ด์ ?
์๋ On-premiss ํํ์์ ๊ฐ๋ฐํด๋ณด๊ณ ์ถ์์ง๋ง ํ์ฌ On-premise๊ฐ ๋ง๋ฃ๋์ด์ Cloud ์๋ฒ๋ก ์คํํ์์ต๋๋ค. ์ธ์ฆ๋ถ๋ถ ๋นผ๊ณ ๋๋จธ์ง ๋ถ๋ถ์ด ๊ฐ๊ธฐ ๋๋ฌธ์ ์ธ์ฆ ๋ถ๋ถ๋ง ๋ฐ๊ฟ์ฃผ๋ฉด ์ด๋์๋ ์ฌ์ฉ๊ฐ๋ฅํฉ๋๋ค.
์์
POST
Auth - ๊ณ์ ์ธ์ฆGET
Account Logical Name - ๊ณ์ ์ด๋ฆ ๊ฐ์ ธ์ค๊ธฐGET
serviceInstanceLogicalName - ์๋น์ค๋ช ๊ฐ์ ธ์ค๊ธฐGET
Process Key - ํ๋ก์ธ์ค Key ๊ฐ์ ธ์ค๊ธฐPOST
Robot - ๋ก๋ด์คํํ๊ธฐ
๋ก๋ด์ ์คํํ๊ธฐ ๊น์ง ๊ฐ์ ธ์์ผํ ๋ฐ์ดํฐ๊ฐ ๋ง์ต๋๋ค. ์ธ์ฆ์ token์ 24์๊ฐ ์ ์ง ๋ฉ๋๋ค. ์ฌ์ฉ์ ์ ์ธ์ฆ key๋ฅผ ์๋ก ๋ฐ๊ธ ๋ฐ๋๋ค๋ฉด ์ธ์ฆ์๊ฐ์ ํฌ๊ฒ ์ ๊ฒฝ ์์จ๋ ๋ ๊ฑฐ ๊ฐ์์. (๋ณด์์ ์๊ฐํ๋ค๋ฉด ์ธ์ฆ์ ๋ฐ๊ธํ์ฌ ์ฌ์ฉํ๊ณ ๋ฐ๋ก ์ง์ฐ๋๊ฒ ์ ์ผ ์ข์๊ฑฐ ๊ฐ์ต๋๋ค. ๊ทผ๋ฐ ๋ค๋ฅธ์ฌ๋๊ณผ ๊ฐ์ด ์ฌ์ฉํ๋ค๋ฉด transaction ๋ถ๋ถ๋ ์๊ฐํด์ค์ผ๊ฒ ๋ค์ฌ.)
UiPath Doc์์๋ Postman์ ์ฌ์ฉํ๋๊ฑฐ ๊ฐ์ต๋๋ค.
(์ ๋ API ํ
์คํธ ํ ๋ Postman ์จ์๋๋ฐ insomnia๋ฅผ ์ฐ๊ณ ๋์๋ insomnia๋ง ์ฐ๊ฒ ๋๋ค์)
์ํผ API๋ง ๋ณด๋ด๋ฉด ๋๊ธฐ ๋๋ฌธ์ postman, curl, insomnia ์๋ฌด๊ฑฐ๋ ์๊ด์์ต๋๋ค.
1. Auth - ๊ณ์ ์ธ์ฆ (Cloud ํ๊ฒฝ์์์ ์ธ์ฆ)
- cloud๋ ์ธ์ฆ๋ถ๋ถ์ base url์ด ๋ค๋ฆ
POST /oauth/token HTTP/1.1
Accept: application/json
Host: account.uipath.com/
Content-Type: apllication/json
Reqeust
{
"grant_type":"refresh_token",
"client_id":"",
"refresh_token":""
}
Response
{
"access_token": "xxxxxxxxxxxxxxxxxxxxx",
"id_token": "xxxxxxxxxxx",
"scope": "openid profile email offline_access",
"expires_in": 86400,
"token_type": "Bearer"
}
access_token๊ณผ id_token ํ๋
2. Account Logical Name - ๊ณ์ ์ด๋ฆ ๊ฐ์ ธ์ค๊ธฐ
- access_token์ผ๋ก request ์ ์ก
GET /cloudrpa/api/getAccountsForUser HTTP/1.1
Accept: application/json
Host: platform.uipath.com/
Content-Type: apllication/json
Authorization : Bearer
Response
{
"userEmail": "labft3231@gmail.com",
"accounts": [
{
"accountName": "xxx",
"accountLogicalName": "xx"
},
{
"accountName": "xx",
"accountLogicalName": "xxx"
}
]
}
accountLogicalName ํ๋
3. serviceInstanceLogicalName - ์๋น์ค ์ด๋ฆ ๊ฐ์ ธ์ค๊ธฐ
- accountLogicalName์ผ๋ก request ์ ์ก
GET /cloudrpa/api/account//getAllServiceInstances HTTP/1.1
Accept: application/json
Host: platform.uipath.com/
Content-Type: apllication/json
Authorization : Bearer
Response
{
[
{
"serviceInstanceName": "xx",
"serviceInstanceLogicalName": "xxx",
"serviceType": "xxx",
"serviceUrl": "xxx",
"serviceState": "ENABLED",
"userRolesInService": [
"Administrator"
]
},
]
}
serviceInstanceLogicalName ํ๋
4. Process Key - ํ๋ก์ธ์ค Key ๊ฐ์ ธ์ค๊ธฐ
- Process key ๊ฐ์ ธ์ค๊ธฐ
https://platform.uipath.com/
GET ///odata/Releases HTTP/1.1
Accept: application/json
Host: platform.uipath.com/
Content-Type: apllication/json
Authorization : Bearer
Response
{
"@odata.context": "https://platform.uipath.com/xxxx/xxxxxxx/odata/$metadata#Releases",
"@odata.count": 9,
"value": [
{
"Key": "xxxxx-xx-xx-xx-xxxxxxx",
"ProcessKey": "xxxxxxx",
"ProcessVersion": "1.0.3",
"IsLatestVersion": false,
"IsProcessDeleted": false,
"Description": "",
"Name": "xx_xxxxx",
"EnvironmentId": xxxx,
"EnvironmentName": "xxxxx-xx",
"InputArguments": null,
"ProcessType": "Process",
"SupportsMultipleEntryPoints": false,
"RequiresUserInteraction": true,
"AutoUpdate": false,
"_FeedId": "00000000-0000-0000-0000-000000000000",
"JobPriority": "Normal",
"Id": xxx,
"Arguments": {
"Input": null,
"Output": null
},
"ProcessSettings": null
},
...
...
}
Process Key ํ๋
5. Robot - ๋ก๋ด์คํํ๊ธฐ
- Process key๋ก ๋ก๋ด ์คํ
GET ///odata/Jobs/UiPath.Server.Configuration.OData.StartJobs HTTP/1.1
Accept: application/json
Host: platform.uipath.com/
Content-Type: apllication/json
Authorization : Bearer
X-UIPATH-TenantName :
X-UIPATH-OrganizationUnitId :
Request
{
"startInfo": {
"ReleaseKey": ,
"Strategy": "All",
"RobotIds": [],
"NoOfRobots": 0
}
}
Response
{
"@odata.context": "https://platform.uipath.com/xxxx/xxxx/odata/$metadata#Jobs",
"value": [
{
"Key": "xxx-xx-xxx-xx-xxxxx",
"StartTime": null,
"EndTime": null,
"State": "Pending",
"JobPriority": "Normal",
"Source": "Manual",
"SourceType": "Manual",
"BatchExecutionKey": "xx-xx-xxx-xx-xxxxx",
"Info": null,
"CreationTime": "2020-xx-xxTxx:49:37.9692211Z",
"StartingScheduleId": null,
"ReleaseName": "xxxx-xxxxxx",
"Type": "Unattended",
"InputArguments": null,
"OutputArguments": null,
"HostMachineName": "xx-xxxxxx",
"HasMediaRecorded": false,
"PersistenceId": null,
"ResumeVersion": null,
"StopStrategy": null,
"RuntimeType": null,
"RequiresUserInteraction": true,
"ReleaseVersionId": null,
"EntryPointPath": null,
"Id": xxxx
}
]
}
์คํํ Key ์ ๋ ฅํ์ฌ์ ์ ์ก์ ์คํ๋ฉ๋๋ค.
๊ฒฐ๋ก
ํ์ฌ ํฌ์คํ
์์๋ Robot ํ๋ก์ธ์ค ์คํ์ ๋ํด ๋ค๋ฃจ์์ง๋ง ๊ธฐํ orchestrator์์ ์ฌ์ฉ๋๋ ๋ค๋ฅธ API๋ ๋ง๋ค์ ์์ต๋๋ค.
๋ ๋ค์ํ API๋ ์๋์ ์ฃผ์๋ฅผ ์ฐธ๊ณ ํ์๋ฉด ๋๊ฒ ์ต๋๋ค.
https://docs.uipath.com/orchestrator/reference/authenticating
-
Previous
๐ฌ RPA ์๋ํ, UiPath๋ก Slack ๋ฉ์ธ์ง ์ ์กํ๊ธฐ -
Next
๐ค UiPath Data ์กฐ์ํ๊ธฐ