# Description

An environment is a basic organization structure that groups hosts, products, repositories, etc. Every host belongs to one environment and it's isolated inside so that it can see only content that is in its environment.

## Chains

Environments are ordered into chains and their content (propducts, repositories, tempaltes, packages) can be moved to an environment only from its prior environment. You can have for example chain like:

Library -> Development -> Testing -> Production

Each change in an environment is done through a changeset in an action called promotion.

## Library

Library is a special environment that has no ascendant: All the content starts in this environment. More chains can start from the library environment but no further branching of a chain is enabled.


GET /katello/api/environments
列出組織中的環境

GET /katello/api/organizations/:organization_id/environments
列出組織中的環境

參數

參數名字 描述
organization_id
選填

組織識別子

Validations:

  • number.

library
選填

如果僅想看函示庫環境,設為真

Validations:

  • Must be one of: true, false.

name
選填

只篩選包含此名稱的環境

Validations:

  • String

search
選填

搜尋字串

Validations:

  • String

page
選填

頁數,從 1 開始

Validations:

  • number.

per_page
選填

每頁要傳回的結果數量

Validations:

  • number.

order
選填

排序欄位與次序,例如「name DESC」

Validations:

  • String

full_result
選填

是否顯示所有結果

Validations:

  • boolean

sort
選填

「order」參數的雜湊版本

Validations:

  • Hash

sort[by]
選填

用來排序結果的欄位

Validations:

  • String

sort[order]
選填

如何排序結果的順序(比方說 ASC 從下到上)

Validations:

  • String


GET /katello/api/environments/:id
顯示環境

GET /katello/api/organizations/:organization_id/environments/:environment_id
顯示環境

參數

參數名字 描述
id
必填

環境的 ID

Validations:

  • number.

organization_id
選填

組織的 ID

Validations:

  • number.


POST /katello/api/environments
建立環境

POST /katello/api/organizations/:organization_id/environments
在組織中建立環境

參數

參數名字 描述
organization_id
必填

組織名稱

Validations:

  • number.

name
必填

環境名稱

Validations:

  • String

label
選填

環境的標籤

Validations:

  • String

description
選填

環境描述

Validations:

  • String

prior_id
必填

ID of an environment that is prior to the new environment in the chain. It has to be either the ID of Library or the ID of an environment at the end of a chain.

Validations:

  • Integer


PUT /katello/api/environments/:id
更新環境

PUT /katello/api/organizations/:organization_id/environments/:id
更新組織中的環境

參數

參數名字 描述
id
必填

環境的 ID

Validations:

  • number.

organization_id
選填

組織名稱

Validations:

  • number.

new_name
選填

給環境的新名稱

Validations:

  • String

description
選填

環境描述

Validations:

  • String


DELETE /katello/api/environments/:id
銷毀環境

DELETE /katello/api/organizations/:organization_id/environments/:id
銷毀組織中的一個環境

參數

參數名字 描述
id
必填

環境的 ID

Validations:

  • number.

organization_id
選填

組織識別子

Validations:

  • number.


GET /katello/api/organizations/:organization_id/environments/paths
列出環境路徑

參數

參數名字 描述
organization_id
選填

組織識別子

Validations:

  • number.

permission_type
選填

The associated permission type. One of (readable | promotable) Default: readable

Validations:

  • String