---
schema_version: "1"
id: 05b650f997f5099959703048c5722aa96c86a5ab76a9a1402b2eeb433972b510
title: API Governance の CLI
collection: mulesoft
version: current
locale: ja-jp
portal_url: https://docs.salesforce.com/mulesoft/current/ja-jp/anypoint-cli/latest/api-governance.md
canonical_url: https://docs.mulesoft.com/jp/anypoint-cli/latest/api-governance
source_site: docs.mulesoft.com
content_type: documentation
content_hash: e09f45ccd0e63fe704cf736ca3848086b6ae3a2a5263e28d4c7fa3d435b4f921
description: MuleSoft Documentation Site
release: 4.x
latest: true
---
# API Governance の CLI

`governance`​ コマンドを使用して、API Governance のプロセスを自動化します。これらのコマンドの使用方法は、​[API Governance ドキュメント](https://docs.mulesoft.com/api-governance/)​を参照してください。

<table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 50%;">
<col style="width: 50%;">
</colgroup>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock">コマンド</p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">説明</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><a href="#governance-api-evaluate">governance:api:evaluate</a></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">検索条件を評価して、その条件を満たす API に適用されるルールセットを決定する</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><a href="#governance-api-inspect">governance:api:inspect</a></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">API 仕様を調べ、そのスキーマをリストする</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><a href="#governance-api-validate">governance:api:validate</a></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">指定されたガバナンスルールセットに対して API 仕様を検証する</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><a href="#governance-document">governance:document</a></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">ガバナンスルールセット定義のドキュメントファイルを作成する</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><a href="#governance-profile-create">governance:profile:create</a></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">ガバナンスプロファイルを作成する</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><a href="#governance-profile-delete">governance:profile:delete</a></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">ガバナンスプロファイルを削除する</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><a href="#governance-profile-info">governance:profile:info</a></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">特定のガバナンスプロファイル ID の情報をリストする</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><a href="#governance-profile-list">governance:profile:list</a></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">組織内のすべてのガバナンスプロファイルをリストする</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><a href="#governance-profile-update">governance:profile:update</a></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">ガバナンスプロファイルを更新する</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><a href="#governance-ruleset-clone">governance:ruleset:clone</a></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">ガバナンスルールセットをコピーし、指定された更新をルールに適用する</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><a href="#governance-ruleset-info">governance:ruleset:info</a></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">ルールセットルールをリストする</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><a href="#governance-ruleset-init">governance:ruleset:init</a></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">データスキーマに基づいてガバナンスルールセット定義を初期化する</p></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><p class="tableblock"><a href="#governance-ruleset-validate">governance:ruleset:validate</a></p></td>
<td class="tableblock halign-left valign-top"><p class="tableblock">ガバナンスルールセット定義の形式を検証する</p></td>
</tr>
</tbody>
</table>

## [](#governance-api-evaluate)governance:api:evaluate

`> governance:api:evaluate [フラグ]`

このコマンドは、指定された検索条件を評価して、その条件を満たす API に適用されるルールセットを決定します。

このコマンドでは、デフォルトのフラグ以外に次のフラグも受け入れます。

<table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 35%;">
<col style="width: 65%;">
</colgroup>
<thead>
<tr>
<th class="tableblock halign-left valign-top">フラグ</th>
<th class="tableblock halign-left valign-top">説明</th>
</tr>
</thead>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><code>--api=&lt;api&gt;</code></p>
</div></div></td>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p>評価する API プロジェクト。このコマンドは、プロジェクトの ​<code>exchange.json</code>​ ファイルの条件を使用します。</p>
</div></div></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p>--criteria &lt;filtertype:filtervalue&gt;,…​</p>
</div></div></td>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p>ルールセットを識別するために評価する検索条件を適用できます。カンマ区切りの検索条件のリストを指定します。各検索条件の種別と値は、​<code>filtertype:filtervalue</code>​ の形式です。</p>
</div>
<div class="paragraph">
<p>次のような検索条件を使用できます。</p>
</div>
<div class="ulist">
<ul>
<li>
<p><code>scope</code>​: API 種別、​<code>rest-api</code>​ または ​<code>async-api</code>​</p>
</li>
<li>
<p><code>tag</code>​: Exchange で API に対して定義されたタグ</p>
</li>
<li>
<p><code>category</code>​: Exchange で API に対して定義されたカテゴリ。検索条件値は ​<code>categoryName:value</code>​ として 2 つの部分で指定されます。</p>
</li>
<li>
<p><code>env-type</code>​: 環境種別 (すべて、本番、または Sandbox)</p>
</li>
<li>
<p><code>env-id</code>​: API Manager の環境名の ID。​<strong>[API Manager]</strong>​ &gt; ​<strong>[Environment information (環境情報)]</strong>​ を使用してこの値を取得できます。​<a href="https://docs.mulesoft.com/jp/api-manager/latest/environments-concept" class="xref page">「環境の概念の確認」</a>​を参照してください。</p>
<div class="paragraph">
<p><code>env-type</code>​ または ​<code>env-id</code>​ が使用されている場合、プロファイルに ​<strong>[API Instance (API インスタンス)]</strong>​ 検索条件が設定されるため、インスタンスが設定された API のみが絞り込まれます。</p>
</div>
<div class="paragraph">
<p>CLI を使用してプロファイルの ​<strong>[API Instance (API インスタンス)]</strong>​ を選択解除するには、​<code>env-type</code>​ も ​<code>env-id</code>​ も含まれない ​<code>--criteria</code>​ フラグを使用してプロファイルを更新します。</p>
</div>
</li>
</ul>
</div>
<div class="paragraph">
<p>例:
tag:tag1,category:category1:value,category:category2:value2,scope:rest-api,scope:async-api,env-type:production</p>
</div></div></td>
</tr>
</tbody>
</table>

<table><tbody><tr><td class="icon"><i class="fa icon-note" title="Note"></i></td><td class="content">このコマンドは、​<code>--criteria</code>​ または ​<code>--api</code>​ フラグを使用して実行する必要があります。</td></tr></tbody></table>

**コマンド例:**

`anypoint-cli-v4 governance:api:evaluate --criteria "tag:best,category:API Type:Experience API,scope:rest-api"`

`anypoint-cli-v4 governance:api:evaluate --api order-api-1.0.0-raml.zip`  
ここで、​`order-api-1.0.0-raml.zip`​ には API とその ​`exchange.json`​ ファイルが含まれています。

**出力例:**

╔════════════════════════════════════════════════════════════════════╗
║ Ruleset GAV                                                        ║
╟────────────────────────────────────────────────────────────────────╢
║ 68ef9520-24e9-4cf2-b2f5-620025690913/anypoint-best-practices/1.5.1 ║
╟────────────────────────────────────────────────────────────────────╢
║ 68ef9520-24e9-4cf2-b2f5-620025690913/anypoint-best-practices/1.0.1 ║
╚════════════════════════════════════════════════════════════════════╝

## [](#governance-api-inspect)governance:api:inspect

`> governance:api:inspect [フラグ] <api-specification>`

このコマンドは、​`api-specification`​ で渡された API 仕様を調べ、ヘッダー、要求、応答ペイロードなどのすべてのスキーマをリストします。このスキーマ情報は、​`governance:ruleset:init`​ コマンドで使用できます。​[governance:ruleset:init](#governance-ruleset-init)​を参照してください。

このコマンドでは、デフォルトのフラグのみを受け入れます。

**コマンド例:**

```copy
anypoint-cli-v4 governance:api:inspect my-healthcare-api.yaml
```

**スキーマの例**

```copy
types:
  patientmultipleBirthBoolean:
    properties:
      multipleBirthBoolean:
        description: Whether patient is part of a multiple birth
        type: boolean
  patientmultipleBirthInteger:
    properties:
      multipleBirthInteger:
        description: Whether patient is part of a multiple birth
        type: integer

        .
        .
        .

  PatientEntry:
    type: FHIR_commons.Entry
    properties:
      resource: Patient

  PatientBundle:
    type: FHIR_commons.Bundle
    properties:
      entry?: PatientEntry[]
```

**出力例:**

  'patientmultipleBirthBoolean',
  'PatientBundle',
  'patientmultipleBirthInteger',
  'PatientEntry'

## [](#governance-api-validate)governance:api:validate

`> governance:api:validate <api-specification> [フラグ]`

このコマンドは、指定されたルールセットに対して ​`api-specification`​ で渡された API 仕様を検証します。

<table><tbody><tr><td class="icon"><i class="fa icon-note" title="Note"></i></td><td class="content">このコマンドには複数オプションのフラグがあります。コマンドで複数オプションのフラグを使用する場合は、フラグの前にパラメーターを置くか、パラメーターの前に「-- 」(2 つのダッシュの後にスペース) を使用します。</td></tr></tbody></table>

`api-specification`​ は次のいずれかとして指定できます。

- API プロジェクト ZIP ファイル
- API プロジェクトフォルダー
- `--remote`​ フラグが指定されている場合は、API プロジェクトのアセット識別子。アセット識別子は、Exchange 内の各アセットを一意に識別するグループ ID、アセット ID、およびバージョン (GAV) です。

検証するルールセットを次のように指定できます。

- API プロジェクトのルールセットの連動関係を定義する既存の ​`exchange.json`​ ファイルを使用するには、​`api-specification`​ で指定したフォルダーまたは ZIP ファイルに ​`exchange.json`​ ファイルが含まれていることを確認してください。​`exchange.json`​ ファイルが存在する場合、このコマンドはすべてのルールセット連動関係をダウンロードし、それらのルールセットに対して検証します。ルールセットの連動関係は、API Designer でその API プロジェクトに連動関係が定義されている場合にのみ、​`exchange.json`​ ファイルに存在します。​[「プロジェクトへのルールセットの追加」](https://docs.mulesoft.com/api-governance/find-conformance-issues#add-rulesets)​を参照してください。
- Exchange でパブリッシュされているルールセットに対して直接検証するには、​`--remote-rulesets`​ フラグを使用します。
- ローカルルールセットに対して検証するには、​`---rulesets`​ フラグを使用します。

<table><tbody><tr><td class="icon"><i class="fa icon-note" title="Note"></i></td><td class="content">重複するルールセットは検出されないため、同じコマンドの実行でルールセットを特定する前述の方法を複数使用すると、一部のルールセットが複数回検証される場合があります。</td></tr></tbody></table>

このコマンドでは、デフォルトのフラグ以外に次のフラグも受け入れます。

<table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 35%;">
<col style="width: 65%;">
</colgroup>
<thead>
<tr>
<th class="tableblock halign-left valign-top">フラグ</th>
<th class="tableblock halign-left valign-top">説明</th>
</tr>
</thead>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><code>--rulesets &lt;ruleset-yaml-file1&gt; &lt;ruleset-yaml-file2&gt; …​</code></p>
</div></div></td>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p>ローカルルールセット定義。​<code>rulesets</code>​ フラグの後には、カンマで区切られたルールセット YAML ファイルのリストが続きます。</p>
</div></div></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><code>--remote-rulesets &lt;ruleset-asset-identifier&gt; &lt;ruleset-asset-identifier&gt; …​</code></p>
</div></div></td>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p>リモートルールセット定義。​<code>remote-rulesets</code>​ フラグの後には、カンマで区切られたルールセットアセット識別子のリストが続きます。アセット識別子は、Exchange 内の各アセットを一意に識別するグループ ID、アセット ID、およびバージョン (GAV) です。例: <code>&lt;group_id&gt;/&lt;asset_id&gt;/&lt;version&gt;,&lt;group_id&gt;/&lt;asset_id&gt;/&lt;version&gt;</code>​</p>
</div>
<div class="paragraph">
<p><a href="#exchange-asset-identifiers">Exchange アセット識別子 (GAV) を取得する</a>​を参照してください。</p>
</div></div></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><code>--remote</code></p>
</div></div></td>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p>パブリッシュされた API に対して検証を行う必要があることを示すフラグ。​<code>api-specification</code>​ で渡される値は、API のアセット識別子です。アセット識別子は、Exchange 内の各アセットを一意に識別するグループ ID、アセット ID、およびバージョン (GAV) です。例: <code>&lt;group_id&gt;/&lt;asset_id&gt;/&lt;version&gt;</code>​</p>
</div>
<div class="paragraph">
<p><a href="#exchange-asset-identifiers">Exchange アセット識別子 (GAV) を取得する</a>​を参照してください。</p>
</div></div></td>
</tr>
</tbody>
</table>

**コマンド例:**

```copy
anypoint-cli-v4 governance:api:validate /MyApis/order-api-1.0.0-raml.zip

anypoint-cli-v4 governance:api:validate /MyApis/order-api-1.0.0-raml

anypoint-cli-v4 governance:api:validate /MyApis/order-api-1.0.0-raml.zip --rulesets /MyRulesets/ruleset1.yaml /MyRulesets/ruleset2.yaml

anypoint-cli-v4 governance:api:validate /MyApis/order-api-1.0.0-raml.zip --remote-rulesets 68ef9520-24e9-4cf2-b2f5-620025690913/open-api-best-practices/1.0.1

anypoint-cli-v4 governance:api:validate 8a840abd-e63a-4f8b-87ab-24052eda2017/order-api/1.0.0 --remote-rulesets 68ef9520-24e9-4cf2-b2f5-620025690913/open-api-best-practices/1.0.1 --remote
```

**出力例:**

ルールセットに適合する仕様の場合:

 Spec conforms with Ruleset

ルールセットに適合しない仕様の場合:

Conforms: false
Number of results: 3 **(1)**

Functional Validations
----------------------

Constraint: http://a.ml/vocabularies/amf/core#declaration-not-found
Severity: Violation
Message: not supported scalar for documentation
Target: null
Range: \[(6,3)-(6,3)\]
Location: file:///Users/myuser/Downloads/order-api-1.0.0-raml/order-api-1.0.0-raml

Conformance Validations **(2)**
-----------------------

Constraint: file:///exchange\_modules/68ef9520-24e9-4cf2-b2f5-620025690913/anypoint-best-practices/1.0.0/ruleset.yaml#/encodes/validations/api-must-have-documentation **(3)**
Severity: Warning **(4)**
Message: Provide the documentation for the API. **(5)**
Target: amf://id#2 **(6)**
Range: \[(2,0)-(6,4)\] **(7)**
Location: file:///Users/myuser/Downloads/order-api-1.0.0-raml/order-api-1.0.0-raml **(8)**

Constraint: file:///exchange\_modules/8a840abd-e63a-4f8b-87ab-24052eda2017/best-practices-ruleset/1.0.0/bestpractices.yaml#/encodes/validations/api-must-have-documentation
Severity: Violation
Message: Provide the documentation for the API
Target: amf://id#2
Range: \[(2,0)-(6,4)\]
Location: file:///Users/myuser/Downloads/order-api-1.0.0-raml/order-api-1.0.0-raml

<table><tbody><tr><td><i class="conum" data-value="1"></i><b>1</b></td><td>見つかった機能および準拠検証の問題の合計</td></tr><tr><td><i class="conum" data-value="2"></i><b>2</b></td><td>準拠の問題セクション</td></tr><tr><td><i class="conum" data-value="3"></i><b>3</b></td><td>この一連の問題が適用されるルールセットとルール</td></tr><tr><td><i class="conum" data-value="4"></i><b>4</b></td><td>問題の重要度</td></tr><tr><td><i class="conum" data-value="5"></i><b>5</b></td><td>問題の説明</td></tr><tr><td><i class="conum" data-value="6"></i><b>6</b></td><td>AMF モデルノード ID。AMF モデルについての詳細は、​<a href="https://docs.mulesoft.com/api-governance/create-custom-rulesets" class="xref page">「カスタムガバナンスルールセットの作成」</a>​を参照</td></tr><tr><td><i class="conum" data-value="7"></i><b>7</b></td><td>問題が発生した API 仕様の開始行番号と列および終了行番号と列。ここで、列は行の先頭からのオフセットであり、オフセットの番号は 0 で開始</td></tr><tr><td><i class="conum" data-value="8"></i><b>8</b></td><td>問題が発生したファイル (メインファイルまたはその連動関係のいずれか)</td></tr></tbody></table>

## [](#governance-document)governance:document

`> governance:document [フラグ] <ruleset> <doc-file>`

このコマンドは、​`ruleset`​ で指定された API Governance ルールセット定義 ZIP ファイルのドキュメントを作成します。ドキュメントを ​`doc-file`​ ZIP ファイルに含め、Exchange にアップロードしてパブリッシュできるようにします。

このコマンドでは、デフォルトのフラグのみを受け入れます。

**コマンド例:**

```copy
anypoint-cli-v4 governance:document /myrulesetfolder/mynewruleset.yaml /myrulesetfolder/ruleset.doc.zip
```

**出力例:**

validation name \[ 'security-fields-operation-empty' \]
validation name \[ 'access-tokens-oauth2-cleartext' \]
validation name \[ 'insecure-oauth2-grants' \]
validation name \[ 'api-keys-in-cookie' \]
validation name \[ 'api-keys-in-query' \]
validation name \[ 'api-keys-in-header' \]
validation name \[ 'api-negotiates-authentication' \]
validation name \[ 'insecure-basic-auth' \]
validation name \[ 'bearer-token-cleartext' \]
validation name \[ 'http-token-cleartext' \]
validation name \[ 'oauth1-deprecated' \]
validation name \[ 'oauth2-redirections-non-encrypted' \]
validation name \[ 'unknown-security-scheme' \]
validation name \[ 'valid-server-urltemplate' \]
validation name \[ 'valid-oauth2-redirection-urls' \]
Saving to myRulesetFolder/ruleset.doc.zip

## [](#governance-profile-create)governance:profile:create

`> governance:profile:create [フラグ] <profile-name> <ruleset-asset-identifiers>`

このコマンドは、​`profile-name`​ で指定された新しいガバナンスプロファイル名の文字列値を使用して、ガバナンスプロファイルを作成します。

`ruleset-asset-identifiers`​ を含める必要があります。これは、ルールセットアセット識別子のカンマ区切りのリストであり、それぞれが Exchange 内の各アセットを一意に識別するグループ ID、アセット ID、およびバージョン (GAV) です。例: `<group_id>/<asset_id>/<version>,<group_id>/<asset_id>/<version>`​。ここで、​`<version>`​ は ​`latest`​ の特定のバージョンです。バージョンとして ​`latest`​ を使用する場合、プロファイルの作成後にバージョンがパブリッシュされると、プロファイルはルールセットの最新バージョンを自動的に使用します。​[Exchange アセット識別子 (GAV) を取得する](#exchange-asset-identifiers)​を参照してください。

`notify`​ フラグの 1 つを使用して、作成中のプロファイルの通知を設定できます。​`notify`​ フラグを使用しない場合、コマンドによって通知は設定されません。通知はデフォルトでオフになっています。

このコマンドでは、デフォルトのフラグ以外に次のフラグも受け入れます。

<table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 35%;">
<col style="width: 65%;">
</colgroup>
<thead>
<tr>
<th class="tableblock halign-left valign-top">フラグ</th>
<th class="tableblock halign-left valign-top">説明</th>
</tr>
</thead>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><code>--criteria &lt;filtertype:filtervalue&gt;,…​</code></p>
</div></div></td>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p>検索条件を適用して、プロファイルルールセットが適用される API のリストを選択できます。カンマ区切りの検索条件のリストを指定します。各検索条件の種別と値は、​<code>filtertype:filtervalue</code>​ の形式です。</p>
</div>
<div class="paragraph">
<p>次のような検索条件を使用できます。</p>
</div>
<div class="ulist">
<ul>
<li>
<p><code>scope</code>​: API 種別、​<code>rest-api</code>​ または ​<code>async-api</code>​</p>
</li>
<li>
<p><code>tag</code>​: Exchange で API に対して定義されたタグ</p>
</li>
<li>
<p><code>category</code>​: Exchange で API に対して定義されたカテゴリ。検索条件値は ​<code>categoryName:value</code>​ として 2 つの部分で指定されます。</p>
</li>
<li>
<p><code>env-type</code>​: 環境種別 (すべて、本番、または Sandbox)</p>
</li>
<li>
<p><code>env-id</code>​: API Manager の環境名の ID。​<strong>[API Manager]</strong>​ &gt; ​<strong>[Environment information (環境情報)]</strong>​ を使用してこの値を取得できます。​<a href="https://docs.mulesoft.com/jp/api-manager/latest/environments-concept" class="xref page">「環境の概念の確認」</a>​を参照してください。</p>
<div class="paragraph">
<p><code>env-type</code>​ または ​<code>env-id</code>​ が使用されている場合、プロファイルに ​<strong>[API Instance (API インスタンス)]</strong>​ 検索条件が設定されるため、インスタンスが設定された API のみが絞り込まれます。</p>
</div>
<div class="paragraph">
<p>CLI を使用してプロファイルの ​<strong>[API Instance (API インスタンス)]</strong>​ を選択解除するには、​<code>env-type</code>​ も ​<code>env-id</code>​ も含まれない ​<code>--criteria</code>​ フラグを使用してプロファイルを更新します。</p>
</div>
</li>
</ul>
</div>
<div class="paragraph">
<p>例:
tag:tag1,category:category1:value,category:category2:value2,scope:rest-api,scope:async-api,env-type:production</p>
</div></div></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><code>--description &lt;description&gt;</code></p>
</div></div></td>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><code>description</code>​ フラグの後には、新しいガバナンスプロファイルの説明である文字列が続きます。</p>
</div></div></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><code>--notify-contact</code></p>
</div></div></td>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p>通知を有効にし、受信者を API に設定された取引先責任者に設定します。</p>
</div></div></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><code>--notify-publisher</code></p>
</div></div></td>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p>通知を有効にし、受信者を API パブリッシャーに設定します。</p>
</div></div></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><code>--notify-others &lt;email ID,email ID,…​&gt;</code></p>
</div></div></td>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p>通知を有効にし、受信者を指定されたメール ID のリストに設定します。</p>
</div></div></td>
</tr>
</tbody>
</table>

**コマンド例:**

```copy
anypoint-cli-v4 governance:profile:create "OAS Best Practices" 68ef9520-24e9-4cf2-b2f5-620025690913/open-api-best-practices/1.0.1 --criteria "tag:oas,category:API Type:Experience API,scope:rest-api" --description "Profile for OAS Best Practices"

anypoint-cli-v4 governance:profile:create "Open API Best Practices" 68ef9520-24e9-4cf2-b2f5-620025690913/open-api-best-practices/1.0.1 --criteria "tag:oas,category:API Type:Experience API,scope:rest-api" --description "Profile for OAS Best Practices"

anypoint-cli-v4 governance:profile:create "Anypoint Best Practices" 68ef9520-24e9-4cf2-b2f5-620025690913/anypoint-api-best-practices/1.0.1 --criteria "tag:raml tag:oas category:API Type:Experience API,scope:rest-api" --description "Profile for REST API Best Practices" --notify-publisher  --notify-contact --notify-others a@a.a,b@b.com

anypoint-cli-v4 governance:profile:create "Primary API Standards" 68ef9520-24e9-4cf2-b2f5-620025690913/open-api-best-practices/latest,68ef9520-24e9-4cf2-b2f5-620025690913/myorg-best-practices/1.0.2 --criteria "tag:prim,category:API Type:Experience API,scope:rest-api" --description "Profile for Primary API Standards"
```

**出力例:**

 Profile Added
 Id         	4f98e59d-8efb-420f-ac95-9cd0af15bd45
 Name       	OAS Best Practices
 Description	Profile for OAS Best Practices
 Rulesets   	gav://68ef9520-24e9-4cf2-b2f5-620025690913/open-api-best-practices/1.0.1
 Filter     	tag:best

## [](#governance-profile-delete)governance:profile:delete

`> governance:profile:delete [フラグ] <profile-id>`

このコマンドは、​`profile-id`​ によって指定された特定のガバナンスプロファイルを削除します。 この ID を取得するには、​`governance:profile:info`​ または ​`governance:profile:list`​ コマンドを実行します。

`governance:profile:delete`​ コマンドでは、デフォルトのフラグのみを受け入れます。

**コマンド例:**

```copy
anypoint-cli-v4 governance:profile:delete 8ffd463f-86b2-4132-afc6-44d179209362
```

**出力例:**

 Profile with id 8ffd463f-86b2-4132-afc6-44d179209362 removed

## [](#governance-profile-info)governance:profile:info

`> governance:profile:info [フラグ] <profile-id>`

このコマンドは、ガバナンスプロファイル ID のすべての情報をリストします。

このコマンドでは、デフォルトのフラグ以外に次のフラグも受け入れます。

<table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 35%;">
<col style="width: 65%;">
</colgroup>
<thead>
<tr>
<th class="tableblock halign-left valign-top">フラグ</th>
<th class="tableblock halign-left valign-top">説明</th>
</tr>
</thead>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><code>--output &lt;output-format&gt;</code></p>
</div></div></td>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p>コマンド出力の形式。サポートされている値は、​<code>table</code>​ (デフォルト) および ​<code>json</code>​ です。</p>
</div></div></td>
</tr>
</tbody>
</table>

**コマンド例:**

```copy
anypoint-cli-v4 governance:profile:info 19fb211b-8775-43cc-865a-46228921d6ed
```

**出力例:**

Id         	        19fb211b-8775-43cc-865a-46228921d6ed
Name       	        Best Practices
Description	        Best Practices Profile
Rulesets   	        68ef9520-24e9-4cf2-b2f5-620025690913/anypoint-best-practices/1.0.0 8a840abd-e63a-4f8b-87ab-24052eda2017/best-practices-ruleset/1.0.0 68ef9520-24e9-4cf2-b2f5-620025690913/required-examples/1.0.0
Criteria   	        tag:best,category:API Type:Experience API,scope:rest-api
NotificationConfig  Contact,Publisher

## [](#governance-profile-list)governance:profile:list

`> governance:profile:list [フラグ]`

このコマンドは、組織のすべてのガバナンスプロファイルの情報をリストします。ガバナンスプロファイルを更新するときに、この情報が必要です。

このコマンドでは、デフォルトのフラグ以外に次のフラグも受け入れます。

<table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 35%;">
<col style="width: 65%;">
</colgroup>
<thead>
<tr>
<th class="tableblock halign-left valign-top">フラグ</th>
<th class="tableblock halign-left valign-top">説明</th>
</tr>
</thead>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><code>--output &lt;output-format&gt;</code></p>
</div></div></td>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p>コマンド出力の形式。サポートされている値は、​<code>table</code>​ (デフォルト) および ​<code>json</code>​ です。</p>
</div></div></td>
</tr>
</tbody>
</table>

**コマンド例:**

```copy
anypoint-cli-v4 governance:profile:list
```

**出力例:**

Profile Name                 	Profile Id

Minimum Security Requirements	1f418cf4-b870-4b31-8734-f55f28d45f8f
Best Practices               	19fb211b-8775-43cc-865a-46228921d6ed
New Best Practices           	4eaf9176-3ef9-4021-a67c-6e4bc10d3763
OAS Standards                	51ae8795-2278-407e-942f-becba29af986

## [](#governance-profile-update)governance:profile:update

`> governance:profile:update [フラグ] <profile-id>`

このコマンドは、​`profile-id`​ で指定されるガバナンスプロファイルを更新します。 この ID を取得するには、​`governance:profile:info`​ または ​`governance:profile:list`​ コマンドを実行します。

ガバナンスプロファイルの一般情報、ルールセット、検索条件、および通知設定を更新できます。​`notify`​ フラグの 1 つを使用して、通知設定を更新したり、通知を無効にしたりできます。すべての変更で、既存の通知設定が上書きされます。​`notify`​ フラグを使用しない場合、通知設定は変更されません。

このコマンドでは、デフォルトのフラグ以外に次のフラグも受け入れます。

<table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 35%;">
<col style="width: 65%;">
</colgroup>
<thead>
<tr>
<th class="tableblock halign-left valign-top">フラグ</th>
<th class="tableblock halign-left valign-top">説明</th>
</tr>
</thead>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><code>--profile-name &lt;profile-name&gt;</code></p>
</div></div></td>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><code>profile-name</code>​ フラグの後には、新しいガバナンスプロファイル名である文字列が続きます。</p>
</div></div></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><code>--ruleset-gavs &lt;ruleset-gavs&gt;</code></p>
</div></div></td>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><code>ruleset-gavs</code>​ フラグの後には、各ルールセットのアセット識別子の ​<code>&lt;group_id&gt;/&lt;asset_id&gt;/&lt;version&gt;,&lt;group_id&gt;/&lt;asset_id&gt;/&lt;version&gt;</code>​ 形式のリストが続きます。ここで、​<code>&lt;version&gt;</code>​ は特定のバージョンまたは ​<code>latest</code>​ です。アセット識別子は、Exchange 内の各アセットを識別する一意のグループ ID、アセット ID、およびバージョン (GAV) です。バージョンとして ​<code>latest</code>​ を使用する場合、プロファイルの作成後にバージョンがパブリッシュされると、プロファイルはルールセットの最新バージョンを自動的に使用します。</p>
</div>
<div class="paragraph">
<p><a href="#exchange-asset-identifiers">Exchange アセット識別子 (GAV) を取得する</a>​を参照してください。</p>
</div></div></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><code>--criteria &lt;filtertype:filtervalue&gt;,…​</code></p>
</div></div></td>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p>検索条件を適用して、プロファイルルールセットが適用される API のリストを選択できます。カンマ区切りの検索条件のリストを指定します。各検索条件の種別と値は、​<code>filtertype:filtervalue</code>​ の形式です。</p>
</div>
<div class="paragraph">
<p>次のような検索条件を使用できます。</p>
</div>
<div class="ulist">
<ul>
<li>
<p><code>scope</code>​: API 種別、​<code>rest-api</code>​ または ​<code>async-api</code>​</p>
</li>
<li>
<p><code>tag</code>​: Exchange で API に対して定義されたタグ</p>
</li>
<li>
<p><code>category</code>​: Exchange で API に対して定義されたカテゴリ。検索条件値は ​<code>categoryName:value</code>​ として 2 つの部分で指定されます。</p>
</li>
<li>
<p><code>env-type</code>​: 環境種別 (すべて、本番、または Sandbox)</p>
</li>
<li>
<p><code>env-id</code>​: API Manager の環境名の ID。​<strong>[API Manager]</strong>​ &gt; ​<strong>[Environment information (環境情報)]</strong>​ を使用してこの値を取得できます。​<a href="https://docs.mulesoft.com/jp/api-manager/latest/environments-concept" class="xref page">「環境の概念の確認」</a>​を参照してください。</p>
<div class="paragraph">
<p><code>env-type</code>​ または ​<code>env-id</code>​ が使用されている場合、プロファイルに ​<strong>[API Instance (API インスタンス)]</strong>​ 検索条件が設定されるため、インスタンスが設定された API のみが絞り込まれます。</p>
</div>
<div class="paragraph">
<p>CLI を使用してプロファイルの ​<strong>[API Instance (API インスタンス)]</strong>​ を選択解除するには、​<code>env-type</code>​ も ​<code>env-id</code>​ も含まれない ​<code>--criteria</code>​ フラグを使用してプロファイルを更新します。</p>
</div>
</li>
</ul>
</div>
<div class="paragraph">
<p>例:
tag:tag1,category:category1:value,category:category2:value2,scope:rest-api,scope:async-api,env-type:production</p>
</div></div></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><code>--description &lt;description&gt;</code></p>
</div></div></td>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><code>description</code>​ フラグの後には、新しいガバナンスプロファイルの説明である文字列が続きます。</p>
</div></div></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><code>--notify-off</code></p>
</div></div></td>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p>通知を無効にします。</p>
</div></div></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><code>--notify-contact</code></p>
</div></div></td>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p>通知を有効にし、受信者を API に設定された取引先責任者に設定します。</p>
</div></div></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><code>--notify-publisher</code></p>
</div></div></td>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p>通知を有効にし、受信者を API パブリッシャーに設定します。</p>
</div></div></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><code>--notify-others &lt;email ID,email ID,…​&gt;</code></p>
</div></div></td>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p>通知を有効にし、受信者を指定されたメール ID のリストに設定します。</p>
</div></div></td>
</tr>
</tbody>
</table>

**コマンド例:**

```copy
anypoint-cli-v4 governance:profile:update 4eaf9176-3ef9-4021-a67c-6e4bc10d3763 --profile-name "MyOrg Best Practices"

anypoint-cli-v4 governance:profile:update 19fb211b-8775-43cc-865a-46228921d6ed --criteria `tag:best,category:API Type:Experience API,scope:rest-api`

anypoint-cli-v4 governance profile update 67eff44a-28a3-43d4-93d9-bddedb92c711 --notify-publisher  --notify-contact --notify-others a@a.a,b@b.com

anypoint-cli-v4 governance profile update 67eff44a-28a3-43d4-93d9-bddedb92c711 --notify-off

anypoint-cli-v4 governance profile update 19fb211b-8775-43cc-865a-46228921d6ed --criteria `tag:best,category:API Type:Experience API,scope:rest-api,env-type:production` --ruleset-gavs 68ef9520-24e9-4cf2-b2f5-620025690913/open-api-best-practices/latest,68ef9520-24e9-4cf2-b2f5-620025690913/myorg-best-practices/latest
```

**出力例:**

 Profile updated 51f9f94c-fb0c-43d4-9895-22c9e64f1537

## [](#governance-ruleset-clone)governance:ruleset:clone

`> governance:ruleset:clone [フラグ] <ruleset> <new_title> <new_description>`

このコマンドは、ガバナンスルールセットをコピーして新しいカスタムルールセットを作成し、フラグに基づいて指定された更新をルールに適用します。新しいルールセットが標準出力に書き込まれます。

`new-title`​ パラメーターでは、新しいルールセットのタイトルを指定します。

`new description`​ パラメーターでは、新しいルールセットのタイトルを指定します。

<table><tbody><tr><td class="icon"><i class="fa icon-tip" title="Tip"></i></td><td class="content">このコマンドを実行する前に、​<code>governance:ruleset:info</code>​ コマンドを実行して、このコマンドで使用するルール ID 情報を取得します。</td></tr></tbody></table>

このコマンドでは、デフォルトのフラグ以外に次のフラグも受け入れます。

<table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 35%;">
<col style="width: 65%;">
</colgroup>
<thead>
<tr>
<th class="tableblock halign-left valign-top">フラグ</th>
<th class="tableblock halign-left valign-top">説明</th>
</tr>
</thead>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><code>--remote</code></p>
</div></div></td>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p>コピーするルールセットが Exchange でパブリッシュされていること、および ​<code>ruleset</code>​ パラメーターがルールセットのアセット識別子であることを示します。アセット識別子は、Exchange 内の各アセットを一意に識別するグループ ID、アセット ID、およびバージョン (GAV) です。例: <code>&lt;group_id&gt;/&lt;asset_id&gt;/&lt;version&gt;</code>​</p>
</div>
<div class="paragraph">
<p><a href="#exchange-asset-identifiers">Exchange アセット識別子 (GAV) を取得する</a>​を参照してください。</p>
</div></div></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><code>--error=&lt;list_rules_to_move_to_error&gt;</code></p>
</div></div></td>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><code>error</code>​ フラグの後には、ルールセット YAML のエラーの重要度レベルセクションに移動するルールのルール ID が続きます。</p>
</div></div></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><code>--warning=&lt;list_rules_to_move_to_warning&gt;</code></p>
</div></div></td>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><code>warning</code>​ フラグの後には、ルールセット YAML の警告の重要度レベルセクションに移動するルールのルール ID が続きます。</p>
</div></div></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><code>--info=&lt;list_rules_to_move_to_info&gt;</code></p>
</div></div></td>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><code>info</code>​ フラグの後には、ルールセット YAML の情報の重要度レベルセクションに移動するルールのルール ID が続きます。</p>
</div></div></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><code>--remove=&lt;list_rules_to_disable&gt;</code></p>
</div></div></td>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><code>remove</code>​ フラグの後には、ルールセット YAML でコメントアウトして実質的に無効にするルールのルール ID が続きます。</p>
</div></div></td>
</tr>
</tbody>
</table>

**コマンド例:**

```copy
anypoint-cli-v4 governance:ruleset:clone ~/Downloads/ruleset.yaml 'New Ruleset from Clone' 'Cloned from ruleset.yaml' --warning=operation-default-response,operation-operationId > mynewruleset.yaml

anypoint-cli-v4 governance:ruleset:clone 68ef9520-24e9-4cf2-b2f5-620025690913/anypoint-best-practices/1.0.2 'Custom Anypoint Best Practices' 'Cloned from MuleSoft Anypoint Best Practices' --remote --remove=openapi-tags,operation-tags > my-anypoint-best-practices.yaml
```

## [](#governance-ruleset-info)governance:ruleset:info

`> governance:ruleset:info <governance-ruleset> [フラグ]`

このコマンドは、​`governance-ruleset`​ パラメーターで渡されたルールセット定義のルールセットルールをリストします。

<table><tbody><tr><td class="icon"><i class="fa icon-note" title="Note"></i></td><td class="content">このコマンドには複数オプションのフラグがあります。コマンドで複数オプションのフラグを使用する場合は、フラグの前にパラメーターを置くか、パラメーターの前に「-- 」(2 つのダッシュの後にスペース) を使用します。</td></tr></tbody></table>

このコマンドでは、デフォルトのフラグ以外に次のフラグも受け入れます。

<table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 35%;">
<col style="width: 65%;">
</colgroup>
<thead>
<tr>
<th class="tableblock halign-left valign-top">フラグ</th>
<th class="tableblock halign-left valign-top">説明</th>
</tr>
</thead>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><code>--remote</code></p>
</div></div></td>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p>情報を取得するルールセットが Exchange でパブリッシュされていること、および ​<code>ruleset</code>​ パラメーターがルールセットのアセット識別子であることを示します。アセット識別子は、Exchange 内のアセットを一意に識別するグループ ID、アセット ID、およびバージョン (GAV) です。例: <code>&lt;group_id&gt;/&lt;asset_id&gt;/&lt;version&gt;</code>​。ここで、​<code>&lt;version&gt;</code>​ は ​<code>latest</code>​ の特定のバージョンです。バージョンとして ​<code>latest</code>​ を使用する場合、プロファイルの作成後にバージョンがパブリッシュされると、プロファイルはルールセットの最新バージョンを自動的に使用します。</p>
</div>
<div class="paragraph">
<p><a href="#exchange-asset-identifiers">Exchange アセット識別子 (GAV) を取得する</a>​を参照してください。</p>
</div></div></td>
</tr>
</tbody>
</table>

**コマンド例:**

```copy
anypoint-cli-v4 governance:ruleset:info myrulesetfolder/myruleset.yaml

anypoint-cli-v4 governance:ruleset:info 68ef9520-24e9-4cf2-b2f5-620025690913/anypoint-best-practices/1.0.2 --remote

anypoint-cli-v4  governance:ruleset:info 68ef9520-24e9-4cf2-b2f5-620025690913/anypoint-best-practices/latest --remote
```

**出力例:**

Ruleset myrulesetfolder/myruleset.yaml
Ruleset conforms with Dialect
╔═══════════╤═══════════════════════════════════╗
║ Violation │ security-fields-operation-empty   ║
╟───────────┼───────────────────────────────────╢
║ Violation │ access-tokens-oauth2-cleartext    ║
╟───────────┼───────────────────────────────────╢
║ Violation │ insecure-oauth2-grants            ║
╟───────────┼───────────────────────────────────╢
║ Violation │ api-keys-in-cookie                ║
╟───────────┼───────────────────────────────────╢
║ Violation │ api-keys-in-query                 ║
╟───────────┼───────────────────────────────────╢
║ Violation │ api-keys-in-header                ║
╟───────────┼───────────────────────────────────╢
║ Violation │ api-negotiates-authentication     ║
╟───────────┼───────────────────────────────────╢
║ Violation │ insecure-basic-auth               ║
╟───────────┼───────────────────────────────────╢
║ Violation │ bearer-token-cleartext            ║
╟───────────┼───────────────────────────────────╢
║ Violation │ http-token-cleartext              ║
╟───────────┼───────────────────────────────────╢
║ Violation │ oauth2-redirections-non-encrypted ║
╟───────────┼───────────────────────────────────╢
║ Violation │ unknown-security-scheme           ║
╟───────────┼───────────────────────────────────╢
║ Violation │ valid-server-urltemplate          ║
╟───────────┼───────────────────────────────────╢
║ Violation │ valid-oauth2-redirection-urls     ║
╟───────────┼───────────────────────────────────╢
║ Warning   │ unknown-security-scheme           ║
╟───────────┼───────────────────────────────────╢
║ Warning   │ oauth1-deprecated                 ║
╚═══════════╧═══════════════════════════════════╝

## [](#governance-ruleset-init)governance:ruleset:init

`> governance:ruleset:init [フラグ] <schema>`

このコマンドは、​`schema`​ パラメーターで渡されたデータスキーマに基づいてルールセットを初期化します。

このコマンドでは、デフォルトのフラグ以外に次のフラグも受け入れます。

<table class="tableblock frame-all grid-all stretch">
<colgroup>
<col style="width: 35%;">
<col style="width: 65%;">
</colgroup>
<thead>
<tr>
<th class="tableblock halign-left valign-top">フラグ</th>
<th class="tableblock halign-left valign-top">説明</th>
</tr>
</thead>
<tbody>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><code>--types &lt;types&gt;</code></p>
</div></div></td>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><code>types</code>​ フラグは、ルールとしてエクスポートする対象種別を指定します。​<code>governance:api:inspect</code>​ コマンドを使用して、このフラグで指定する種別を特定できます。​<a href="#governance-api-inspect">governance:api:inspect</a>​を参照してください。</p>
</div></div></td>
</tr>
<tr>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><code>--name &lt;name&gt;</code></p>
</div></div></td>
<td class="tableblock halign-left valign-top"><div class="content"><div class="paragraph">
<p><code>name</code>​ フラグはルールセットの名前です。デフォルトは ​<code>GeneratedRuleset</code>​ です。</p>
</div></div></td>
</tr>
</tbody>
</table>

**コマンド例:**

```copy
anypoint-cli-v4 governance:ruleset:init --types patientmultipleBirthBoolean,patientBundle,patientmultipleBirthInteger --name=my-ruleset mydataschema
```

## [](#governance-ruleset-validate)governance:ruleset:validate

`> governance:ruleset:validate [フラグ] <governance-ruleset>`

このコマンドは、​`governance-ruleset`​ パラメーターを使用して渡されたルールセット定義を検証します。​`governance-ruleset`​ パラメーターとして、次のいずれかを渡すことができます。

- ルールセット定義 YAML ファイル
- ルールセットをメインファイルとして指定する ​`exchange.json`​ ファイルを使用した API プロジェクトを含む ZIP ファイル
- ルールセットをメインファイルとして指定する ​`exchange.json`​ ファイルを使用する API プロジェクトを含むフォルダー

このコマンドでは、デフォルトのフラグのみを受け入れます。

**コマンド例:**

```copy
anypoint-cli-v4 governance:ruleset:validate ~/myrulesetfolder/myruleset.yaml

anypoint-cli-v4 governance:ruleset:validate ~/myrulesetfolder/myruleset.zip

anypoint-cli-v4 governance:ruleset:validate ~/myrulesetfolder/myrulesetfolder
```

**有効なルールセットの出力例:**

Ruleset User/myuser/myrulesetfolder/myruleset.yaml
Ruleset conforms with Dialect

**無効なルールセットの出力例:**

Ruleset does not conform with Dialect
ModelId: file:///Users/myuser/myrulesetfolder/prof-1-bad.yaml
Profile: Validation Profile 1.0
Conforms: false
Number of results: 1

Level: Violation

- Constraint: http://a.ml/amf/default\_document#/declarations/profileNode\_profile\_required\_validation
  Message: Property 'profile' is mandatory
  Severity: Violation
  Target: file:///Users/myuser/myrulesetfolder/prof-1-bad.yaml#/encodes
  Property: http://schema.org/name
  Range: \[(3,0)-(11,19)\]
  Location: file:///Users/myuser/myrulesetfolder/prof-1-bad.yaml

### [](#exchange-asset-identifiers)Exchange アセット識別子 (GAV) を取得する

Exchange アセットの GAV を取得するには、次の操作を実行します。

- Exchange CLI を使用している場合、​`exchange:asset:list`​ コマンドを実行します。
- Exchange Web UI を使用している場合、Exchange でアセットを選択し、URL からグループ ID とアセット ID をコピーします。次に、表示しているバージョンのバージョンノードを追加します。たとえば、Exchange の「OpenAPI Best Practices (OpenAPI ベストプラクティス)」ルールセットの GAV は ​`68ef9520-24e9-4cf2-b2f5-620025690913/open-api-best-practices/1.0.1`​ です。