## Methods

destroy()
getKey()

getList(callback)
getMeta(callback)

getPicture(pictureID, callback)

## Abstract types

getListCallback(err, items)

getMetaCallback(err, data)

getPictureCallback(err, pictureID, dataUrl)

## new _CameraArchive()

Camera archive.
May not be directly instanced. An instance of the class is created by the method HomeServerConnector._Connection#getCameraArchive.

### Example

    var ca = conn.getCameraArchive("CA@MyCameraArchive", function(err, data) {});

## Methods

### destroy()

Enables the object and cancels any existing subscription.

#### Example

    ca.destroy();

### getKey() → String

Returns the key of the object.

#### Example

    var object_key = ca.getKey();

Returns

  `String`

### getList(callback)

Retrieves a list of the images in the camera archive. The time stamp and image ID are returned for each image.

#### Example

Retrieval of the image list.

    ca.getList(function(err, items) {});

#### Parameter

Name | Type | Optional | Description
--- | --- | --- | ---
callback | function() |  | HomeServerConnector._CameraArchive~getListCallback

### getMeta(callback)

Retrieves the metadata.

#### Example

Retrieval of metadata.

    ca.getMeta(function(err, data) {});

#### Parameter

Name | Type | Optional | Description
--- | --- | --- | ---
callback | function() |  | HomeServerConnector._CameraArchive~getMetaCallback

### getPicture(pictureID, callback)

Retrieves an image from the archive based on the IMAGE ID.

#### Example

Retrieval of an image.

    ca.getPicture(123, function(err, pictureId, dataUrl) {});

#### Parameters

Name | Type | Optional | Description
--- | --- | --- | ---
pictureID | Number |  | Unique ID of the image. The method getList() returns all possible IDs.
callback | function() |  | HomeServerConnector._CameraArchive~getPictureCallback

## Abstract types

inner

### getListCallback(err, items)

#### Example

Retrieval of the image list.

    ca.getList(function(err, items) {});

#### Parameters

Name | Type | Optional | Description
--- | --- | --- | ---
err | (Object or undefined) |  | Error object
items | Array |  | List with the images of the camera archive. Each entry contains the following fields: #### Structure
    [
       {
          "ts":     Number,
          "pic_id": Number
       }
    ]
#### Explanation ts - Unix time stamp (in seconds, milliseconds as a decimal value) of the entry. pic_id - ID of the image. Is required for retrieval using getPicture().

inner

### getMetaCallback(err, data)

#### Example

Retrieval of metadata.

    ca.getMeta(function(err, data) {});

#### Parameters

Name | Type | Optional | Description
--- | --- | --- | ---
err | (Object or undefined) |  | Error object
data | Object |  | Meta information #### Structure
    {
      "keys":          Array of String,
      "caption":       String,
      "description":   String,
      "tags":          Array of String,
      "size":          Number,
      "size_in_bytes": Number,
      "space":         Number,

      "stat": {
          "first":     Number,
          "last":      Number,
          "count":     Number
      }
    }
#### Explanation keys - List with keys (e.g.: ["CA:7", "CA@MyCameraArchive"]). Contains at least one number. caption - Designation of the object. description - Description of the object. tags - List of tags (e.g.: ["Yard", "Garden"]). size - Size of ring buffer. size_in_bytes - Max. size of archive in bytes. space - Size of archived images in bytes. stat - Object, contains information about the content of the archive. first - Unix time stamp (in seconds, milliseconds as a decimal value) of the oldest entry in the archive. last - Unix time stamp (in seconds, milliseconds as a decimal value) of the youngest entry in the archive. count - Number of entries in the archive.

inner

### getPictureCallback(err, pictureID, dataUrl)

#### Example

Retrieval of an image.

    ca.getPicture(123, function(err, pictureId, dataUrl) {});

#### Parameters

Name | Type | Optional | Description
--- | --- | --- | ---
err | (Object or undefined) |  | Error object
pictureID | String |  | Image ID
dataUrl | String |  | A string in the data URL format. For description and format see: Data-URL Wiki-Page.