ebook img

Artisan Infrastructure OBS Storage API PDF

42 Pages·2014·0.16 MB·English
by  
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview Artisan Infrastructure OBS Storage API

Artisan Infrastructure OBS Storage API Artisan Infrastructure OBS User API User API Document URL - api/user/createuser Description: Creates users in portal. The REST API uses JSON format. (http://www.json.org) Type - POST Request Parameters: Parameter Name Datatype Purpose Title String Tile field while registering. First_name String First name of user. Last_Name String Last name of user. Password String Password for account. Company String Company name of user. Email String Valid email address of the user. Username String Username of the account. Phone Number Valid phone number of the user. Partner_uid String Valid Salesforce UID for the partner. Partner_alias String Valid Salesforce alias for the partner. Alternate_id String ID for external reference. Response Format: For successful execution following response will be returned: {"isSuccess":true,"response": {"username":"api.dev.test","password":"test.api123",”access_key”:” 0000-00000000-5332f783-9f01-f72cb816”, “secret_key”:” 0000-00000000-5332f783-9f03-28db387e”} ,"Error":"","errorCode":0} In case of error, one of following error code will be mentioned in errorCode response parameter: Error Code Name of Exception Description 100 KEY_VALUE_MISSING_EXCEPTION. This code will be returned when any of the key from request parameter is missing from request json. 101 EMAIL_ALREADY_USED Error code to indicate email address sent in request json is already been used. 102 USERNAME_IS_PRESENT Error code to indicate username sent in request json is already used. 103 INVALID_PARTNER_UID_ALIAS Error code to indicate Partner alias and uid sent in request json is invalid. 104 INTERNAL_SERVER_ERROR Indicates internal server error. In case of error following would be sample JSON: {"isSuccess":false,"response":””, "Error":"Partner uid does not match","errorCode":103} User create through won’t be able to login thorough portal. All the users which are created through API will be activated automatically. URL - /api/user/updateuser Description – Update user information. Type - POST Request Parameters: Editable column defines if that field can be changed through update user API. Parameter Name Datatype Purpose Editable(true/false) Title String Tile field while registering. t First_name String First name of user. t Last_Name String Last name of user. t Password String Password for account. t Company String Company name of user. t Email String Valid email address of the t user. Username String Username of the account. false Phone Number Valid phone number of the t user. Partner_uid String Valid Salesforce UID for the t partner. Partner_alias String Valid Salesforce alias for the t partner. Alternate_id String ID for external reference. false ls_admin True/False True if this user is to be t assigned as admin user for partner. False to remove user as admin. Access_key String Access key which will be t generated while creating user account. Please not down access key returned in create user response. Secret_key String Secret key which will be t generated while creating user account. Please not down key returned in create user response. Response Format: For successful execution following response will be returned: {"isSuccess":true, "response":{"title":"engineering","first_name":"test","password":"test111","company":"test","last_name":"test","email":"api.dev.test@t est.com","username":"chiragjog","phone":"123456789","partner_uid":"02304143","partner_alias":"CLO","alternate_id":"123","is_ad min":false}, "Error":"","errorCode":0} In case of error, one of following error code will be mentioned in errorCode response parameter: Error Code Name of Exception Description 100 KEY_VALUE_MISSING_EXCEPTION. This code will be returned when any of the key from request parameter is missing from request json. 101 EMAIL_ALREADY_USED Error code to indicate email address sent in request json is already been used. 102 USERNAME_IS_PRESENT Error code to indicate username sent in request json is already used. 103 INVALID_PARTNER_UID_ALIAS Error code to indicate Partner alias and uid sent in request json is invalid. 104 INTERNAL_SERVER_ERROR Indicates internal server error. 108 ACCESS_OR_SECRET_KEY_DOES_ Indicates access key or secret key NOT_MATCH passed does not match with keys have in databases. In case of error following would be sample JSON: {"isSuccess":false,"response":””, "Error":"Partner uid does not match","errorCode":103} /api/user/getallusers Description – Retrieves all users. There are two versions of this call. One version will allow user to retrieve users which he/she is admin. And in other version only artisan admin can retrieve user accounts from the system. Type – POST Request Parameters: Version 1: Following request parameter is for super user. {“username”:”test”,”access_key”:” 0000-00000000-5332f783-9f03-28db387e”,”secret_key”:” 0000-00000000-5332f783-9f03-28db387e”} Version2: Following request parameter is for artisan admin user. {“username”:”administrator”,”password”:”password” } Response Parameters: After successful execution array of users will be returned. Response for both the versions is same. Following JSON shows the sample response: {"isSuccess":true, "response":[{"title":"engineering","first_name":"test","company":"test","last_name":"test","email":"[email protected]","username": "chiragjog","phone":"123456789","partner_uid":"02304143","partner_alias":"CLO","alternate_id":"123","is_admin":false}],[],[],.. "Error":"","errorCode":0} In case of error, one of following error code will be mentioned in errorCode response parameter: Error Code Name of Exception Description 104 INTERNAL_SERVER_ERROR Indicates internal server error. 108 ACCESS_OR_SECRET_KEY_DOES_ This will indicate access key or secret NOT_MATCH key does not match. This error code will only be returned for version 1 of this api. In case of error following would be sample JSON: {"isSuccess":false,"response":””, "Error":"Something went wrong. Please contact administrator.","errorCode":104} /api/user/getpasswordkey Description – Retrieves password key for user. Type – POST Request Parameters: Parameter Name Datatype Purpose Username String Username field while registering. Password String Password for the user. Access_key String Access key for the user. Secret_key String Secret key for the user. Response Format: For successful execution following response will be returned: {"isSuccess":true,"response":{"password":"testtest"},"Error":"","errorCode":0} In case of error, one of following error code will be mentioned in errorCode response parameter: Error Code Name of Exception Description 100 KEY_VALUE_MISSING_EXCEPTION. This code will be returned when any of the key from request parameter is missing from request json. 105 USER_DOES_NOT_EXIST Error code indicates user with given username does not exist. 104 INTERNAL_SERVER_ERROR Indicates internal server error. 108 ACCESS_SECRET_KEY_DOES_NOT_ Access or secret key does not match. MATCH In case of error following would be sample JSON: {"isSuccess":false,"response":””, "Error":"Invalid username","errorCode":105} /api/user/setstatus Description – enable/disable user account. Type – POST Request Parameters: Parameter Name Datatype Purpose Username String Username field while registering. Password String Password for the user. Status String Only following two values are allowed: Enable – To enable user Disable – To Disable user. Access_key String Access key for the user account. Secret_key String Secret key for the user account. Response Format: For successful execution following response will be returned: {"isSuccess":true,"response":"Status for user chiragjog changed successfully","Error":"","errorCode":0} In case of error, one of following error code will be mentioned in errorCode response parameter: Error Code Name of Exception Description 100 KEY_VALUE_MISSING_EXCEPTION. This code will be returned when any of the key from request parameter is missing from request json. 105 USER_DOES_NOT_EXIST Error code indicates user with given username does not exist. 104 INTERNAL_SERVER_ERROR Indicates internal server error. 108 ACCESS_SECRET_KEY_DOES_NOT_ Access or secret key does not match. MATCH In case of error following would be sample JSON: {"isSuccess":false,"response":””, "Error":"Invalid username or password","errorCode":105} /api/user/getuser Description – Retrieves information about user. Type – POST Request Parameters: Parameter Name Datatype Purpose Username String Username field while registering. Password String Password for the user. Access_key String Access key for the user. Secret_key String Secret key for the user. Response Format: For successful execution following response will be retuned: {"isSuccess":true,"response":[{"username":"johndoe","password":null,"title":"engineering","first_name":"john","last_name":"doe","co mpany":"Clog","email":"[email protected]","phone":"123456789","partner_uid":"02304143","partner_alias":"CLO","alternate_id ":"123456","is_admin":false}],"Error":"","errorCode":0} In case of error, one of following error code will be mentioned in errorCode response parameter: Error Code Name of Exception Description 100 KEY_VALUE_MISSING_EXCEPTION. This code will be returned when any of the key from request parameter is missing from request json. 105 USER_DOES_NOT_EXIST Error code indicates user with given username does not exist. 104 INTERNAL_SERVER_ERROR Indicates internal server error. 108 ACCESS_SECRET_KEY_DOES_NOT_ Access or secret key does not match. MATCH In case of error following would be sample JSON: {"isSuccess":false,"response":””, "Error":"Invalid username or password","errorCode":105} Api/user/getapikeys Description – Retrieves user api keys. Type – POST Request Parameters: Parameter Name Datatype Purpose Username String Username field while registering. Password String Password for the user. Response Format: For successful execution following response will be returned: {"isSuccess":true,"response":{"access_key":"0000-00000000-5332f92e-3ecd-aae6dc81","secret_key":"0000-00000000-5332f92e-3 ecf-50d52c9e"},"Error":"","errorCode":0} In case of error, one of following error code will be mentioned in errorCode response parameter: Error Code Name of Exception Description 107 USERNAME_OR_PASSWORD_DOES Indicates username or password does _NOT_MATCH not match. 108 ACCESS_OR_SECRET_KEY_DOES_ This will indicate access key or secret NOT_MATCH key does not match. This error code will only be returned for version 1 of this api. In case of error following would be sample JSON: {"isSuccess":false,"response":"","Error":"Username or password does not match.","errorCode":107} DELETE Bucket DELETE Bucket Deletes a named bucket. All objects must be deleted from the bucket before the bucket itself can be deleted. Request syntax DELETE / HTTP/1.1 Host: BucketName.au-rs2-3.vpdcstorage.com Date: date Authorization: signatureValue Request headers You can use the following request headers with the DELETE Bucket operation: Authorization, Content-Length, Content-Type, Date, and Host. The Authorization, Date, and Host headers are required; the others are optional. For more information, see Request Headers. Response headers Response headers in a DELETE Bucket operation may include: Content-Length, Connection, Date, ETag, and Server. For more information, see Response Headers. Examples Request sample DELETE / HTTP/1.1 Host: BucketName.au-rs2-3.vpdcstorage.com Date: Tue, 21 Jun 2011 12:12:34 GMT Authorization: AWS pat:BAupPCpkyeIGKH2s5Je4Bc32bc= Response sample HTTP/1.1 204 No Content Date: Tue, 21 Jun 2011 12:12:34 GMT Server: RestServer/1.0 Content-Length: 0 Content-Type: application/octet-stream Cache-Control: no-cache Connection: close See also RS2+API DELETE Object DELETE Bucket website DELETE Bucket website Deletes the website configuration for a bucket, and returns an HTML 200 OK message when the configuration is successfully deleted. This functionality is available in build 31676 and later. Deleting the website configuration does not delete the bucket, which remains accessible through its REST API endpoint. Request syntax DELETE /?website HTTP/1.1 Host: BucketName.au-rs2-3.vpdcstorage.com Date: date Authorization: signatureValue Request headers The DELETE Bucket website operation accepts the following request headers: Authorization, Content-Length, Content-MD5, Content-Type, Date, Expect, Host, and x-amz-date. The Authorization, Date, and Host headers are required; the others are optional. For more information, see Request Headers. Response headers The DELETE Bucket website operation may include the following response headers: Content-Length, Connection, Date, ETag, and Server. For more information, see Response Headers. Examples Request sample DELETE /documentation/?website HTTP/1.1 Host: BucketName.au-rs2-3.vpdcstorage.com Date: Thu, 16 Jun 2011 15:46:10 GMT Authorization: AWS pat:/nkzkbitg6LW/p0IxMSaJie4ELc= Response sample HTTP/1.1 200 OK Date: Thu, 16 Jun 2011 15:46:10 GMT See also RS2+API GET Bucket website PUT Bucket website DELETE Object DELETE Object Permanently removes an object from its bucket. Request syntax DELETE /ObjectName HTTP/1.1 Host: BucketName.au-rs2-3.vpdcstorage.com Date: date Content-Length: length Authorization: signatureValue Request headers You can use the following request headers with the DELETE operation: Authorization, Content-Length, Content-Type, Date, and Host. The Authorization, Date, and Host headers are required; the others are optional. For more information, see Request Headers. Response headers Response headers in a DELETE operation may include: Content-Length, Connection, Date, ETag, and Server. For more information, see Response Headers. Examples Request sample This sample deletes the hosts object from the docs bucket: DELETE /hosts HTTP/1.1 Host: BucketName.au-rs2-3.vpdcstorage.com Accept-Encoding: identity..content-length: 0 Authorization: AWS pat:0CgY8llGvG2ROfyZjlUS0H538WI= Date: Tue, 21 Jun 2011 12:27:54 GMT Response sample HTTP/1.1 204 No Content Date: Tue, 21 Jun 2011 12:27:54 GMT Server: RestServer/1.0 Content-Length: 0 Content-Type: application/octet-stream Cache-Control: no-cache Connection: close See also RS2+API DELETE Bucket DELETE Bucket GET Bucket (List Objects) GET Bucket (List Objects) Returns a list of objects in a bucket. To use this operation, you must have READ permission to the bucket that you specify. By default, the number of objects in the list returned by the GET Bucket operation is limited to 1000, but you can change this default with the max-keys parameter. You can use other parameters to specify objects to include and to filter out objects that you do not want to include in the list. Use the GET Service operation to obtain the list of buckets that you own. Request syntax GET / HTTP/1.1 Host: BucketName.au-rs2-3.vpdcstorage.com Date: date Authorization: signatureValue Request parameters The GET Bucket operation can use the following optional parameters: delimiter (String) - Groups all keys from the start of a listing until the delimiter string is encountered. Use with the prefix p arameter, to group all keys that contain the prefix string before the delimiter string is encountered. The grouping is listed in the GET Bucket response under the CommonPrefixes element only. marker (String) - Specifies the first key to include in the object listing for the bucket. max-keys (String) - Limits the number of keys included in the list. Default is 1000. The IsTruncated element returns true if the search criteria results for the request exceed the value set for the max-keys parameter. prefix (String) - Specifies a string that must be present at the beginning of a key in order for the key to be included in the GET Bucket response list. Request headers You can use the following request headers with the GET Bucket (List Objects) operation: Authorization, Content-Length, Content-Type, Date, and Host. The Authorization, Date, and Host headers are required; the others are optional. For more information, see Request Headers. Response headers Response headers in a GET Bucket (List Objects) operation may include: Content-Length, Connection, Date, ETag, and Server. For more information, see Response Headers. Response elements The GET Bucket (List Objects) operation can return the following items (item datatypes in parentheses):

Description:
Artisan Infrastructure OBS User API. User API Document. URL - api/user/createuser. Description: Creates users in portal. The REST API uses JSON
See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.