- Navigation GuideYou are on a Command (operation) page with structural examples. Use the navigation breadcrumb if you would like to return to the Client landing page.
BatchDeleteAgentsCommand
Deletes one or more agents or collectors as specified by ID. Deleting an agent or collector does not delete the previously discovered data. To delete the data collected, use StartBatchDeleteConfigurationTask
.
Example Syntax
Use a bare-bones client and the command you need to make an API call.
import { ApplicationDiscoveryServiceClient, BatchDeleteAgentsCommand } from "@aws-sdk/client-application-discovery-service"; // ES Modules import
// const { ApplicationDiscoveryServiceClient, BatchDeleteAgentsCommand } = require("@aws-sdk/client-application-discovery-service"); // CommonJS import
const client = new ApplicationDiscoveryServiceClient(config);
const input = { // BatchDeleteAgentsRequest
deleteAgents: [ // DeleteAgents // required
{ // DeleteAgent
agentId: "STRING_VALUE", // required
force: true || false,
},
],
};
const command = new BatchDeleteAgentsCommand(input);
const response = await client.send(command);
// { // BatchDeleteAgentsResponse
// errors: [ // BatchDeleteAgentErrors
// { // BatchDeleteAgentError
// agentId: "STRING_VALUE", // required
// errorMessage: "STRING_VALUE", // required
// errorCode: "NOT_FOUND" || "INTERNAL_SERVER_ERROR" || "AGENT_IN_USE", // required
// },
// ],
// };
BatchDeleteAgentsCommand Input
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
deleteAgents Required | DeleteAgent[] | undefined | The list of agents to delete. |
BatchDeleteAgentsCommand Output
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
$metadata Required | ResponseMetadata | Metadata pertaining to this request. |
errors | BatchDeleteAgentError[] | undefined | A list of agent IDs that failed to delete during the deletion task, each paired with an error message. |
Throws
Name | Fault | Details |
---|
Name | Fault | Details |
---|---|---|
AuthorizationErrorException | client | The user does not have permission to perform the action. Check the IAM policy associated with this user. |
InvalidParameterException | client | One or more parameters are not valid. Verify the parameters and try again. |
InvalidParameterValueException | client | The value of one or more parameters are either invalid or out of range. Verify the parameter values and try again. |
ServerInternalErrorException | server | The server experienced an internal error. Try again. |
ApplicationDiscoveryServiceServiceException | Base exception class for all service exceptions from ApplicationDiscoveryService service. |