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
Release history Release notifications | RSS feed
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
File details
Details for the file cloudmesh.rest-1.0.6.macosx-10.12-x86_64.tar.gz
.
File metadata
- Download URL: cloudmesh.rest-1.0.6.macosx-10.12-x86_64.tar.gz
- Upload date:
- Size: 15.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a665229d6f4898126803471302e3e96381cb45bb1e8987e5bb2e7ee31a667961 |
|
MD5 | c4d088e2078948e619be09db4f3fffd6 |
|
BLAKE2b-256 | d0f6e055b42ea152ca5934745567699ba749eb1503aa938c7422db70c049cdf1 |
File details
Details for the file cloudmesh.rest-1.0.6-py2.py3-none-any.whl
.
File metadata
- Download URL: cloudmesh.rest-1.0.6-py2.py3-none-any.whl
- Upload date:
- Size: 14.3 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4592d656285ca5fc86bd70b8a2fd181385012037a368c1c0601e496e74bd8eff |
|
MD5 | 278d6303658bd9714897bb88e0465ff9 |
|
BLAKE2b-256 | 3352e6046dd61229a8c5b6d984612c949c8a871a096d1007a5cbed38cddf2241 |