This is the console /command interpreter for the Holberton Airbnb clone project. The console can be used to store objects in and retrieve objects using either a MySQL database, or a JSON file.
- BaseModel
- User
- State
- City
- Amenity
- Place
- Review
- create - create an object
- show - show an object (based on id)
- destroy - destroy an object
- all - show all objects, of one type or all types
- quit/EOF - quit the console
- help - see descriptions of commands
To start the console using JSON file storage, navigate to the project folder and enter ./console.py
in the shell.
To start the console using MySQL database as storage method, navigate to the project folder and enter:
HBNB_MYSQL_USER=<username> HBNB_MYSQL_PWD=<password HBNB_MYSQL_HOST=<server hostname> HBNB_MYSQL_DB=<database name> HBNB_TYPE_STORAGE=db ./console.py
create <class name> [<attr name>="<attr value>" ...]
Ex:
create BaseModel
create State name="California"
create State name="New_York"
show <class name> <object id>
Ex:
show User my_id
destroy <class name> <object id>
Ex:
destroy Place my_place_id
all
or all <class name>
Ex:
all
or all State
quit
or EOF
help
or help <command>
Ex:
help
or help quit
Additionally, the console supports <class name>.<command>(<parameters>)
syntax.
Ex:
City.show(my_city_id)
Cameron Eng [email protected]
Rui Feng [email protected]
Miranda Evans [email protected]
Kevin Yook [email protected]