CodeGuard

Developers

Backups

The Backup or Commit resource type represents an individual backup. A Backup belongs to a Website or Database.

Context

Requests to the Backup resource can only be made by authenticated users. Requests must include a valid OAuth signature and key. See the OAuth section in the Appendix for more information.

Attributes

The following are the attributes associated with the Backup resource. Whether they are required or optional is specified in the sections that follow.

commit_id

Unique SHA-1 hash used to identify the Backup resource in the CodeGuard application.

event_time

The time the backup process was started.

new_content

This boolean indicates whether new file or database content was detected during the backup process.

additions

The number of files or database rows added since the last backup.

modifications

The number of files modified since the last backup. This does not apply for Database resources.

deletions

The number of files or database rows deleted since the last backup.

List Backups

This method is used to list all of the backups for a Website or Database resource.

Website URI: /websites/<WEBSITE_ID>/commits

Database URI: /websites/<WEBSITE_ID>/database_backups/<DATABASE_ID>/commits

Method: GET

Required Attributes

The request will not succeed without these attributes.

None

Optional Attributes

None

Example Request
curl -v -H "Content-type: application/json" -H "Accept: application/json" -X GET 'https://api.codeguard.com/websites/287425/commits?oauth_consumer_key=u1xe85RrWhpJim3xslJb9GI9ENms6PmFjYDeTOgc&oauth_nonce=1234&oauth_signature=JxkBWtFneUDx02ArD1ZBR7NGmWs%3D&oauth_signature_method=HMAC-SHA1&oauth_timestamp=1307966160&oauth_token=qFFTIQszYZwHc4KmeZciyFjHT9XdcsRGrgkgwPQr&oauth_version=1.0'
        
Example Response

        [
            {
                "commit_id" : "87f3b9f036c71aebc49abff30f415e763dead8c2",
                "additions" : 0,
                "modifications" : 2,
                "deletions" : 0,
                "new_content" : true,
                "event_time" : "2014-02-27T12:06:09-05:00"
            },
            {
                "commit_id" : null,
                "additions" : 0,
                "modifications" : 0,
                "deletions" : 0,
                "new_content" : false,
                "event_time" : "2014-02-24T12:56:00-05:00"
            }
        ]