Yaml

From 탱이의 잡동사니
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

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 />