Yaml: Difference between revisions

From 탱이의 잡동사니
Jump to navigation Jump to search
(Created page with "== Overview == YAML Markup Language 소개 및 사용법 정리 : http://www.yaml.org/start.html : http://www.yamllint.com/ == References == <references /> category:linux")
 
 
(4 intermediate revisions by the same user not shown)
Line 4: Line 4:
: http://www.yaml.org/start.html
: http://www.yaml.org/start.html
: http://www.yamllint.com/
: http://www.yamllint.com/
== Basic ==
=== file start/ file end/ comment ====
* # comment
* --- file start
* ... file end
=== key: value ===
yaml 은 key: value 로 표현하는데, : 다음에는 무조건 공백이 와야 한다.
<pre>
key: value
key:
  key_1:
    key_2:
      key_3:
</pre>
=== type ===
int, string, boolean 을 지원한다.
<pre>
int_type: 1
string_type: "1"
boolean_type: true
</pre>
=== object ===
<pre>
key:
  key: value
  key: value
key: {
  key: value,
  key: value
}
</pre>
=== list ===
<pre>
key:
  - item
  - item
key: [
  item, item
]
</pre>
=== Multiple line ===
* https://yaml-multiline.info/
==== Block scalar ====
'>' 입력 후 한블럭 들여쓰기 후 문장 입력.
<pre>
description: >
  The Asterisk's queued task is too high
  1. Get the problem task taskprocessor name
  $ sudo asterisk -rx "core show taskprocessors" | awk 'NR>2 {if ($3 > 100) {print $1}}'
  2. Do the ping to the problem taskprocessor.
  $ sudo asterisk -rx "core ping taskprocessor "
  3. Check the response time.
  If the response time is 5 sec, we need to restart the Asterisk.
</pre>


== References ==
== References ==
<references />
<references />


[[category:linux]]
[[category:programming]]

Latest revision as of 09:55, 15 January 2020

Overview

YAML Markup Language 소개 및 사용법 정리

http://www.yaml.org/start.html
http://www.yamllint.com/

Basic

file start/ file end/ comment =

  • # comment
  • --- file start
  • ... file end

key: value

yaml 은 key: value 로 표현하는데, : 다음에는 무조건 공백이 와야 한다.

key: value

key:
  key_1:
    key_2:
      key_3:

type

int, string, boolean 을 지원한다.

int_type: 1
string_type: "1"
boolean_type: true

object

key:
  key: value
  key: value

key: {
  key: value,
  key: value
}

list

key:
  - item
  - item

key: [
  item, item
]

Multiple line

Block scalar

'>' 입력 후 한블럭 들여쓰기 후 문장 입력.

description: >
  The Asterisk's queued task is too high
  1. Get the problem task taskprocessor name
  $ sudo asterisk -rx "core show taskprocessors" | awk 'NR>2 {if ($3 > 100) {print $1}}'
  2. Do the ping to the problem taskprocessor.
  $ sudo asterisk -rx "core ping taskprocessor "
  3. Check the response time.
  If the response time is 5 sec, we need to restart the Asterisk.

References

<references />