SCP adapter request and response for a put action


To configure an adapter request to communicate with a host that is not defined in the adapter configuration, you can designate a dynamic target by assigning values for the required configuration elements. These elements work as a set. You cannot retrieve partial information from the configuration node.

You can omit the <targets> block from the adapter request. In the absence of a <targets> block, the default target from the adapter configuration is used.

When you use a context item as an input for an adapter request, you must enclose the adapter request in the <request-data> elements. However, when you create a static request, <request-data> is not required and the adapter request starts with the <adapterName-adapter-request> element.

BMC recommends that you do not include unused elements in the adapter request because they might cause errors. The following table describes the elements of an SCP adapter request with a put action.

 Elements of an SCP adapter request with a put action

The following figure shows an XML template of the adapter request for the SCP adapter with a put action.

XML template of the SCP adapter request with a put action


<scp-request>
  <targets>
    <target name=""/>
    <target>
      <host></host>
      <port></port>
      <user-name></user-name>
      <password encryption-type=""></password>
      <timeout-secs></timeout-secs>
      <known-hosts-config></known-hosts-config>
      <allow-unknown-hosts></allow-unknown-hosts>
      <preferred-pk-algorithm></preferred-pk-algorithm>
      <establish-connection-timeout-secs></establish-connection-timeout-secs>
      <network-environment></network-environment>
    </target>
    <target>
      <host></host>
      <port></port>
      <user-name></user-name>
      <private-key-file></private-key-file>
      <pass-phrase encryption-type=""></pass-phrase>
      <timeout-secs></timeout-secs>
      <known-hosts-config></known-hosts-config>
      <allow-unknown-hosts></allow-unknown-hosts>
      <preferred-pk-algorithm></preferred-pk-algorithm>
      <establish-connection-timeout-secs></establish-connection-timeout-secs>
      <network-environment></network-environment>
    </target>
  <targets>
  <local-file></local-file>
  <remote-file></remote-file>
</scp-request>

The following figure shows an XML sample of the adapter request for the SCP adapter with a put action. In this sample, the first target references the adapter configuration and the second target is a dynamic target.

XML sample of the SCP adapter request with a put action


<scp-request>
  <targets>
    <target name="host1"/>
    <target>
      <host>server2</host>
      <port>2200</port>
      <user-name>user</user-name>
      <password encryption-type="Plain">test</password>
      <timeout-secs>90</timeout-secs>
      <known-hosts-config>/path/to/known_hosts</known-hosts-config>
      <allow-unknown-hosts>false</allow-unknown-hosts>
      <preferred-pk-algorithm>ssh-dss</preferred-pk-algorithm>
      <establish-connection-timeout-secs>90</establish-connection-timeout-secs>
      <network-environment>true</network-environment>
    </target>
    <target>
     <host>server3</host>
     <port>2200</port>
     <user-name>user1</user-name>
     <private-key-file>/path/to/SSH key file</private-key-file>
     <pass-phrase encryption-type="Base64">cGFzczE=</pass-phrase>
     <timeout-secs>90</timeout-secs>
     <known-hosts-config>/path/to/known_hosts</known-hosts-config>
     <allow-unknown-hosts>false</allow-unknown-hosts>
     <preferred-pk-algorithm>ssh-dss</preferred-pk-algorithm>
     <establish-connection-timeout-secs>90</establish-connection-timeout-secs >
     <network-environment>true</network-environment>
  </target>
  </targets>
  <local-file>/path/to/file/filename</local-file>
  <remote-file>/path/to/file/filename</remote-file>
</scp-request>

The put action request for a SCP adapter returns an adapter response containing the summary information for the action.

The following table describes the elements of an SCP adapter response to a request with a put action.

 Elements of an SCP adapter response to a request with a put action

The following figure illustrates an XML sample of the adapter response for the SCP adapter with a put action.

XML sample of the SCP adapter response with a put action


<scp-command-output>
  <request-metadata>
    <status>success</status>
    <error>Present only with status of 'error'</error>
  </request-metadata>
  <targets-output>
    <target-output host="server1">
    <target-metadata>
      <request-action>put</request-action>
      <execution-milliseconds>4000</execution-seconds>
      <local-file>/path/to/file/filename</local-file>
      <remote-file>/path/to/file/filename</remote-file>
      <status>success</status>
      <error>Present only with status of 'error'</error>
    </target-metadata>
    <output/>
    </target-output>
  <targets-output>
</scp-command-output>

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*