EclypseREST#

class eclypse.remote.communication.rest.interface.EclypseREST[source]#

Bases: EclypseCommunicationInterface

EclypseREST class.

It implements the REST communication interface among services in the same application, deployed within the same infrastructure.

It allows to send and receive HTTP requests at specific endpoints, which are defined by each service, using the @endpoint decorator.

Methods

__init__(service)

Initializes the REST interface.

connect()

Connects the REST interface to the service.

delete(url, **data)

Creates and handles a DELETE request.

disconnect()

Disconnects the REST interface from the service, clearing the endpoints.

get(url, **data)

Creates and handles a GET request.

post(url, **data)

Creates and handles a POST request.

put(url, **data)

Creates and handles a PUT request.

Attributes

__init__(service)[source]#

Initializes the REST interface.

Parameters:

service (Service) – The service that uses the REST interface.

connect()[source]#

Connects the REST interface to the service.

It registers the endpoints and their handlers.

disconnect()[source]#

Disconnects the REST interface from the service, clearing the endpoints.

get(url, **data)[source]#

Creates and handles a GET request.

Parameters:
  • url (str) – The URL of the request.

  • **data – The data to be sent in the request.

post(url, **data)[source]#

Creates and handles a POST request.

Parameters:
  • url (str) – The URL of the request.

  • **data – The data to be sent in the request.

put(url, **data)[source]#

Creates and handles a PUT request.

Parameters:
  • url (str) – The URL of the request.

  • **data – The data to be sent in the request.

delete(url, **data)[source]#

Creates and handles a DELETE request.

Parameters:
  • url (str) – The URL of the request.

  • **data – The data to be sent in the request.