Skip to content

Commit 730e813

Browse files
authored
Merge branch 'master' into DailyAlice-patch-2
2 parents 9341005 + 2a26c30 commit 730e813

File tree

2 files changed

+137
-25
lines changed

2 files changed

+137
-25
lines changed

content/cli-reference/template.md

Lines changed: 136 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,169 @@
11
+++
22
title = "Template"
3-
date = 2019-01-04T16:16:15+05:30
3+
date = 2020-07-02
44
draft = false
55
weight = 30
66
toc = true
77
+++
88

9-
Template operations.
9+
## Template Operations
1010

11-
### Synopsis
11+
```
12+
create Create a template in the database.
13+
delete Delete a template from the database.
14+
get Get a template by ID.
15+
list List all templates in the database.
16+
update Update an existing template.
17+
```
18+
19+
`tink template --help` - Displays the available commands and usage for `tink template`.
20+
21+
### tink template create
22+
23+
Creates the template from the YAML file, and pushes it to the database. It returns a UUID for the newly created template.
24+
25+
```
26+
tink template create --name <NAME> --path <PATH> [--help] [--facility]
27+
```
28+
29+
**Arguments**
30+
31+
- `NAME` - The name for the new template.
32+
- `PATH` - The path to the template file.
33+
34+
**Options**
35+
36+
- `-h`, `--help` - Displays usage information for `create`.
37+
- `-n`, `--name` - Specify a name for the template. Must be unique and alphanumeric.
38+
- `-p`, `--path`, `< ./<PATH>` - Path to the template file. Alternatively, you can open and read the file instead.
39+
- `-f`, `--facility` - string used to build grpc and http urls
1240

13-
Template operations:
41+
**Examples**
1442

1543
```
16-
create create a workflow template
17-
delete delete a template
18-
get get a template
19-
list list all saved templates
20-
update update a template
44+
template create --name hello-world < ./hello-world.yml
45+
>
46+
Created Template: b8dbcf07-39dd-4018-903e-1748ecbd1986
2147
```
2248

23-
### Options
49+
### tink template delete
50+
51+
Deletes a template from the database. Doesn't return anything.
2452

2553
```
26-
-h, --help help for template
54+
tink template delete <ID> [--help] [--facility]
2755
```
2856

29-
### Examples
57+
**Arguments**
58+
59+
- `ID` - The ID of the template that you want to delete. Use multiple IDs to delete more than one template at a time.
60+
61+
**Options**
3062

31-
- The following command creates a workflow template using the `sample.tmpl` file and save it as `sample`.
32-
It returns a UUID for the newly created template.
63+
- `-h`, `--help` - Displays usage information for `delete`.
64+
- `-f`, `--facility` - string used to build grpc and http urls
65+
66+
**Examples**
3367

3468
```
35-
$ tink template create -n <template-name> -p <path-to-template>
36-
$ tink template create -n sample -p /tmp/sample.tmpl
69+
tink template delete b8dbcf07-39dd-4018-903e-1748ecbd1986
70+
>
71+
3772
```
3873

39-
- List all the templates
74+
### tink template get
75+
76+
Returns the specified template or templates in YAML format.
4077

4178
```
42-
$ tink template list
79+
tink template get <ID> [--help] [--facility]
4380
```
4481

