# replica.py

`GET` `/replicas/<scope>/<name>/?$`

  > List all replicas for data identifiers.

  Example request:

      GET /replicas/<scope>/<name>/?$ HTTP/1.1

  Example response:

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

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

`POST` `/replicas/?$/?$/(.+)/(.+)/?$`

  > Create file replicas at a given RSE.

  Example request:

      POST /replicas/?$/?$/(.+)/(.+)/?$ 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] 409 Conflict – ‘Duplicate’: e[0][0] 409 Conflict – ‘DataIdentifierAlreadyExists’: e[0][0] 404 Not Found – ‘RSENotFound’: e[0][0] 503 Service Unavailable – ‘ResourceTemporaryUnavailable’: e[0][0] 500 Internal Server Error – e.__class__.__name__: e.args[0][0]

`PUT` `/replicas/?$/?$/(.+)/(.+)/?$`

  > Update a file replicas state at a given RSE.

  Example request:

      PUT /replicas/?$/?$/(.+)/(.+)/?$ 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] 500 Internal Server Error – ‘UnsupportedOperation’: e.args[0][0] 500 Internal Server Error – e.__class__.__name__: e.args[0][0]

`DELETE` `/replicas/?$/?$/(.+)/(.+)/?$`

  > Delete file replicas at a given RSE.

  Example request:

      DELETE /replicas/?$/?$/(.+)/(.+)/?$ 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 – ‘RSENotFound’: e[0][0] 503 Service Unavailable – ‘ResourceTemporaryUnavailable’: e[0][0] 404 Not Found – ‘ReplicaNotFound’: e.args[0][0] 500 Internal Server Error – e.__class__.__name__: e.args[0][0]

`POST` `/replicas/list/?$/list/?$`

  > List all replicas for data identifiers.

  Example request:

      POST /replicas/list/?$/list/?$ HTTP/1.1

  Example response:

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

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

`POST` `/replicas/getdidsfromreplicas/?$/getdidsfromreplicas/?$`

  > List the DIDs associated to a list of replicas.

  Example request:

      POST /replicas/getdidsfromreplicas/?$/getdidsfromreplicas/?$ HTTP/1.1

  Example response:

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

  Status Codes: | 400 Bad Request – ‘ValueError’: ‘Cannot decode json parameter list’ 500 Internal Server Error – e.__class__.__name__: e.args[0][0]

`POST` `/replicas/badreplicas/?$/badreplicas/?$`

  > Declare a list of bad replicas.

  Example request:

      POST /replicas/badreplicas/?$/badreplicas/?$ HTTP/1.1

  Example response:

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

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