---
sourceDocument: Xanadu API リファレンス
sourceDocumentLink: https://servicenow-prod.fluidtopics.net/r/ja-JP/xanadu/api-reference

 Release :

    - xanadu

ft:locale :

    - ja-JP

ft:publication_title :

    - Xanadu API リファレンス

ft:clusterId :

    - crapiref

bundleId :

    - crapiref

workflow :

    - Creator


---

# アプリケーションサービス API

# アプリケーションサービス API {#ariaid-title1}

* リリースバージョン: Xanadu
* 
* 更新日 2024年08月01日
* 
* ![](https://www.servicenow.com/docs/portal-asset/ico-clock) 所要時間：35分

アプリケーションサービス API は、アプリケーションサービスの作成、変更、および更新を可能にするエンドポイントを提供します。

この API を使用するには、ユーザーにアプリケーションサービス管理者の \[app_service_admin\] ロールが必要です。  
重要:  
Rome リリース以降、アプリケーションサービス API は拡張もサポートもされなくなりました。詳細については、Now Support ナレッジベースの「[Deprecation Process (廃止プロセス) \[KB0867184\]](https://support.servicenow.com/kb_view.do?sysparm_article=KB0867184)」の記事を参照してください。

## アプリケーションサービス - GET /now/cmdb/app_service/{sys_id}/getContent {#ariaid-title2}

マップされたアプリケーションサービスの構成アイテム (CI) のリストとそれらの関係を取得します。手動で作成されたサービスのコンテンツのみを取得します。

### URL 形式 {#appservice-GET-getContent__section_lwf_psn_wlb}

デフォルトの URL：/api/now/cmdb/app_service/{sys_id}/getContent

### サポートされている要求パラメーター

{#appservice-GET-getContent__entry__2}

| 名前 | 説明 |
|-|-|
| sys_id | マッピングされたアプリケーションサービスのSys_id。マップ済みアプリケーションサービス \[cmdb_ci_service_discovered\] テーブルにあります。 データタイプ：文字列 |
[表 : 1. パスパラメーター]

{#appservice-GET-getContent__entry__6}

| 名前 | 説明 |
|-|-|
| モード | 返される関係性データの量。 有効な値： * 簡易 (Shallow)：サービス内の CI 間の親と子の関係を返します。 * 完全：簡易 (shallow) モードで返されるデータに加えて、CI 属性とルックアップ情報を返します。 {#appservice-GET-getContent__ul_mcl_cl4_ndb} 値の大文字と小文字は区別されません。 データタイプ：文字列 |
[表 : 2. クエリパラメーター]

{#appservice-GET-getContent__entry__10}

| 名前 | 説明 |
|-|-|
| なし |   |
[表 : 3. 要求本文パラメーター (XML または JSON)]

### ヘッダー

次のリクエストや応答ヘッダーは、この HTTP アクションにのみ適用されるか、またはこのアクションに別個の方法で適用されます。REST API で使用される一般的なヘッダーのリストについては、「 [サポートされている REST API ヘッダー](https://servicenow-prod.fluidtopics.net/ldF_qFEQnejbeXLBxcUhWg "REST (REpresentational State Transfer) は、Web 上のコンピューターシステム間の標準を提供し、相互の通信を容易にするシンプルなステートレスアーキテクチャです。")」を参照してください。
{#appservice-GET-getContent__entry__14}{#appservice-GET-getContent__accept-RESTAPI}

| ヘッダー | 説明 |
|-|-|
| 承認 | 応答本文のデータフォーマット。サポートされるタイプ：application/json または application/xml。 デフォルト： application/json |
[表 : 4. 要求ヘッダー]

{#appservice-GET-getContent__entry__18}

| ヘッダー | 説明 |
|-|-|
| なし |   |
[表 : 5. 応答ヘッダー]

### ステータスコード

この HTTP アクションには、次のステータスコードが適用されます。REST API で使用される可能性のあるステータスコードのリストについては、「 [REST API HTTP 応答コード](https://servicenow-prod.fluidtopics.net/ldF_qFEQnejbeXLBxcUhWg "REST (REpresentational State Transfer) は、Web 上のコンピューターシステム間の標準を提供し、相互の通信を容易にするシンプルなステートレスアーキテクチャです。")」を参照してください。
{#appservice-GET-getContent__entry__22}{#appservice-GET-getContent__entry-200-status-code}{#appservice-GET-getContent__entry-400-status-code}{#appservice-GET-getContent__entry-401-appservice}{#appservice-GET-getContent__entry-500-status-code}

| ステータスコード | 説明 |
|-|-|
| 200 | 成功。要求が正常に処理されました。 |
| 400 | 要求が正しくありません。不適切な要求タイプまたは誤った要求が検出されました。 |
| 401 | 権限がありません。ユーザー資格情報が間違っているか、app_service_admin ロールがありません。 |
| 500 | 内部サーバーエラー。要求の処理中に予期しないエラーが発生しました。応答に、エラーに関する追加情報が含まれます。 |
[表 : 6. ステータスコード]

### 応答本文のパラメーター (JSON または XML)

{#appservice-GET-getContent__table_nyj_nl4_wlb__entry__2}

| 名前 | 説明 |
|-|-|
| cmdb | 指定されたアプリケーションサービスに関連する CI を記述するオブジェクトのリスト。 データタイプ：オブジェクト "cmdb": [ { "items": {Object}, "relations": [Array] } ] |
| cmdb.items | アプリケーションサービス内の CI。完全なクエリパラメーターが要求で渡された場合、このセクションには、各 CI の属性とルックアップ情報が含まれます。 データタイプ：アレイ "items": [ { "className": "String", "values": {Object} } ] |
| cmdb.items.className | CI が含まれるクラスの名前。 データタイプ：文字列 |
| cmdb.items.values | 関連する CI を特定するために使用する情報。 データタイプ：オブジェクト "values": { "name": "String", "sys_id": "String" } |
| cmdb.items.values.name | CI の名前。 データタイプ：文字列 |
| cmdb.items.values.sys_id | CI の sys_id。 データタイプ：文字列 |
| cmdb.relations | ホストやその子など、関連する CI の関係性データ。 データタイプ：アレイ |
| service | 識別されたサービスに関連するサービスのリスト。 データタイプ：アレイ "service": [ { "name": "String", "service_relations": [Array], "url": "String" } ] |
| service.name | アプリケーションサービスの名前。 データタイプ：文字列 |
| service.service_relations | アプリケーションサービス内の CI の階層データ。すべての CI は親 CI および子 CI とペアを形成します。アプリケーションサービスのエントリーポイントと呼ばれるトップレベル CI には親 CI がありません。 データタイプ：アレイ "service_relations": [ { "child": "String", "parent": "String" } ] |
| service.service_relations.child | CI に関連する子 CI の名前。 データタイプ：文字列 |
| service.service_relations.parent | CI に関連する親 CI の名前。 データタイプ：文字列 |
| service.url | アプリケーションサービスへの相対パス。 データタイプ：文字列 |
[ ]

{#appservice-GET-getContent__table_nyj_nl4_wlb}  

### サンプル cURL 要求

    curl "https://instance.servicenow.com/api/now/cmdb/app_service/2fce42d80a0a0bb4004af34d7e3984c8/getContent?mode=shallow" \
    --request GET \
    --header "Accept:application/json" \
    --user 'username':'password'

    {
      "service": {
        "name": "PeopleSoft Portals",
        "url": "/api/now/table/cmdb_ci_service_discovered/2fce42d80a0a0bb4004af34d7e3984c8",
        "service_relations": [
          {
            "parent": "",
            "child": "3a2810c20a0a0bb400268337d6e942ca"
          },
          {
            "parent": "3a27f1520a0a0bb400ecd6ff7afcf036",
            "child": "3a5dd3dbc0a8ce0100655f1ec66ed42c"
          },
          {
            "parent": "3a290cc60a0a0bb400000bdb386af1cf",
            "child": "3a307c930a0a0bb400353965d0b8861f"
          },
          {
            "parent": "3a172e820a0a0bb40034228e9f65f1be",
            "child": "3a27d4370a0a0bb4006316812bf45439"
          },
          {
            "parent": "",
            "child": "3a172e820a0a0bb40034228e9f65f1be"
          },
          {
            "parent": "",
            "child": "3a27f1520a0a0bb400ecd6ff7afcf036"
          },
          {
            "parent": "3a2810c20a0a0bb400268337d6e942ca",
            "child": "3a290cc60a0a0bb400000bdb386af1cf"
          }
        ]
      },
      "cmdb": {
        "relations": [],
        "items": [
          {
            "values": {
              "sys_id": "3a172e820a0a0bb40034228e9f65f1be",
              "name": "PS LoadBal01"
            },
            "className": "cmdb_ci_win_server"
          },
          {
            "values": {
              "sys_id": "3a2810c20a0a0bb400268337d6e942ca",
              "name": "PS Apache03"
            },
            "className": "cmdb_ci_web_server"
          },
          {
            "values": {
              "sys_id": "55b35562c0a8010e01cff22378e0aea9",
              "name": "ny8500-nbxs08"
            },
            "className": "cmdb_ci_netgear"
          },
          {
            "values": {
              "sys_id": "3a27f1520a0a0bb400ecd6ff7afcf036",
              "name": "PS Apache02"
            },
            "className": "cmdb_ci_web_server"
          },
          {
            "values": {
              "sys_id": "3a307c930a0a0bb400353965d0b8861f",
              "name": "PS ORA01"
            },
            "className": "cmdb_ci_database"
          }
        ]
      }
    }

## アプリケーションサービス - GET /now/cmdb/csdm/app_service/find_service {#ariaid-title3}

指定されたアプリケーションサービスとそれに関連するビジネスコンテキストに関する基本情報を返します。
注:  
このエンドポイントは廃止されました。代わりに [SG サービス -- POST -- /sg_services/app_service/find](https://servicenow-prod.fluidtopics.net/BQlKaxyWfOmB_60~J8uyjg#sg_svcs-POST-find "指定されたアプリケーションサービスとそのアップストリームの関係の詳細を検索します。") を使用してください。

### URL 形式

デフォルトの URL：/api/now/cmdb/csdm/app_service/find_service

### サポートされている要求パラメーター

{#appservice-GET-find_service__entry__2}

| 名前 | 説明 |
|-|-|
| なし |   |
[表 : 7. パスパラメーター]

{#appservice-GET-find_service__entry__6}

| 名前 | 説明 |
|-|-|
| name | number が渡されない場合は必須です。情報を返すサービスの名前。アプリケーションサービス \[cmdb_ci_service_auto\] テーブルにあります。 データタイプ：文字列 |
| number | name が渡されない場合は必須です。情報を返すアプリケーションサービスを特定する一意の番号。アプリケーションサービス \[cmdb_ci_service_auto\] テーブルにあります。 データタイプ：文字列 |
[表 : 8. クエリパラメータ]

{#appservice-GET-find_service__entry__12}

| 名前 | 説明 |
|-|-|
| なし |   |
[表 : 9. 要求本文パラメーター (XML または JSON)]

### ヘッダー

次のリクエストや応答ヘッダーは、この HTTP アクションにのみ適用されるか、またはこのアクションに別個の方法で適用されます。REST API で使用される一般的なヘッダーのリストについては、「 [サポートされている REST API ヘッダー](https://servicenow-prod.fluidtopics.net/ldF_qFEQnejbeXLBxcUhWg "REST (REpresentational State Transfer) は、Web 上のコンピューターシステム間の標準を提供し、相互の通信を容易にするシンプルなステートレスアーキテクチャです。")」を参照してください。
{#appservice-GET-find_service__entry__16}{#appservice-GET-find_service__accept-JSON-only-entry-RESTAPI}

| ヘッダー | 説明 |
|-|-|
| 承認 | 応答本文のデータフォーマット。application/json のみをサポートします。 |
[表 : 10. 要求ヘッダー]

{#appservice-GET-find_service__entry__20}

| ヘッダー | 説明 |
|-|-|
| なし |   |
[表 : 11. 応答ヘッダー]

### ステータスコード

この HTTP アクションには、次のステータスコードが適用されます。REST API で使用される可能性のあるステータスコードのリストについては、「 [REST API HTTP 応答コード](https://servicenow-prod.fluidtopics.net/ldF_qFEQnejbeXLBxcUhWg "REST (REpresentational State Transfer) は、Web 上のコンピューターシステム間の標準を提供し、相互の通信を容易にするシンプルなステートレスアーキテクチャです。")」を参照してください。
{#appservice-GET-find_service__table_wwn_rhd_ct__entry__2}{#appservice-GET-find_service__entry-200-status-code}{#appservice-GET-find_service__entry-400-status-code}{#appservice-GET-find_service__entry-401-appservice}{#appservice-GET-find_service__entry-500-status-code}

| ステータスコード | 説明 |
|-|-|
| 200 | 成功。要求が正常に処理されました。 |
| 400 | 要求が正しくありません。不適切な要求タイプまたは誤った要求が検出されました。 |
| 401 | 権限がありません。ユーザー資格情報が間違っているか、app_service_admin ロールがありません。 |
| 500 | 内部サーバーエラー。要求の処理中に予期しないエラーが発生しました。応答に、エラーに関する追加情報が含まれます。 |
[表 : 12. ステータスコード]

{#appservice-GET-find_service__table_wwn_rhd_ct}

### 応答本文のパラメーター (JSON または XML)

{#appservice-GET-find_service__entry__34}{#appservice-GET-find_service__entry-error-appservice}{#appservice-GET-find_service__entry-error-details-appservice}{#appservice-GET-find_service__entry-error-message-appservice}

| 名前 | 説明 |
|-|-|
| error | 発生したエラーを説明します。 データタイプ：オブジェクト "error": { "details": "String", "message": "String" } |
| error.details | エラーに関する追加情報。 データタイプ：文字列 |
| error.message | エラーを説明するメッセージ。 データタイプ：文字列 |
| のサービス | オブジェクトのアレイ。各オブジェクトには、指定されたアプリケーションサービスに関連付けられたサービスの詳細が含まれています。 データタイプ：アレイ "services": [ { "environment": "String", "name": "String", "number": "String", "relationships": {Object}, "sys_id": "String", "version": "String" } ] |
| services.environment | アプリケーションサービスが展開されている環境 (「本番」や「テストラボ 2」など)。これは、実装者が理解できる任意の値にすることができます。 データタイプ：文字列 最大長：40 デフォルト：null |
| services.name | 必須です。アプリケーションサービスの名前。他のすべてのアプリケーションサービスからの一意の名前である必要があります。 データタイプ：文字列 最大長：255 |
| services.number | アプリケーションサービスを特定する一意の番号。この値は最初にエンドポイントによって生成されます。 データタイプ：文字列 |
| services.relationships | アプリケーションサービスに関連付けられたサービスタイプ。 データタイプ：オブジェクト "relationships": { "business_app": [Array], "business_service_offering": [Array], "technical_service_offering": [Array] } |
| services.relationships.business_app | アプリケーションサービスに関連するビジネスアプリケーションの sys_id のリスト。 データタイプ：アレイ |
| services.relationships.technical_service_offering | アプリケーションサービスに関連するビジネスサービスオファリングの sys_id のリスト。 データタイプ：アレイ |
| services.relationships.business_service_offering | アプリケーションサービスに関連するテクニカルサービスオファリングの sys_id のリスト。 データタイプ：アレイ |
| services.sys_id | アプリケーションサービスの sys_id。 データタイプ：文字列 |
| services.version | アプリケーションサービスのバージョン番号。 データタイプ：文字列 最大長：40 形式：ユーザー定義可能 デフォルト：null |
[ ]

### サンプル cURL 要求

    curl -X GET \
      https://instance.servicenow.com/api/now/cmdb/csdm/app_service/find_service?name=Email_East&number=SNSVC0001018 \
      -H 'Accept: application/json' \
      -u 'username':'password'

    {
    "result": {
      "services": [
        {
          "name": "Email_East",
          "number": "SNSVC0001018",
          "sys_id": "f809cb60db94101037740f95ca96190f",
          "environment": "Production",
          "version": "1.1.1",
          "relationships": {
            "business_app": [
              "658c7620db54101037740f95ca9619f2"
            ],
            "technical_service_offering": [],
            "business_service_offering": [
              "069c7e20db54101037740f95ca9619bf"
            ]
          }
        }
      ]
     }
    }

## アプリケーションサービス - POST /now/cmdb/app_service/create {#ariaid-title4}

アプリケーションサービスを作成するか、既存のアプリケーションサービスを更新します。

### URL 形式

デフォルトの URL：/api/now/cmdb/app_service/create

### サポートされている要求パラメーター

{#createService-POST-api-now-cmdb-app__entry__2}

| パラメーター | 説明 |
|-|-|
| なし |   |
[表 : 13. パラメーター]

### ヘッダー

次のリクエストや応答ヘッダーは、この HTTP アクションにのみ適用されるか、またはこのアクションに別個の方法で適用されます。REST API で使用される一般的なヘッダーのリストについては、「 [サポートされている REST API ヘッダー](https://servicenow-prod.fluidtopics.net/ldF_qFEQnejbeXLBxcUhWg "REST (REpresentational State Transfer) は、Web 上のコンピューターシステム間の標準を提供し、相互の通信を容易にするシンプルなステートレスアーキテクチャです。")」を参照してください。
{#createService-POST-api-now-cmdb-app__entry__6}{#createService-POST-api-now-cmdb-app__accept-RESTAPI}{#createService-POST-api-now-cmdb-app__content_type-RESTAPI}

| ヘッダー | 説明 |
|-|-|
| 承認 | 応答本文のデータフォーマット。サポートされるタイプ：application/json または application/xml。 デフォルト： application/json |
| Content-Type | 要求本文のデータ形式。サポートされるタイプ：application/json または application/xml。 デフォルト： application/json |
[表 : 14. 要求ヘッダー]

{#createService-POST-api-now-cmdb-app__entry__12}

| ヘッダー | 説明 |
|-|-|
| なし |   |
[表 : 15. 応答ヘッダー]

### ステータスコード

次のリクエストや応答ヘッダーは、この HTTP アクションにのみ適用されるか、またはこのアクションに別個の方法で適用されます。REST API で使用される一般的なヘッダーのリストについては、「 [サポートされている REST API ヘッダー](https://servicenow-prod.fluidtopics.net/ldF_qFEQnejbeXLBxcUhWg "REST (REpresentational State Transfer) は、Web 上のコンピューターシステム間の標準を提供し、相互の通信を容易にするシンプルなステートレスアーキテクチャです。")」を参照してください。
{#createService-POST-api-now-cmdb-app__table_wwn_rhd_ct__entry__2}{#createService-POST-api-now-cmdb-app__entry-200-status-code}{#createService-POST-api-now-cmdb-app__entry-400-status-code}{#createService-POST-api-now-cmdb-app__entry-401-status-code}

| ステータスコード | 説明 |
|-|-|
| 200 | 成功。要求が正常に処理されました。 |
| 400 | 要求が正しくありません。不適切な要求タイプまたは誤った要求が検出されました。 |
| 401 | 権限がありません。ユーザー資格情報が間違っているか、渡されていません。 |
[表 : 16. ステータスコード]

{#createService-POST-api-now-cmdb-app__table_wwn_rhd_ct}

### 要求本文

API は、次の JSON 要素を要求本文で受け入れます。さらに、マップ済みアプリケーションサービス \[cmdb_ci_service_discovered\] テーブルから任意のフィールドを追加して、アプリケーションサービスレコードにデータを渡すことができます。たとえば、Comments フィールドにコンテンツを追加するには、JSON 要求に `"comments": "Passing data to the Comments field"` を追加します。
{#createService-POST-api-now-cmdb-app__table_rm1_yjd_kv__entry__2}

| 要素 | 説明 |
|-|-|
| name | 作成または更新するアプリケーションサービスの名前。 |
| service_relations | CI とそれらが形成する階層に関する情報。すべての CI は親 CI および子 CI とペアを形成します。アプリケーションサービスのエントリーポイントと呼ばれるトップレベル CI には親 CI がありません。 |
| parent | 送信接続によりこの CI がマップ階層の下位レベルの CI と結合される CI の sys_id。 |
| child | 受信接続によりこの CI がマップ階層の上位レベルにある CI と結合される CI の sys_id。 |
[表 : 17. 要求本文で受け入れられる要素]

{#createService-POST-api-now-cmdb-app__table_rm1_yjd_kv}

### 応答本文

API は、次の JSON 要素を応答本文で返します。
{#createService-POST-api-now-cmdb-app__table_mc1_pr1_tx__entry__2}

| 要素 | 説明 |
|-|-|
| URL | アプリケーションサービスレコードの sys_id を表示するための標準テーブル REST API の URL。 この要素は、エンドポイントが成功した場合にのみ表示されます。 データタイプ：文字列 |
| getContentUrl | アプリケーションサービスコンテンツを取得するための REST API パス。 この要素は、エンドポイントが成功した場合にのみ表示されます。 データタイプ：文字列 |
| info | アプリケーションサービスに追加された CI の数。 この要素は、エンドポイントが成功した場合にのみ表示されます。 データタイプ：文字列 |
| error | エラーメッセージの詳細。 この要素は、エンドポイントが失敗した場合にのみ表示されます。 データタイプ：オブジェクト |
| message | 失敗の内容を説明するエラーメッセージ。 この要素は、エンドポイントが失敗した場合にのみ表示されます。 データタイプ：文字列 |
| status | REST API が失敗した場合は、ステータス「failure」になります。 この要素は、エンドポイントが失敗した場合にのみ表示されます。 データタイプ：文字列 |
[表 : 18. 応答本文で返される要素]

{#createService-POST-api-now-cmdb-app__table_mc1_pr1_tx}  

### サンプル cURL 要求

    curl "http://<instance.servicenow.com>/api/now/cmdb/app_service/create" \
    --request POST \
    --header "Accept:application/json" \
    --header "Content-Type:application/json" \
    --data "{
    \"name\": \"myTestAppService\",
    \"comments\": \"Passing data to the Comments field\",
    \"service_relations\": [
    { \"parent\": \"\",
    \"child\": \"3a70f789c0a8ce010091b0ea635b982a\"
    },{ \"parent\": \"3a70f789c0a8ce010091b0ea635b982a\",
    \"child\": \"b4fd7c8437201000deeabfc8bcbe5dc1\"
    },{ \"parent\": \"b4fd7c8437201000deeabfc8bcbe5dc1\",
    \"child\": \"53fdbc8437201000deeabfc8bcbe5d10\"
    }
    ]
    }" \
    --user 'admin':'admin'

    {
      "result": {
        "url": "/api/now/table/cmdb_ci_service_discovered/b1cff89fc9e19300964fcbb1ac3059a5",
        "getContentUrl": "/api/now/cmdb/app_service/b1cff89fc9e19300964fcbb1ac3059a5/getContent",
        "info": "3 CIs added to service"
      }
    }

## アプリケーションサービス - POST /now/cmdb/csdm/app_service/register_service {#ariaid-title5}

アプリケーションサービス \[cmdb_ci_service_auto\] テーブルにアプリケーションサービスレコードのスタブを作成し、渡された情報を入力します。
レコードを保存する前に、渡されたパラメーターとアプリケーションサービス名の一意性が検証されます。また、指定されたビジネスアプリケーション、ビジネスサービスオファリング、およびテクニカルサービスオファリングをサービスアプリケーションに関連付けることによって、サービスにビジネスコンテキストを提供するアップストリームの関係を作成します。インフラストラクチャへのダウンストリームの関係は作成されません。ダウンストリームの関係を定義するには、アプリケーションサービス - PUT /now/cmdb/csdm/app_service/{service_sys_id}/populate_service エンドポイントを呼び出す必要があります。  
注:  
このエンドポイントは廃止されました。代わりに [SG サービス -- POST -- /sg_services/app_service/register](https://servicenow-prod.fluidtopics.net/BQlKaxyWfOmB_60~J8uyjg#sg_svcs-POST-register "アプリケーションサービス、タグを作成し、ビジネスアプリケーション、ビジネスサービスオファリング、その他のアプリケーションサービスなどのアップストリームの関係をビルドします。") を使用してください。

### URL 形式

デフォルトの URL：/api/now/cmdb/csdm/app_service/register_service

### サポートされている要求パラメーター

{#appservice-POST-register_service__entry__2}

| 名前 | 説明 |
|-|-|
| なし |   |
[表 : 19. パスパラメーター]

{#appservice-POST-register_service__entry__6}

| 名前 | 説明 |
|-|-|
| なし |   |
[表 : 20. クエリパラメータ]

{#appservice-POST-register_service__entry__10}{#appservice-POST-register_service__entry-basic_details-environment-appservice}{#appservice-POST-register_service__entry-basic_details-name-appservice}{#appservice-POST-register_service__entry-basic_details-version-appservice}{#appservice-POST-register_service__entry-relationships-bus_app-appservice}{#appservice-POST-register_service__entry-relationships-bus_srv_off-appservice}{#appservice-POST-register_service__entry-relationships-tech_srv_off-appservice}

| 名前 | 説明 |
|-|-|
| basic_details | 必須です。指定されたアプリケーションサービスに関連付けられたサービスの詳細。 データタイプ：オブジェクト "basic_details": { "environment": "String", "name": "String", "version": "String" } |
| basic_details.environment | アプリケーションサービスが展開されている環境 (「本番」や「テストラボ 2」など)。これは、実装者が理解できる任意の値にすることができます。 データタイプ：文字列 最大長：40 デフォルト：null |
| basic_details.name | 必須です。アプリケーションサービスの名前。他のすべてのアプリケーションサービスからの一意の名前である必要があります。 データタイプ：文字列 最大長：255 |
| basic_details.version | アプリケーションサービスのバージョン番号。 データタイプ：文字列 最大長：40 形式：ユーザー定義可能 デフォルト：null |
| relationships | アプリケーションサービスに関連付けるアップストリーム (親) サービスタイプ。これらの関係は CI 関係性 \[cmdb_rel_ci\] テーブルに保存されます。 データタイプ：オブジェクト "relationships": { "business_app": [Array], "business_service_offering": [Array], "technical_service_offering": [Array] } |
| relationships.business_app | アプリケーションサービスに関連付けるビジネスアプリケーションの sys_id のリスト。 データタイプ：アレイ |
| relationships.business_service_offering | アプリケーションサービスに関連付けるビジネスサービスオファリングの sys_id のリスト。 データタイプ：アレイ |
| relationships.technical_service_offering | アプリケーションサービスに関連付けるテクニカルサービスオファリングの sys_id のリスト。 データタイプ：アレイ |
[表 : 21. 要求本文パラメーター]

### ヘッダー

次のリクエストや応答ヘッダーは、この HTTP アクションにのみ適用されるか、またはこのアクションに別個の方法で適用されます。REST API で使用される一般的なヘッダーのリストについては、「 [サポートされている REST API ヘッダー](https://servicenow-prod.fluidtopics.net/ldF_qFEQnejbeXLBxcUhWg "REST (REpresentational State Transfer) は、Web 上のコンピューターシステム間の標準を提供し、相互の通信を容易にするシンプルなステートレスアーキテクチャです。")」を参照してください。
{#appservice-POST-register_service__table_hxm_cks_mlb__entry__2}{#appservice-POST-register_service__accept-JSON-only-entry-RESTAPI}{#appservice-POST-register_service__content_type-JSON-only-entry-RESTAPI}

| ヘッダー | 説明 |
|-|-|
| 承認 | 応答本文のデータフォーマット。application/json のみをサポートします。 |
| Content-Type | 要求本文のデータ形式。application/json のみをサポートします。 |
[表 : 22. 要求ヘッダー]

{#appservice-POST-register_service__table_hxm_cks_mlb} {#appservice-POST-register_service__entry__34}

| ヘッダー | 説明 |
|-|-|
| なし |   |
[表 : 23. 応答ヘッダー]

### ステータスコード

この HTTP アクションには、次のステータスコードが適用されます。REST API で使用される可能性のあるステータスコードのリストについては、「 [REST API HTTP 応答コード](https://servicenow-prod.fluidtopics.net/ldF_qFEQnejbeXLBxcUhWg "REST (REpresentational State Transfer) は、Web 上のコンピューターシステム間の標準を提供し、相互の通信を容易にするシンプルなステートレスアーキテクチャです。")」を参照してください。
{#appservice-POST-register_service__table_wwn_rhd_ct__entry__2}{#appservice-POST-register_service__entry-400-status-code}{#appservice-POST-register_service__entry-401-appservice}{#appservice-POST-register_service__entry-500-status-code}

| ステータスコード | 説明 |
|-|-|
| 201 | 成功。アプリケーションサービスが正常に登録されました。 |
| 400 | 要求が正しくありません。不適切な要求タイプまたは誤った要求が検出されました。 |
| 401 | 権限がありません。ユーザー資格情報が間違っているか、app_service_admin ロールがありません。 |
| 500 | 内部サーバーエラー。要求の処理中に予期しないエラーが発生しました。応答に、エラーに関する追加情報が含まれます。 |
[表 : 24. ステータスコード]

{#appservice-POST-register_service__table_wwn_rhd_ct}

### 応答本文のパラメーター (JSON または XML)

{#appservice-POST-register_service__entry__48}{#appservice-POST-register_service__entry-error-appservice}{#appservice-POST-register_service__entry-error-details-appservice}{#appservice-POST-register_service__entry-error-message-appservice}

| 名前 | 説明 |
|-|-|
| error | 発生したエラーを説明します。 データタイプ：オブジェクト "error": { "details": "String", "message": "String" } |
| error.details | エラーに関する追加情報。 データタイプ：文字列 |
| error.message | エラーを説明するメッセージ。 データタイプ：文字列 |
| number | アプリケーションサービスを特定する一意の番号。この番号はエンドポイントによって生成されます。 |
| service_sys_id | 登録されたアプリケーションサービスの sys_id。 |
[ ]

### サンプル cURL 要求

    curl -X POST \
      https://instance.servicenow.com/api/now/cmdb/csdm/app_service/register_service \
      -H 'Accept: application/json' \
      -H 'Content-Type: application/json' \
      -u 'username':'password'
      -d '{
      "basic_details": {
        "environment": "Test Lab 2",
        "name": "Test Lab 2",
        "version": "1.1.1"
      },
      "relationships": {
        "business_app":["f07c7620db54101037740f95ca96199a"],
        "business_service_offering":["069c7e20db54101037740f95ca9619bf"]
      }
    }'

    {
      "result": {
        "service_sys_id": "80f21bbadbd410103d3a93c3e296199a",
        "number": "SNSVC0001018    
        }
    }

## アプリケーションサービス - PUT /now/cmdb/csdm/app_service/{service_sys_id}/populate_service {#ariaid-title6}

指定されたアプリケーションサービスに、指定されたダウンストリームの構成アイテム (CI) のセットを入力します。
このエンドポイントを呼び出す前に、[POST /now/cmdb/csdm/app_service/register_service](https://servicenow-prod.fluidtopics.net/EDgYjHHB5ATz7wjJV1iBww#appservice-POST-register_service "アプリケーションサービス [cmdb_ci_service_auto] テーブルにアプリケーションサービスレコードのスタブを作成し、渡された情報を入力します。") エンドポイントを呼び出してアプリケーションサービスを作成する必要があります。  
注:  
このエンドポイントは廃止されました。代わりに [SG サービス -- POST -- /sg_services/app_service/populate](https://servicenow-prod.fluidtopics.net/BQlKaxyWfOmB_60~J8uyjg#sg_svcs-POST-populate "サービスの作成方法を使用して、アプリケーションサービスを設定します。") を使用してください。

### URL 形式

デフォルトの URL：/api/now/cmdb/csdm/app_service/{service_sys_id}/populate_service

### サポートされている要求パラメーター

{#appservice-PUT-populate_service__entry__2}

| 名前 | 説明 |
|-|-|
| service_sys_id | 指定された CI を入力するアプリケーションサービスの sys_id。アプリケーションサービス \[cmdb_ci_service_auto\] テーブルにあります。 データタイプ：文字列 |
[表 : 25. パスパラメーター]

{#appservice-PUT-populate_service__entry__6}

| 名前 | 説明 |
|-|-|
| なし |   |
[表 : 26. クエリパラメーター]

{#appservice-PUT-populate_service__entry__10}

| 名前 | 説明 |
|-|-|
| population_method | 指定されたアプリケーションサービスに関連付ける CI。populate_method オブジェクトの要素は、type パラメーターで定義される、入力される情報のタイプによって異なります。 データタイプ：オブジェクト type = cmdb_group_based の場合 { "population_method": { "group_id": "String", "type": "String" } } type = discovery の場合 注: このタイプを使用するには、Service Mapping (com.snc.service-mapping) プラグインを有効にする必要があります。 { "population_method": { "attributes": [Array], "entry_point_id": "String", "type":"String" } } type = tag_list の場合 注: このタイプを使用するには、Service Mapping (com.snc.service-mapping) プラグインを有効にする必要があります。 { "population_method": { "tags":[Array], "type":"String"  } } |
| population_method.attributes | CI に関連付ける属性のリスト (ホスト、ポート、名前、URL など)。 エントリーポイントの詳細については、「 [エントリーポイント属性](https://www.servicenow.com/docs/access?context=r_EntryPointsforBizSvcDef&version=xanadu&pubname=xanadu-it-operations-management&ft:locale=en-US)」を参照してください。 注: 必要なすべての属性を渡す必要があります。 データタイプ：アレイ { "attributes": { "name":"String", "value":"String" } } |
| population_method.attributes.name | 属性の名前 (ホスト、ポート、名前、URL など)。 データタイプ：文字列 |
| population_method.attributes.value | 属性値。 データタイプ：文字列 |
| population_method.entry_point | population_method.type = discovery の場合は必須です。アプリケーションサービスへのエントリーポイント。エントリーポイントの詳細については、「 [エントリーポイント属性](https://www.servicenow.com/docs/access?context=r_EntryPointsforBizSvcDef&version=xanadu&pubname=xanadu-it-operations-management&ft:locale=en-US) 」および [「サービスマッピングのエントリーポイントタイプの作成」](https://www.servicenow.com/docs/access?context=t_CreateEntryPoint&version=xanadu&pubname=xanadu-it-operations-management&ft:locale=en-US)を参照してください。 データタイプ：文字列 |
| population_method.group_id | population_method.type = cmdb_group_based の場合は必須です。CI と関連付けるグループの sys_id。CMDB グループ \[cmdb_group\] テーブルにあります。 データタイプ：文字列 |
| population_method.tags | CI に関連付けるタグのリスト。この情報は、キー値 \[cmdb_key_value\] テーブルにあります。 データタイプ：アレイ { "tags": { "tag": "String", "value": "String" } } |
| population_method.tags.tag | タグの名前。 データタイプ：文字列 |
| population_method.tags.value | タグ値。 データタイプ：文字列 |
| population_method.type | 必須です。入力する CI のタイプ。 有効な値： * cmdb_group_based * discovery * tag_list {#appservice-PUT-populate_service__ul_j42_5jm_tlb} データタイプ：文字列 |
[表 : 27. 要求本文パラメーター (XML または JSON)]

### ヘッダー

次のリクエストや応答ヘッダーは、この HTTP アクションにのみ適用されるか、またはこのアクションに別個の方法で適用されます。REST API で使用される一般的なヘッダーのリストについては、「 [サポートされている REST API ヘッダー](https://servicenow-prod.fluidtopics.net/ldF_qFEQnejbeXLBxcUhWg "REST (REpresentational State Transfer) は、Web 上のコンピューターシステム間の標準を提供し、相互の通信を容易にするシンプルなステートレスアーキテクチャです。")」を参照してください。
{#appservice-PUT-populate_service__table_h3m_gh2_mlb__entry__2}{#appservice-PUT-populate_service__accept-JSON-only-entry-RESTAPI}{#appservice-PUT-populate_service__content_type-JSON-only-entry-RESTAPI}

| ヘッダー | 説明 |
|-|-|
| 承認 | 応答本文のデータフォーマット。application/json のみをサポートします。 |
| Content-Type | 要求本文のデータ形式。application/json のみをサポートします。 |
[表 : 28. 要求ヘッダー]

{#appservice-PUT-populate_service__table_h3m_gh2_mlb} {#appservice-PUT-populate_service__entry__38}

| ヘッダー | 説明 |
|-|-|
| なし |   |
[表 : 29. 応答ヘッダー]

### ステータスコード

この HTTP アクションには、次のステータスコードが適用されます。REST API で使用される可能性のあるステータスコードのリストについては、「 [REST API HTTP 応答コード](https://servicenow-prod.fluidtopics.net/ldF_qFEQnejbeXLBxcUhWg "REST (REpresentational State Transfer) は、Web 上のコンピューターシステム間の標準を提供し、相互の通信を容易にするシンプルなステートレスアーキテクチャです。")」を参照してください。
{#appservice-PUT-populate_service__entry__42}{#appservice-PUT-populate_service__entry-200-status-code}{#appservice-PUT-populate_service__entry-401-appservice}{#appservice-PUT-populate_service__entry-500-status-code}

| ステータスコード | 説明 |
|-|-|
| 200 | 成功。要求が正常に処理されました。 |
| 401 | 権限がありません。ユーザー資格情報が間違っているか、app_service_admin ロールがありません。 |
| 500 | 内部サーバーエラー。要求の処理中に予期しないエラーが発生しました。 |
[表 : 30. ステータスコード]

### 応答本文のパラメーター (JSON または XML)

{#appservice-PUT-populate_service__entry__50}{#appservice-PUT-populate_service__entry-error-appservice}{#appservice-PUT-populate_service__entry-error-details-appservice}{#appservice-PUT-populate_service__entry-error-message-appservice}

| 名前 | 説明 |
|-|-|
| error | 発生したエラーを説明します。 データタイプ：オブジェクト "error": { "details": "String", "message": "String" } |
| error.details | エラーに関する追加情報。 データタイプ：文字列 |
| error.message | エラーを説明するメッセージ。 データタイプ：文字列 |
[ ]

### サンプル cURL 要求

次のコード例は、CI タイプが cmdb_group_based の場合にアプリケーションサービスを入力する方法を示しています。

    curl -X PUT \
      https://instance.servicenow.com/api/now/cmdb/csdm/app_service/f809cb60db94101037740f95ca96190f/populate_service \
      -H 'Accept: application/json' \
      -H 'Content-Type: application/json' \
      -u 'username':'password' \
      -d '{
      "population_method": {
        "type":"cmdb_group_based",
        "group_id": "e809cf60db94101037640f95ca961932"
      }
    }'

    {
        "result": {}
    }

次のコード例は、検出アプリケーションサービスを入力する方法を示しています。

    curl -X PUT \
      https://instance.servicenow.com/api/now/cmdb/csdm/app_service/f809cb60db94101037740f95ca96190f/populate_service \
      -H 'Accept: application/json' \
      -H 'Content-Type: application/json' \
      -u 'username':'password' \
      -d '{
      "population_method": {
        "type":"discovery",
        "entry_point_id":"cmdb_ci_endpoint_ad_forest",
        "attributes": [
          {
            "name":"host",
            "value":"test1.com"
          },
          {
            "name":"port",
            "value":"500"
          },
          {
            "name":"protocol",
            "value":"ssh"
          }
        ]
      }
    }'

    {
        "result": {}
    }

## アプリケーションサービス - PUT /now/cmdb/csdm/app_service/{service_sys_id}/service_details {#ariaid-title7}

指定されたアプリケーションサービスを渡された基本情報で更新します。
また、渡された情報をアプリケーションサービスクラスで定義された識別および調整エンジン (IRE) ルールに照らしてチェックすることで、アプリケーションサービスの一意性を検証します。  
注:  
このエンドポイントは廃止されました。代わりに [SG サービス -- POST -- /sg_services/app_service/update](https://servicenow-prod.fluidtopics.net/BQlKaxyWfOmB_60~J8uyjg#sg_svcs-POST-update "提供された既存のアプリケーションサービスを更新し、指定されたアプリケーションサービスのタグを作成します。") を使用してください。

### URL 形式

デフォルトの URL：/api/now/cmdb/csdm/app_service/{service_sys_id}/service_details

### サポートされている要求パラメーター

{#appservice-PUT-service_details__entry__2}

| 名前 | 説明 |
|-|-|
| service_sys_id | 更新するアプリケーションサービスの sys_id。アプリケーションサービス \[cmdb_ci_service_auto\] テーブルにあります。 データタイプ：文字列 |
[表 : 31. パスパラメーター]

{#appservice-PUT-service_details__entry__6}

| 名前 | 説明 |
|-|-|
| なし |   |
[表 : 32. クエリパラメーター]

{#appservice-PUT-service_details__entry__10}{#appservice-PUT-service_details__entry-basic_details-appservice}{#appservice-PUT-service_details__entry-basic_details-environment-appservice}{#appservice-PUT-service_details__entry-basic_details-name-appservice}{#appservice-PUT-service_details__entry-relationships-appservice}{#appservice-PUT-service_details__entry-relationships-bus_app-appservice}{#appservice-PUT-service_details__entry-relationships-bus_srv_off-appservice}{#appservice-PUT-service_details__entry-relationships-tech_srv_off-appservice}

| 名前 | 説明 |
|-|-|
| basic_details | 指定されたアプリケーションサービスに関連付けられたサービスの詳細。 データタイプ：オブジェクト "basic_details": { "environment": "String", "name": "String" } |
| basic_details.environment | アプリケーションサービスが展開されている環境 (「本番」や「テストラボ 2」など)。これは、実装者が理解できる任意の値にすることができます。 データタイプ：文字列 最大長：40 デフォルト：null |
| basic_details.name | 必須です。アプリケーションサービスの名前。他のすべてのアプリケーションサービスからの一意の名前である必要があります。 データタイプ：文字列 最大長：255 |
| relationships | アプリケーションサービスに関連付けるサービスタイプ。CI 関係 \[cmdb_rel_ci\] テーブルにあります。 データタイプ：オブジェクト "relationships": { "business_app": [Array], "business_service_offering": [Array], "technical_service_offering": [Array] } |
| relationships.business_app | アプリケーションサービスに関連付けるビジネスアプリケーションの sys_id のリスト。 データタイプ：アレイ |
| relationships.business_service_offering | アプリケーションサービスに関連付けるビジネスサービスオファリングの sys_id のリスト。 データタイプ：アレイ |
| relationships.technical_service_offering | アプリケーションサービスに関連付けるテクニカルサービスオファリングの sys_id のリスト。 データタイプ：アレイ |
[表 : 33. 要求本文パラメーター (XML または JSON)]

### ヘッダー

次のリクエストや応答ヘッダーは、この HTTP アクションにのみ適用されるか、またはこのアクションに別個の方法で適用されます。REST API で使用される一般的なヘッダーのリストについては、「 [サポートされている REST API ヘッダー](https://servicenow-prod.fluidtopics.net/ldF_qFEQnejbeXLBxcUhWg "REST (REpresentational State Transfer) は、Web 上のコンピューターシステム間の標準を提供し、相互の通信を容易にするシンプルなステートレスアーキテクチャです。")」を参照してください。
{#appservice-PUT-service_details__entry__26}{#appservice-PUT-service_details__accept-JSON-only-entry-RESTAPI}{#appservice-PUT-service_details__content_type-JSON-only-entry-RESTAPI}

| ヘッダー | 説明 |
|-|-|
| 承認 | 応答本文のデータフォーマット。application/json のみをサポートします。 |
| Content-Type | 要求本文のデータ形式。application/json のみをサポートします。 |
[表 : 34. 要求ヘッダー]

{#appservice-PUT-service_details__entry__32}

| ヘッダー | 説明 |
|-|-|
| なし |   |
[表 : 35. 応答ヘッダー]

### ステータスコード

この HTTP アクションには、次のステータスコードが適用されます。REST API で使用される可能性のあるステータスコードのリストについては、「 [REST API HTTP 応答コード](https://servicenow-prod.fluidtopics.net/ldF_qFEQnejbeXLBxcUhWg "REST (REpresentational State Transfer) は、Web 上のコンピューターシステム間の標準を提供し、相互の通信を容易にするシンプルなステートレスアーキテクチャです。")」を参照してください。
{#appservice-PUT-service_details__entry__36}{#appservice-PUT-service_details__entry-200-status-code}{#appservice-PUT-service_details__entry-401-appservice}

| ステータスコード | 説明 |
|-|-|
| 200 | 成功。要求が正常に処理されました。 |
| 401 | 権限がありません。ユーザー資格情報が間違っているか、app_service_admin ロールがありません。 |
[表 : 36. ステータスコード]

### 応答本文のパラメーター (JSON または XML)

{#appservice-PUT-service_details__entry__42}{#appservice-PUT-service_details__entry-error-appservice}{#appservice-PUT-service_details__entry-error-details-appservice}{#appservice-PUT-service_details__entry-error-message-appservice}

| 名前 | 説明 |
|-|-|
| error | 発生したエラーを説明します。 データタイプ：オブジェクト "error": { "details": "String", "message": "String" } |
| error.details | エラーに関する追加情報。 データタイプ：文字列 |
| error.message | エラーを説明するメッセージ。 データタイプ：文字列 |
[ ]

### サンプル cURL 要求

    curl -X PUT \
      https://instance.servicenow.com/api/now/cmdb/csdm/app_service/f809cb60db94101037740f95ca96190f/service_details \
      -H 'Accept: application/json' \
      -H 'Content-Type: application/json' \
      -u 'username':'password' \
      -d '{
      "basic_details": {
        "environment": "Test Lab 2"
      },  "relationships": {
        "business_app" :["f07c7620db54101037740f95ca96199a"]
      }
    }'

    {
        "result": {}
    }


