approve-agentpendingaction operation

The approve-agentpendingaction operation approves the action that is pending with an agent. You can filter the agents by specifying a filter criterion.

The following table describes the <items> XML and request elements for the approve-agentpendingaction operation:

Adapter request elements for the approve-agentpendingaction operation

Element

Definition

Required

<operation-name>

Specifies the operation name: approve-agentpendingaction

Yes

<command-request>

Specifies the parent element for the command elements

Yes

<timeout-secs>

Specifies the duration after which the operation times out

Default value: 60 seconds

No

<command-parameters>

Specifies the parent element for the command parameters

Yes

<agent-pending-action>

Specifies the parent element that contains the filter criterion used to retrieve the agents that have actions in the pending state

Yes

<filters>

Specifies the parent element that contains the search criterion

No

<filter>

Specifies the parent element for a single search criterion

You can specify more than one filter criterion by using multiple <filter> elements.

Conditional; required if the <filters> element is specified

<agent-pending-action-key>

Specifies the key that is used to locate an agent

Valid values:

  • AgentName
  • ManagementServerName
  • AgentPendingActionType
  • ManagementGroup
  • ManagementGroupId

Conditional; required if the <filters> element is specified

<agent-pending-action-val>

Specifies the value of the key specified in the <agent-pending-action-key> element

Conditional; required if the <filters> element is specified

<operand>

Specifies the operation that is performed by using the values specified in the <agent-pending-action-key> and <agent-pending-action-val> elements

Valid values:

  • equals
  • not equals
  • matches

Conditional; required if the <filters> element is specified

<preview>

Specifies whether you want to preview the results of the operation

Valid values:

  • true: Indicates that you want to preview the results of the operation
  • false: Indicates that the operation is executed without displaying the results of the execution (default)

No

The following figure illustrates a sample adapter request for the approve-agentpendingaction operation: 

Sample adapter request for the approve-agentpendingaction operation

<scom-request>
  <operation-name>approve-agentpendingaction</operation-name>
  <command-request>
    <timeout-secs>120</timeout-secs>
    <command-parameters>
      <agent-pending-action>
        <filters>
          <filter>
            <agent-pending-action-key>AgentName</agent-pending-action-key>
            <agent-pending-action-val>abc.neuron.com</agent-pending-action-val>
            <operand>matches</operand>
          </filter>
        </filters>
      </agent-pending-action>
      <preview>true</preview>
    </command-parameters>
  </command-request>
</scom-request>



The following figure illustrates the adapter response for the sample request: 

Sample adapter response for the approve-agentpendingaction operation

<scom-response>
  <metadata>
    <status>success</status>
    <count>1</count>
  </metadata>
  <commands-output>
    <command-output>
      <metadata>
        <command>./Microsoft.EnterpriseManagement.OperationsManager.ClientShell.
        Startup.ps1;approve-agentpendingaction
        -agentpendingaction (get-agentpendingaction | where-object {$_.AgentName
         -match 'abc.neuron.com'})
        -whatif</command>
        <execution-milliseconds>3141</execution-milliseconds>
        <exit-code>0</exit-code>
        <status>success</status>
        <count>0</count>
      </metadata>
      <output>
        <line>What if: Performing operation "Approve-AgentPendingAction" on
         Target "abc.neuron.com".</line>
      </output>
    </command-output>
  </commands-output>
</scom-response>
Was this page helpful? Yes No Submitting... Thank you

Comments