5.17.3 Delete definition file
- Description
-
Delete JP1/IM - Manager or JP1/IM - Agent definition file.
- Execution permissions
-
Following permissions are required:
When specify "Manager" at hostCategory
-
JP1 resource group: *
-
JP1 permission level: JP1_Console_Admin
When specify "Agent" at hostCategory
-
JP1 permission level: JP1_Console_Admin
-
- API version
-
v1
- Format
-
- Request line
POST /application/component/apiVersion/fileOperation/deleteFile httpVersion
- Request header
-
Follow the request header in 5.2.3 Request format.
- Request message body
-
Message body of the request can be sent in JSON formats.
[ "filelist":[ { "filename": "File Name", "filepath": "absolute path of File", "updateaction": "Manipulation for defining import" }, ... ], "hostCategory":"host type", "managerHostName":"Definition file delete destination agent host management destination manger host name", "agentHostName":"Definition file delete destination Agent host name" ]
- Parameters
-
Here are the parameters that you specify for message body of the request:
Parameter
Optional
Description
filename
No
Specifies File.
filepath
No
Specifies the absolute location of file. If the absolute path including file name in file path exceeds 200 characters, the result is error.
updateaction
Yes
Specifies a value from 1 to 4096 bytes that should be executed when file is updated.
hostCategory
No
Specify "Manager" or "Agent" as host type. Performs an action on the defined file of the specified host type.
managerHostName
See Description column
-
When hostCategory is "Manager"
Ignores the specified item. Delete file of the manager host in JP1/IM, assuming that the local host is the manager host in JP1/IM.
-
When hostCategory is "Agent"
Specify a value from 1 to 255 bytes for the JP1/IM manager host name that manages the agent from which the definition file is to be deleted.
agentHostName
See Description column
-
When hostCategory is "Manager"
Ignores the specified item.
-
When hostCategory is "Agent"
Specify the agent host name of the definition file deletion destination with 1 to 255 bytes.
-
- Status codes
-
The following table describes the status codes that are returned as a response to the request:
Status code
Message
Description
200
--
API operation was successful.
KAJY68126-W
JP1/IM agent control base encountered a warning.
400
KAJY68107-E
Request parameter is invalid.
KAJY68205-E
-
Integrated agent host name specified in the request does not exist in JP1/IM - Manager
-
Logged in as does not have read/manipulate permissions for integrated agent specified in the request
-
The information of the integration agent or the host specified in the request is not in the unified agent host management DB
403
KAJY01000-E
The privilege of the user used for authentication is insufficient.
500
KAJY68104-E
JP1/IM agent control base encountered an error.
KAJY00007-E
System error has occurred (out of disk, out of memory, etc.).
KAJY68203-E
Cannot connect to Intelligent Integrated Management Base.
KAJY68212-E
Cannot connect to JP1/IM agent base.
KAJY68501-E
Unable to connect to the manager's unified agent host management DB.
-
- Response
-
If the status code is 200, the following is returned to the response body in JSON format:
{ "filelist":[ { "filename": "File name", "filepath": "absolute path of File", "result": "Result of file deletion", "message": "Message" }, ... ] }
Member name
Description
filename
Describes file name.
filepath
Describes the absolute path where file will be placed.
result
Describes the outcome of file deletion.
See Table 5-15 for the character strings to be described.
filelist:message
Provides the error message ID and its body if the action for file deletion fails. If it succeeds, omit this item.
If result is recovery fail, the error message in the table indicates message when the import operation failed.
Table 5‒15: Contents of the result Delete for file
Operations for importing definition
Recovery process
Content of result
Y
Y
--
success
N
--
--
delete fail
Y
N
Y
action fail
Y
N
N
recovery fail
- Legend
-
Y: Succeeded, N: Failed, --: No processing
- Return values
-
-
When the status code is 200
None
-
When the status code is other than 200
In message body of the response, the exception object in the response format described in 5.2.6 Error response message when an error occurs is returned.
-
- Examples
-
- Request:
POST http://hostname:20703/im/api/v1/fileOperation/deleteFile HTTP/1.1 Authorization:Bearer anAxYWRtaW46TUdGa01tTTJNMlV3TURFNFh6STNYekE0T2pJME9qTXpYMTlmWDE5ZlgxOWZYMTlmWDE5ZlgycHdNV0ZrYldsdUlDQWdJQ0FnSUNBZ0lDQWdJQ0FnSUNBZ0lDQWdJQ0Fn Accept-Language: ja Content-Type: application/json Content-Length: 1024000 Accept: application/json { "filelist":[ { "filename": "user_file_sd_config_test.yml", "filepath": "C:\\Program Files\\Hitachi\\jp1ima\\conf\\user", "updateaction": "jp1ima\\addon_management\\alertmanager\\addon_jpc_service_reload.bat" }, ... ], "hostCategory":"Agent", "managerHostName":"immanager", "agentHostName":"imagent" }
- Response:
HTTP/1.1 200 OK Content-Type:application/json ... (omitted) ... { "filelist":[ { "filename": "user_file_sd_config_test.yml", "filepath": "C:\\Program Files\\Hitachi\\jp1ima\\conf\\user", "result": "delete fail", "message": "KAJY68126-W A warning occurred in the integrated agent control platform. (detailed-information : KNBC20015-W Failed to delete a definition file. (details = target file does not exist. filename=C:\\Program Files\\Hitachi\\jp1ima\\conf\\user\\user_file_sd_config_test.yml))" }, ... ] }
- Notes
-
-
After deletion of the definition File, the service might be restart because of import of the definition information.
-
If the service startup fails after deletion of file, the system performs a recovery operation. However, if the recovery operation fails, status might be the one in which the service was stopped.
-
In a clustered configuration, a deletion of the defined file might cause a failover. Also, you cannot start the service at the failover destination, and the failover might fail. Depending on the load condition, restart and recovery process of the service may take a long time. In the case of a cluster configuration, the cluster software may judge it to be abnormal and cause a failover. For this reason, file's deletion should be performed during system-maintenance hours.
-