# rule.py

`GET` `/rules`

  get rule information for given rule id.

  Example request:

      GET /rules HTTP/1.1

  Example response:

      HTTP/1.1 200 OK
      Vary: Accept
      Content-Type: 'application/json'

  Status Codes: | 404 Not Found – ‘RuleNotFound’: e.args[0][0] 500 Internal Server Error – e.__class__.__name__: e.args[0]

`PUT` `/rules`

  > Update the replication rules locked flag .

  Example request:

      PUT /rules HTTP/1.1

  Example response:

      HTTP/1.1 200 OK
      Vary: Accept
      Content-Type:

  Status Codes: | 401 Unauthorized – ‘AccessDenied’: e.args[0][0] 404 Not Found – ‘RuleNotFound’: e.args[0][0] 404 Not Found – ‘AccountNotFound’: e.args[0][0] 400 Bad Request – ‘ValueError’: ‘Cannot decode json parameter list’ 500 Internal Server Error – e.__class__.__name__: e.args[0][0]

`POST` `/rules`

  > Create a new replication rule.

  Example request:

      POST /rules HTTP/1.1

  Example response:

      HTTP/1.1 200 OK
      Vary: Accept
      Content-Type:

  Status Codes: | 400 Bad Request – ‘ValueError’: ‘Cannot decode json parameter list’ 409 Conflict – ‘InvalidReplicationRule’: e.args[0][0] 409 Conflict – ‘DuplicateRule’: e.args[0] 409 Conflict – ‘InsufficientTargetRSEs’: e.args[0][0] 409 Conflict – ‘InsufficientAccountLimit’: e.args[0][0] 409 Conflict – ‘InvalidRSEExpression’: e.args[0][0] 404 Not Found – ‘DataIdentifierNotFound’: e.args[0][0] 409 Conflict – ‘ReplicationRuleCreationTemporaryFailed’: e.args[0][0] 409 Conflict – ‘InvalidRuleWeight’: e.args[0][0] 409 Conflict – ‘StagingAreaRuleRequiresLifetime’: e.args[0] 409 Conflict – ‘InvalidObject’: e.args[0] 500 Internal Server Error – e.__class__.__name__: e.args[0][0]

`DELETE` `/rules`

  > Delete a new replication rule.

  Example request:

      DELETE /rules HTTP/1.1

  Example response:

      HTTP/1.1 200 OK
      Vary: Accept
      Content-Type:

  Status Codes: | 400 Bad Request – ‘ValueError’: ‘Cannot decode json parameter list’ 401 Unauthorized – ‘AccessDenied’: e.args[0][0] 404 Not Found – ‘RuleNotFound’: e.args[0][0]

`GET` `/rules`

  get locks for a given rule_id.

  Example request:

      GET /rules HTTP/1.1

  Example response:

      HTTP/1.1 200 OK
      Vary: Accept
      Content-Type: 'application/x-json-stream'

  Status Codes: | 500 Internal Server Error – e.__class__.__name__: e.args[0]