45-
- Update the name of an existing template
82+
**Arguments**
83+
84+
- `ID` - The ID of the template you want to retrieve from the database. Use multiple IDs to retrieve more than one template at a time.
85+
86+
**Options**
87+
88+
- `-h`, `--help` - Displays usage information for `get`.
89+
- `-f`, `--facility` - string used to build grpc and http urls
90+
91+
**Examples**
92+
93+
```
94+
tink template get 160d2cbf-d1ed-496d-9ade-7347b2853cbf
95+
>
96+
version: "0.1"
97+
name: hello_world_workflow
98+
global_timeout: 600
99+
tasks:
100+
- name: "hello world"
101+
worker: "{{.device_1}}"
102+
actions:
103+
- name: "hello_world"
104+
image: hello-world
105+
timeout: 60
106+
```
107+
108+
### tink template list
109+
110+
Lists templates stored in the database in a formatted table.
111+
112+
```
113+
tink template list
114+
```
115+
116+
**Options**
117+
118+
- `-h`, `--help` - Displays usage information for `list`.
119+
- `-f`, `--facility` - string used to build grpc and http urls
120+
121+
**Examples**
122+
123+
```
124+
tink template list
125+
>
126+
+--------------------------------------+-------------------+-------------------------------+-------------------------------+
127+
| TEMPLATE ID | TEMPLATE NAME | CREATED AT | UPDATED AT |
128+
+--------------------------------------+-------------------+-------------------------------+-------------------------------+
129+
| 9c7d2a12-8dcb-406c-82a8-f41d2efd8ebf | hello-world-again | 2020-07-06 14:39:19 +0000 UTC | 2020-07-06 14:39:19 +0000 UTC |
130+
| 160d2cbf-d1ed-496d-9ade-7347b2853cbf | hello-world | 2020-07-06 14:36:15 +0000 UTC | 2020-07-06 14:36:15 +0000 UTC |
131+
+--------------------------------------+-------------------+-------------------------------+-------------------------------+
132+
```
133+
134+
### tink template update
135+
136+
Updates an existing template with either a new name, or by specifying a new or updated YAML file.
137+
138+
```
139+
tink template update <ID> [--name <NAME>] [--path <PATH>] [--help] [--facility]
140+
```
141+
142+
**Arguments**
143+
144+
- `ID` - The ID of the template you want to update.
145+
146+
**Options**
147+
148+
- `-h`, `--help` - Displays usage information for `update`.
149+
- `-n`, `--name` - Specify a new name for the template. Must be unique and alphanumeric.
150+
- `-p`, `--path`, `< ./<PATH>` - Path to the updated template file. Alternatively, you can open and read the file instead.
151+
- `-f`, `--facility` - string used to build grpc and http urls
152+
153+
**Examples**
154+
155+
Update the name of an existing template.
46156

47157
```
48-
$ tink template update <template-uuid> -n <new-name>
49-
$ tink template update edb80a56-b1f2-4502-abf9-17326324192b -n new-sample-template
158+
tink template update 160d2cbf-d1ed-496d-9ade-7347b2853cbf --name renamed-hello-world
159+
>
160+
Updated Template: 160d2cbf-d1ed-496d-9ade-7347b2853cbf
50161
```
51162

52-
- Update an existing template and keep the same name
163+
Update an existing template and keep the same name.
53164

54165
```
55-
$ tink template update <template-uuid> -p <path-to-new-template-file>
56-
$ tink template update edb80a56-b1f2-4502-abf9-17326324192b -p /tmp/new-sample-template.tmpl
166+
tink template update 9c7d2a12-8dcb-406c-82a8-f41d2efd8ebf < ./tmp/new-sample-template.tmpl
167+
>
168+
Updated Template: 160d2cbf-d1ed-496d-9ade-7347b2853cbf
57169
```

content/documentation/_index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ In addition to the microservices, there are three pieces of infrastructure:
3333

3434
- [**PostgreSQL**](https://www.postgresql.org/) - Tinkerbell uses PostgreSQL as its data store. PostgreSQL is a free and open-source relational database management system, and it stores Tinkerbell's hardware data, templates, and workflows.
3535

36-
- **Image Repository** - Depending on your use case, you can choose to use [Quay](https://quay.io/) or [DockerHub](https://hub.docker.com/) as the registry to store images. You can use the same registry to store all of the action images used for a workflow. If you want to keep things local, you can also setup a secure private Docker registry to hold all your images locally.
36+
- [**Image Repository**](https://hub.docker.com/_/registry) - Tinkerbell uses a local image repository to store all of the action images used in a workflow. This is particularly useful for secure environments that don't have access to the internet. You can also choose to use [Quay](https://quay.io/) or [DockerHub](https://hub.docker.com/) as the repository if your environment does have internet access.
3737

3838
- [**NGINX**](https://www.nginx.com/) - NGINX is a web server which can also be used as a reverse proxy, load balancer, mail proxy, and HTTP cache. Tinkerbell uses NGINX to serve the required boot files during workflow execution.
3939

0 commit comments

Comments
 (0)