Heeft deze informatie u geholpen?
Hoe kunnen we dit artikel nog verbeteren?
If the permission is associated with a service account, you cannot delete that permission. Also, once you delete permission, you cannot restore it.
Performing a Delete permission operation removes existing permissions from the database.
DELETE /permissions/{permissionId}
Name | In | Type | Required | Description |
---|---|---|---|---|
permissionId | path | string | true | Numeric ID of the permission to delete. |
package main import ( "bytes" "net/http" ) func main() { headers := map[string][]string{ "Accept": []string{ "text/plain", }, "Authorization": []string{ "Bearer {access-token}", }, } jsonReq := "{json request body}" // replace with your JSON request body data := bytes.NewBuffer([]byte(jsonReq)) req, err := http.NewRequest("DELETE", "https://api.lyvecloud.seagate.com/v2/permissions/{PermissionId}", data) if err != nil { // handle error } req.Header = headers client := &http.Client{} resp, err := client.Do(req) if err != nil { // handle error } // handle response }
try { URL obj = new URL("https://api.lyvecloud.seagate.com/v2/permissions/{PermissionId}"); HttpURLConnection con = (HttpURLConnection) obj.openConnection(); con.setRequestMethod("DELETE"); int responseCode = con.getResponseCode(); System.out.println("Response Code : " + responseCode); BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream())); String inputLine; StringBuffer response = new StringBuffer(); while ((inputLine = in.readLine()) != null) { response.append(inputLine); } in.close(); System.out.println(response.toString()); } catch (Exception e) { e.printStackTrace(); }
const headers = { 'Accept': 'text/plain', 'Authorization': 'Bearer {access-token}' }; fetch('https://api.lyvecloud.seagate.com/v2/permissions/{PermissionId}', { method: 'DELETE', headers: headers }) .then(response => { if (!response.ok) { throw new Error('Network response was not ok'); } return response.json(); }) .then(body => { console.log(body); }) .catch(error => { console.error('There has been a problem with your fetch operation:', error); });
import requests headers = { 'Accept': 'text/plain', 'Authorization': 'Bearer {access-token}' } try: r = requests.delete('https://api.lyvecloud.seagate.com/v2/permissions/{PermissionId}', headers=headers) r.raise_for_status() # Raises a HTTPError if the response status is 4xx, 5xx except requests.exceptions.RequestException as err: print(f"An error occurred: {err}") else: print(r.json())
require 'rest-client' require 'json' headers = { 'Accept' => 'text/plain', 'Authorization' => 'Bearer {access-token}' } result = RestClient.delete 'https://api.lyvecloud.seagate.com/v2/permissions/{PermissionId}', params: {}, headers: headers puts JSON.parse(result)
Status Code | Description | Returned JSON payload | ||||||
---|---|---|---|---|---|---|---|---|
200 | OK The delete operation is successful. |
Permission deleted successfully. | ||||||
400 | Bad request | { "code": "string", "message": "string" }
|
||||||
403 | Forbidden The account has no services enabled. |
{ "code": "string", "message": "string" }
|
||||||
404 | Not Found The permission to be deleted is not found. |
{ "code": "string", "message": "string" }
|
||||||
409 | Conflict The permission is not ready for deletion operation and is still being processed by some regions. |
{ "code": "string", "message": "string" }
|
||||||
500 | The server has encountered an internal error | { "code": "string", "message": "string" }
|
||||||
503 | Service Unavailable | { "code": "string", "message": "string" }
|