Skip to content

Commit 014cb96

Browse files
authored
Merge pull request #2 from MZC-CSC/main
platform install and execution with mc-admin-cli. call rest api via mc-admin-cli as a utility function
2 parents b09595f + 82e3766 commit 014cb96

40 files changed

Lines changed: 2447 additions & 808 deletions

README.md

Lines changed: 82 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# M-CMP ADMIN CLI (mcc)
22
This repository provides a Multi-Cloud ADMIN CLI.
33
The name of this tool is mcc(Multi-Cloud admin CLI).
4-
A sub-system of [M-CMP platform](https://github.com/m-cmp/docs/tree/main) to deploy and manage Multi-Cloud Infrastructures.
4+
A sub-system of [M-CMP platform](https://github.com/m-cmp) to deploy and manage Multi-Cloud Infrastructures.
55

66

77
```
@@ -14,9 +14,9 @@ If you have any difficulties in using mcc, please let us know.
1414
```
1515

1616
## mcc 개요
17-
- M-CMP 시스템의 설치, 실행, 상태정보 제공, 종료, API 호출 등을 지원하는 관리 도구 입니다.
17+
- M-CMP 시스템의 설치, 실행, 상태정보 제공, 종료, API 호출 등을 지원하는 관리 도구입니다.
1818
- 현재는 Docker Compose 모드 방식만 제공합니다.
19-
- [Docker Compose 모드](docs/mcc-docker-compose-mode.md)
19+
- [Docker Compose 모드](./docs/mcc-docker-compose-mode.md)
2020

2121
## Install Docker & Docker Compose V2
2222
- [Install Docker Engine on Ubuntu](https://docs.docker.com/engine/install/ubuntu/)
@@ -35,75 +35,116 @@ mc-admin-cli/src$ go get -u
3535
mc-admin-cli/src$ go build -o mcc
3636
```
3737

38-
# Commands to use the mcc
38+
# How to use the mcc
3939

40-
## Help
4140
```
42-
mc-admin-cli/src$ ./mcc
41+
mc-admin-cli/bin$ ./mcc -h
4342
4443
The mcc is a tool to operate Cloud-Barista system.
4544
46-
For example, you can setup and run, stop, and ... Cloud-Barista runtimes.
47-
48-
- ./mcc pull [-f ../docker-compose-mode-files/docker-compose.yaml]
49-
- ./mcc run [-f ../docker-compose-mode-files/docker-compose.yaml]
50-
- ./mcc info
51-
- ./mcc stop [-f ../docker-compose-mode-files/docker-compose.yaml]
52-
- ./mcc remove [-f ../docker-compose-mode-files/docker-compose.yaml] -v -i
53-
5445
Usage:
5546
mcc [command]
5647
5748
Available Commands:
49+
docker A tool to operate M-CMP system
5850
help Help about any command
59-
info Get information of Cloud-Barista System
60-
pull Pull images of Cloud-Barista System containers
61-
remove Stop and Remove Cloud-Barista System
62-
run Setup and Run Cloud-Barista System
63-
stop Stop Cloud-Barista System
51+
rest rest api call
6452
6553
Flags:
66-
--config string config file (default is $HOME/.mcc.yaml)
67-
-h, --help help for mcc
68-
-t, --toggle Help message for toggle
54+
-h, --help help for mcc
6955
7056
Use "mcc [command] --help" for more information about a command.
7157
```
7258

73-
## Run
59+
60+
## docker-compose.yaml
61+
```
62+
The necessary service information for the M-CMP System configuration is defined in the mc-admin-cli/docker-compose-mode-files/docker-compose.yaml file.(By default, it is set to build the desired configuration and data volume in the docker-compose-mode-files folder.)
63+
64+
If you want to change the information for each container you want to deploy, modify the mc-admin-cli/docker-compose-mode-files/docker-compose.yaml file or use the -f option.
7465
```
75-
mc-admin-cli/src$ ./mcc run -h
7666

77-
Setup and Run Cloud-Barista System
67+
## docker subcommand
68+
For more information, check out [the docker subcommand document.](./docs/mc-admin-cli-docker-compose-mode.md)
69+
70+
```
71+
For now, it supports docker's run/stop/info/pull/remove commands.
72+
73+
Use the -h option at the end of the sub-command requiring assistance, or executing 'mcc' without any options will display the help manual.
74+
7875
7976
Usage:
80-
mcc run [flags]
77+
mcc docker [flags]
78+
mcc docker [command]
79+
80+
Available Commands:
81+
info Get information of M-CMP System
82+
pull Pull images of M-CMP System containers
83+
remove Stop and Remove M-CMP System
84+
run Setup and Run M-CMP System
85+
stop Stop M-CMP System
8186
8287
Flags:
83-
-f, --file string Path to Cloud-Barista Docker-compose file (default "*.yaml")
84-
-h, --help help for run
88+
-h, --help help for docker
89+
90+
Use "mcc docker [command] --help" for more information about a command.
91+
```
8592

86-
Global Flags:
87-
--config string config file (default is $HOME/.mcc.yaml)
93+
## docker subcommand examples
94+
Simple usage examples for docker subcommand
8895
```
96+
./mcc docker pull [-f ../docker-compose-mode-files/docker-compose.yaml]
97+
./mcc docker run [-f ../docker-compose-mode-files/docker-compose.yaml]
98+
./mcc docker info
99+
./mcc docker stop [-f ../docker-compose-mode-files/docker-compose.yaml]
100+
./mcc docker remove [-f ../docker-compose-mode-files/docker-compose.yaml] -v -i
89101
90-
## Stop
91102
```
92-
mc-admin-cli/src$ ./mcc stop -h
103+
## k8s subcommand
104+
K8S is not currently supported and will be supported in the near future.
105+
106+
## rest subcommand
107+
The rest subcommands are developed around the basic features of REST to make it easy to use the open APIs of M-CMP-related frameworks from the CLI.
108+
For now, it supports get/post/delete/put/patch commands.
109+
110+
For more information, check out [the rest subcommand document.](./docs/mc-admin-cli-rest.md)
93111

94-
Stop Cloud-Barista System
112+
```
113+
rest api call
95114
96115
Usage:
97-
mcc stop [flags]
116+
mcc rest [flags]
117+
mcc rest [command]
98118
99-
Flags:
100-
-f, --file string Path to Cloud-Barista Docker-compose file (default "*.yaml")
101-
-h, --help help for stop
119+
Available Commands:
120+
delete REST API calls with DELETE methods
121+
get REST API calls with GET methods
122+
patch REST API calls with PATCH methods
123+
post REST API calls with POST methods
124+
put REST API calls with PUT methods
102125
103-
Global Flags:
104-
--config string config file (default is $HOME/.mccvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv.yaml)
126+
Flags:
127+
--authScheme string sets the auth scheme type in the HTTP request.(Exam. OAuth)(The default auth scheme is Bearer)
128+
--authToken string sets the auth token of the 'Authorization' header for all HTTP requests.(The default auth scheme is 'Bearer')
129+
-d, --data string Data to send to the server
130+
-f, --file string Data to send to the server from file
131+
-I, --head Show response headers only
132+
-H, --header strings Pass custom header(s) to server
133+
-h, --help help for rest
134+
-p, --password string Password for basic authentication
135+
-u, --user string Username for basic authentication
136+
-v, --verbose Show more detail information
137+
138+
Use "mcc rest [command] --help" for more information about a command.
105139
```
106140

141+
## rest command examples
142+
Simple usage examples for rest commands
107143

108-
## How to Contribute
109-
- Issues/Discussions/Ideas: Utilize issue of mc-admin-cli
144+
```
145+
./mcc rest get -u default -p default http://localhost:1323/tumblebug/health
146+
./mcc rest post https://reqres.in/api/users -d '{
147+
"name": "morpheus",
148+
"job": "leader"
149+
}'
150+
```

bin/mcc

12.5 MB
Binary file not shown.

0 commit comments

Comments
 (0)