| 23 | === Rest API example calls === |
| 24 | |
| 25 | The Rest API documentation can be found at https://hbpacc.zam.kfa-juelich.de/hpcmanagement/v1/doc. You can use the Swagger UI to generate all REST API calls. Here are some example calls on this REST API: |
| 26 | |
| 27 | Examples: |
| 28 | |
| 29 | ==== Projects ==== |
| 30 | - get |
| 31 | {{{ |
| 32 | https://hbpacc.zam.kfa-juelich.de/hpcmanagement/v1/projects |
| 33 | }}} |
| 34 | |
| 35 | - add new project |
| 36 | {{{ |
| 37 | curl -X POST --header 'Content-Type: application/json' --header 'Accept: text/html' 'https://hbpacc.zam.kfa-juelich.de/hpcmanagement/v1/projects?projectname=bp045678' |
| 38 | }}} |
| 39 | |
| 40 | - get project details |
| 41 | {{{ |
| 42 | https://hbpacc.zam.kfa-juelich.de/hpcmanagement/v1/projects/bp045678 |
| 43 | }}} |
| 44 | |
| 45 | - add accounts to project |
| 46 | {{{ |
| 47 | curl -X POST --header 'Content-Type: application/json' --header 'Accept: text/html' 'https://hbpacc.zam.kfa-juelich.de/hpcmanagement/v1/projects/bp045678/accounts?bp0ID=bp000005' |
| 48 | }}} |
| 49 | |
| 50 | - get accounts of project |
| 51 | {{{ |
| 52 | https://hbpacc.zam.kfa-juelich.de/hpcmanagement/v1/projects/bp045678/accounts |
| 53 | }}} |
| 54 | |
| 55 | - remove account from project |
| 56 | {{{ |
| 57 | curl -X DELETE --header 'Accept: text/html' 'https://hbpacc.zam.kfa-juelich.de/hpcmanagement/v1/projects/bp045678/accounts/bp000005' |
| 58 | }}} |
| 59 | |
| 60 | - add project to system |
| 61 | {{{ |
| 62 | curl -X POST --header 'Content-Type: application/json' --header 'Accept: text/html' 'https://hbpacc.zam.kfa-juelich.de/hpcmanagement/v1/projects/bp045678/systems?system=juqueen' |
| 63 | }}} |
| 64 | |
| 65 | - delete project |
| 66 | {{{ |
| 67 | curl -X DELETE --header 'Accept: text/html' 'https://hbpacc.zam.kfa-juelich.de/hpcmanagement/v1/projects/bp045678' |
| 68 | }}} |
| 69 | |
| 70 | ==== Accounts ==== |
| 71 | - get account list |
| 72 | {{{ |
| 73 | https://hbpacc.zam.kfa-juelich.de/hpcmanagement/v1/accounts |
| 74 | https://hbpacc.zam.kfa-juelich.de/hpcmanagement/v1/accounts?filter=cn%3D*Karbach* |
| 75 | https://hbpacc.zam.kfa-juelich.de/hpcmanagement/v1/accounts?filter=uid%3D*5 |
| 76 | }}} |
| 77 | - create account for project |
| 78 | {{{ |
| 79 | curl -X POST --header 'Content-Type: application/json' --header 'Accept: text/html' 'https://hbpacc.zam.kfa-juelich.de/hpcmanagement/v1/accounts?oidcid=244515&action=create&project=bp02' |
| 80 | }}} |
| 81 | - get account details |
| 82 | {{{ |
| 83 | https://hbpacc.zam.kfa-juelich.de/hpcmanagement/v1/accounts/bp000003 |
| 84 | }}} |
| 85 | - add account to project |
| 86 | {{{ |
| 87 | curl -X POST --header 'Content-Type: application/json' --header 'Accept: text/html' 'https://hbpacc.zam.kfa-juelich.de/hpcmanagement/v1/projects/bp000001/accounts?bp0ID=bp000004' |
| 88 | }}} |
| 89 | - delete account from project |
| 90 | {{{ |
| 91 | curl -X DELETE --header 'Accept: text/html' 'https://hbpacc.zam.kfa-juelich.de/hpcmanagement/v1/projects/bp000001/accounts/bp000004' |
| 92 | }}} |
| 93 | |
| 94 | ==== People ==== |
| 95 | |
| 96 | - get all stored OIDC IDs |
| 97 | {{{ |
| 98 | https://hbpacc.zam.kfa-juelich.de/hpcmanagement/v1/people |
| 99 | }}} |
| 100 | |
| 101 | - get filtered by mail |
| 102 | {{{ |
| 103 | https://hbpacc.zam.kfa-juelich.de/hpcmanagement/v1/people?filter=mail%3D*karbach* |
| 104 | }}} |
| 105 | |
| 106 | - get person details |
| 107 | {{{ |
| 108 | https://hbpacc.zam.kfa-juelich.de/hpcmanagement/v1/people/244515 |
| 109 | }}} |
| 110 | |
| 111 | - find person entries from OIDC server |
| 112 | {{{ |
| 113 | https://hbpacc.zam.kfa-juelich.de/hpcmanagement/v1/people/oidc?filter=sn%3DOrth |
| 114 | }}} |
| 115 | |
| 116 | - import person entry from OIDC |
| 117 | {{{ |
| 118 | curl -X POST --header 'Content-Type: application/json' --header 'Accept: text/html' 'https://hbpacc.zam.kfa-juelich.de/hpcmanagement/v1/people?oidcid=255622' |
| 119 | }}} |
| 120 | |
| 121 | - update attributes for person |
| 122 | {{{ |
| 123 | curl -X PATCH --header 'Content-Type: application/json' --header 'Accept: text/html' 'https://hbpacc.zam.kfa-juelich.de/hpcmanagement/v1/people/255622?attribute=postaladdress&action=add&value=Forschungszentrum%20Juelich%20GmbH%3BWilhelm-Johnen-Strasse%3B%3B52428%3BJuelich%3BGermany' |
| 124 | }}} |
| 125 | |
| 126 | - delete person and all connected accounts |
| 127 | {{{ |
| 128 | curl -X DELETE --header 'Accept: text/html' 'https://hbpacc.zam.kfa-juelich.de/hpcmanagement/v1/people/255622' |
| 129 | }}} |
| 130 | |
| 131 | |