Websites

The Website resource type represents a website backup within the CodeGuard application. A website belongs to a User.

Context

Requests to the Website 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 Website resource. Whether they are required or optional is specified in the sections that follow.

id

Unique numeric ID used to identify the website resource in the CodeGuard application.

url

The URL parameter should contain the address of the website to be baked up. For example: www.myblog.com.

hostname

The server address that hosts the content of the website to be backed up. This can be a fully qualified domain name or IP address.

account

The username CodeGuard will use to authenticate with the host specified as hostname.

password

The password associated with the account provided. Note: You must provide either a key or a password, not both.

key

The key data to use for server authentication. Note: You must provide either a key or a password, not both. Keys are only supported for SFTP.

provider

This is the protocol to be used to connect to the host specified as hostname. Acceptable values for this field are ftp or sftp.

port

The port to be used to connect to the host specified as hostname.

monitor_frequency

An integer value representing the frequency that the website backup will be attempted.

0 : Never

1 : Daily

3 : Weekly

owner_id

The numeric ID that represents which User in the CodeGuard application owns the website. Note: This parameter is for information purposes only and can not be modified via the API.

activated

A boolean indication of whether or not the initial backup has been completed. Note: This parameter is for information purposes only and can not be modified via the API.

notifications_enabled

A boolean value representing the preference for receiving email notifications related to this website backup.

container_size

The size in bytes of the website backup and any associated database backups stored in the CodeGuard system.

dir_path

The dir_path is the starting point for a backup and should correspond to the document root of the website. Only files and folders inside of this path will be backed up. The format of this parameter is a string. For example: '/home/username/www'.

disabled

Indicates whether or not the backup is enabled. Disabled resources will not be scheduled for backups.

Example Response

{
"status" : "success"
}

Request Full Restore

This method will initiate a full restore for a Website. During this process the selected backup, specified as COMMIT_ID, will be compared against the live website. All necessary modifications will be made to return the running website to the state captured in the specified backup.

The desired backup and corresponding COMMIT_ID can be located using the List Backups request.

Example Response

{
"status" : "success"
}

Request Selective Restore

This method will initiate a restore of the specified files and directories for a Website. During this process the selected backup, specified as COMMIT_ID, will be used as the source of the selected content. The individual file and directory paths should be specified as a string of comma delimited paths. Directories must end with a trailing slash. For example: /path/to/directory/ and not /path/to/directory

The desired backup and corresponding COMMIT_ID can be located using the List Backups request.

Example Response

{
"status" : "success"
}

Request Full Zip Download

This method will initiate the production of a zip file which contains the entire contents of the selected backup. During this process the selected backup, specified as COMMIT_ID, will be packaged as a single zip file and stored in Amazon S3. Upon completion, a perishable link will be provided to the customer so that they can retrieve the zip file. By default, these links expire after 1 week.

The desired backup and corresponding COMMIT_ID can be located using the List Backups request.

Example Response

{
"status" : "success"
}

Request Selective Zip Download

This method will initiate the production of a zip file which contains the specified files and directories. During this process the selected backup, specified as COMMIT_ID, will be used as the source of the selected content, packaged as a single zip file and stored in Amazon S3. Upon completion, a perishable link will be provided to the customer so that they can retrieve the zip file. By default, these links expire after 1 week.

The individual file and directory paths should be specified as a string of comma delimited paths. Directories must end with a trailing slash. For example: /path/to/directory/ and not /path/to/directory

The desired backup and corresponding COMMIT_ID can be located using the List Backups request.

Example Response

{
"status" : "success"
}

Browse Backup Content

This interface allows clients to browse the content of a particular backup. The response includes files, directories and their associated metadata as an array of entries. The requests can be scoped to an optional path parameter. If a path is not specified, the content of the root folder will be returned. During this process the selected backup, specified as COMMIT_ID, will be used as the source of the content.

The desired backup and corresponding COMMIT_ID can be located using the List Backups request.

List DB Restore Points

Given a Website record and an associated backup, specified as COMMIT_ID, this interface will return a list of Database restore points that most closely match the level of content in the specified website backup.

The response will provide a DATABASE_ID keyed dictionary of associated Database records including the database_name. If they are available to restore, the Databasecommit_id will be included along with the backup_time timestamp for that particular backup. If the database is not available to restore, an error_message will be provided instead of the commit_id and backup_time.

The desired Website backup and corresponding COMMIT_ID can be located using the List Backups request.