---
sourceDocument: Yokohama-API-Referenz
sourceDocumentLink: https://servicenow-prod.fluidtopics.net/r/de-DE/yokohama/api-reference

 Release :

    - yokohama

ft:locale :

    - de-DE

ft:publication_title :

    - Yokohama-API-Referenz

ft:clusterId :

    - crapiref

bundleId :

    - crapiref

workflow :

    - Creator


---

# Verbindungsinformationen -- Umfang, Global

# Verbindungsinformationen -- Umfang, Global {#ariaid-title1}

* Freigeben Version: Yokohama
* 
* Aktualisiert 30. Januar 2025
* 
* ![](https://www.servicenow.com/docs/portal-asset/ico-clock) 1 Minute Lesedauer

Die Verbindungsinformationen Mit der API können Sie Verbindungsattributinformationen über den Alias für Verbindungen und Anmeldeinformationen abrufen.

Sie können diese API in bereichsbezogenen Anwendungen oder innerhalb des globalen Bereichs verwenden. Verwenden Sie in bereichsbezogenen Skripts `sn_CC `Namespace-Bezeichner.

Weitere Informationen zu Verbindungen und Anmeldeinformationen finden Sie unter [Anmeldeinformationen und Verbindungsinformationen](https://www.servicenow.com/docs/access?context=r-credentials&version=yokohama&pubname=yokohama-platform-security&ft:locale=en-US).

Diese Funktion ruft Verbindungsattributinformationen ab, die vom angegebenen Alias für Verbindungen und Anmeldeinformationen identifiziert werden.  

    var provider = new sn_cc.ConnectionInfoProvider();

    // get a jdbc connection in the current domain with the alias ID
    //     "6219afbf9f03320021dd7501942e70fc"
    var connectionInfo = provider.getConnectionInfo("6219afbf9f03320021dd7501942e70fc");
    if (connectionInfo != null) {
      // get data map
      var datamap = connectionInfo.getDataMap();
      gs.info(datamap["name"]);
      gs.info(datamap["connection_url"]);

      // get the same values using getAttribute
      gs.info(connectionInfo.getAttribute("name"));
      gs.info(connectionInfo.getAttribute("connection_url"));

      // get credential attributes
      gs.info(connectionInfo.getCredentialAttribute("user_name"));
      gs.info(connectionInfo.getCredentialAttribute("password")); 

      // get extended attributes
      var extendedAttributes = connectionInfo.getExtendedAttributes();  
      gs.info(extendedAttributes["name1"]);
     }

     // get a jdbc connection in the ACME domain with the alias ID
     //      "cd5923ff9f03320021dd7501942e70bb"
     connectionInfo = provider.getConnectionInfoByDomain("cd5923ff9f03320021dd7501942e70bb",
            "c90d4b084a362312013398f051272c0d");
     if (connectionInfo != null) {
       // get data map
       var datamap = connectionInfo.getDataMap();
       gs.info(datamap["name"]);
     }

## Bereichsbezogene ConnectionInfo -- getAttribute(Zeichenfolgenname) {#ariaid-title2}

Gibt den Wert von zurück Verbindungsinformationen Attribut mit dem angegebenen Eigenschaftsnamen.
{#CI-getAttribute_S__table_ext_cx2_qbb__entry__3}

| Name | Typ | Beschreibung |
|-|-|-|
| name | Zeichenfolge | Name von Verbindungsinformationen Objekteigenschaft. |
[Tabelle : 1. Parameter]

{#CI-getAttribute_S__table_ext_cx2_qbb} {#CI-getAttribute_S__table_fxt_cx2_qbb__entry__2}

| Typ | Beschreibung |
|-|-|
| Zeichenfolge | Wert eines angegebenen Verbindungsinformationen Eigenschaft. |
[Tabelle : 2. Rückgaben]

{#CI-getAttribute_S__table_fxt_cx2_qbb}  

      // get the same values using getAttribute
      gs.info(connectionInfo.getAttribute("name"));
      gs.info(connectionInfo.getAttribute("connection_url"));

## Bereichsbezogene ConnectionInfo -- getCredentialAttribute() {#ariaid-title3}

Gibt den Wert von Anmeldeinformationsattributen für eine angegebene Verbindung zurück.
{#CI-getCredentialAttribute_S__table_ext_cx2_qbb__entry__3}

| Name | Typ | Beschreibung |
|-|-|-|
| Keine |   |   |
[Tabelle : 3. Parameter]

{#CI-getCredentialAttribute_S__table_ext_cx2_qbb} {#CI-getCredentialAttribute_S__table_fxt_cx2_qbb__entry__2}

| Typ | Beschreibung |
|-|-|
| Objekt | Schlüssel-Wert-Paarzuordnung von Anmeldeinformationsattributen. |
[Tabelle : 4. Rückgaben]

{#CI-getCredentialAttribute_S__table_fxt_cx2_qbb}  

     // get credential attributes
      gs.info(connectionInfo.getCredentialAttribute("user_name"));
      gs.info(connectionInfo.getCredentialAttribute("password")); 

## Bereichsbezogene ConnectionInfo -- getDataMap() {#ariaid-title4}

Gibt die Verbindungsattribute als Sammlung von Schlüssel-Wert-Paaren zurück.
{#CI-getDataMap_S__table_ext_cx2_qbb__entry__3}

| Name | Typ | Beschreibung |
|-|-|-|
| Keine |   |   |
[Tabelle : 5. Parameter]

{#CI-getDataMap_S__table_ext_cx2_qbb} {#CI-getDataMap_S__table_fxt_cx2_qbb__entry__2}

| Typ | Beschreibung |
|-|-|
| Objekt | Schlüssel-Wert-Paarzuordnung von Verbindungsattributen. |
[Tabelle : 6. Rückgaben]

{#CI-getDataMap_S__table_fxt_cx2_qbb}  

     // get data map
      var datamap = connectionInfo.getDataMap();
      gs.info(datamap["name"]);
      gs.info(datamap["connection_url"]);

## Bereichsbezogene ConnectionInfo -- getExtendedAttributes() {#ariaid-title5}

Gibt die erweiterten Attribute als Sammlung von Schlüssel-Wert-Paaren zurück.
{#CI-getExtendedAttributes_S__table_ext_cx2_qbb__entry__3}

| Name | Typ | Beschreibung |
|-|-|-|
| Keine |   |   |
[Tabelle : 7. Parameter]

{#CI-getExtendedAttributes_S__table_ext_cx2_qbb} {#CI-getExtendedAttributes_S__table_fxt_cx2_qbb__entry__2}

| Typ | Beschreibung |
|-|-|
| Objekt | Schlüssel-Wert-Paarzuordnung erweiterter Attribute. |
[Tabelle : 8. Rückgaben]

{#CI-getExtendedAttributes_S__table_fxt_cx2_qbb}  

    // get extended attributes
      var extendedAttributes = connectionInfo.getExtendedAttributes();  
      gs.info(extendedAttributes["name1"]);
     }


