Prepare a job config file as described here, for example, exampleJob.json
.
HTTP POST your username and password to get an access token from:
http://restserver/api/v1/token
For example, with curl, you can execute below command line:
curl -H "Content-Type: application/x-www-form-urlencoded" \
-X POST http://restserver/api/v1/token \
-d "username=YOUR_USERNAME" -d "password=YOUR_PASSWORD"
HTTP GET the redirect URL of Azure AD for authentication:
http://restserver/api/v1/authn/oidc/login
HTTP POST the token from AAD (AccessToken, IDToken, RefreshToken) to get OpenPAI's access token. Web-browser will call this API automatically after the step I.
HTTP://restserver/api/v1/authn/oidc/return
HTTP GET the redirect URL of Azure AD to sign out the authentication:
http://restserver/api/v1/authn/oidc/logout
HTTP POST the config file as json with access token in header to:
http://restserver/api/v1/user/:username/jobs
For example, you can execute below command line:
curl -H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-X POST http://restserver/api/v1/user/:username/jobs \
-d @exampleJob.json
Check the list of jobs at:
http://restserver/api/v1/jobs
or
http://restserver/api/v1/user/:username/jobs
Check your exampleJob status at:
http://restserver/api/v1/user/:username/jobs/exampleJob
Get the job config JSON content:
http://restserver/api/v1/user/:username/jobs/exampleJob/config
Get the job's SSH info:
http://restserver/api/v1/user/:username/jobs/exampleJob/ssh
Configure the rest server port in services-configuration.yaml.
Please visit ReDoc to view RESTful API details.
Since Framework ACL is enabled since this version, jobs will have a namespace with job-creater's username. However there were still some jobs created before the version upgrade, which has no namespaces. They are called "legacy jobs", which can be retrieved, stopped, but cannot be created. To figure out them, there is a "legacy: true" field of them in list apis.
In the next versions, all operations of legacy jobs may be disabled, so please re-create them as namespaced job as soon as possible.