Skip to main content

A command to manage eve and mongo locally

Project description

Cloudmesh Rest ============== Prerequistis ————- * mongo instalation * eve instalation * cloudmesh cmd5 * cloudmesh rest Install Mongo on OSX ^^^^^^^^^^^^^^^^^^^^ :: brew update brew install mongodb # brew install mongodb –with-openssl Install Mongo on OSX ^^^^^^^^^^^^^^^^^^^^ ASSIGNMET TO STUDENTS, PROVIDE PULL REQUEST WITH INSTRUCTIONS Introduction ———— With the cloudmesh REST framework it is easy to create REST services while defining the resources in the service easily with examples. The service is based on eve and the examples are defined in yml to be converted to json and from json with evegenie into a valid eve settings file. Thus oyou can eother wite your examples in yaml or in json. The resources are individually specified in a directory. The directory can contain multiple resource files. We recomment that for each resource you define your own file. Conversion of the specifications can be achieved with the schema command. Yaml Specification —————— Let us first introduce you to a yaml specification. Let us assume that your yaml file is called profile.yaml and located in a directory called example:: profile: description: The Profile of a user email: laszewski@gmail.com firstname: Gregor lastname: von Laszewski username: gregor As eve takes json objects as default we need to convert it first to json. This is achieved wih:: cd example cms schema convert profile.yml profile.json This will provide the json file profile.json as Listed in the next section Json Specification —————— A valid json resource specification looks like this:: { “profile”: { “description”: “The Profile of a user”, “email”: “laszewski@gmail.com”, “firstname”: “Gregor”, “lastname”: “von Laszewski”, “username”: “gregor” } } Conversion to Eve Settings ————————– The json files in the ~/sample directory need now to be converted to a valid eve schema. This is achieved with tow commands. First, we must concatenate all json specified resource examples into a single json file. We do this with:: cms schema cat . all.json As we assume you are in the samples directory, we use a . for the current location of the directory that containes the samples. Next, we need to convert it to the settings file. THis can be achieved with the convert program when you specify a json file:: cms schema convert all.json THe result will be a eve configuration file that you can use to start an eve service. The file is called all.settings.py Managing Mongo ^^^^^^^^^^^^^^ Next you need to start the mongo service with :: cms admin mongo start You can look at the status and information about the service with :: cms admin mongo info cms admin mongo status If you need to stop the service you can use:: cms admin mongo stop Manageing Eve ^^^^^^^^^^^^^ Now it is time to start the REST service. THis is done in a separate window with the following commands:: cms admin settings all.settings.json cms admin rest start The first command coppies the settings file to ~/cloudmesh/eve/settings.py This file is than used by the start action to start the eve service. Please make sure that you execute this command in a separate window, as for debugging purposses you will be able to monitor this way interactions with this service Testing - OLD ^^^^^^^ :: make setup # install mongo and eve make install # installs the code and integrates it into cmd5 make deploy make test

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Built Distribution

cloudmesh.rest-1.0.7-py2.py3-none-any.whl (14.3 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file cloudmesh.rest-1.0.7.macosx-10.12-x86_64.tar.gz.

File metadata

File hashes

Hashes for cloudmesh.rest-1.0.7.macosx-10.12-x86_64.tar.gz
Algorithm Hash digest
SHA256 25b642d74297d4d256867c7415b7907cc49f5fa10a05e83cd62c0e73a89c2d60
MD5 f90dca4bed89171869a06e781fcfe07b
BLAKE2b-256 ab688341f4807928f10d518ef7b01b70058fa9ca9344c7543494d91b2be3be63

See more details on using hashes here.

File details

Details for the file cloudmesh.rest-1.0.7-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for cloudmesh.rest-1.0.7-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 63f73bb05fb419eb293e17d24b75ca27843f6356be0ba021c2cee18fd289d664
MD5 0198c47d011d4fa433a5c1eeecb22ad3
BLAKE2b-256 25d3237c229679ffc2584b8c673c4262ec0709d2c9e0bb96ea5519c7107d42c0

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page