The general format for the JSON representation of a resource is as follows:
{ "resource":{attributes}, "Methods": { method-list } "Child Resources":[urls] }
The replaceable items in this format are as follows:
The name of the resource.
Zero or more name-value pairs separated by a comma (,). Each name-value pair is specified as "name":value.
One or more metadata sets separated by a comma (,) that represent the methods that the resource supports. For the format of each metadata set, see JSON Representation of a Method in a Method List.
Zero or more URLs to child resources separated by a comma (,).
The JSON representation of a method in a method list is as follows:
Method":{ "Name":"method-name", "Message Parameters":{ message-parameter-list } "Query Parameters":{ queryparameter- list } }
The replaceable items in this format are as follows:
The name of the method, which is GET, POST, or DELETE.
Zero or more metadata sets separated by a comma (,) that represent the message parameters that are allowed for the method. For the format of each metadata set, see JSON Representation of a Message Parameter or a Query Parameter.
Zero or more metadata sets separated by a comma (,) that represent the query parameters that are allowed for the method. For the format of each metadata set, see JSON Representation of a Message Parameter or a Query Parameter.
The JSON representation of a message parameter or a query parameter is as follows:
"parameter-name":{attribute-list}
The replaceable items in this format are as follows:
The name of the parameter.
A comma-separated list of name-value pairs of attributes for the parameter. Each pair is in the following format:
"name":"value"
Possible attributes are as follows:
The default value of the parameter.
The set or range of acceptable values for the parameter.
The data type of the parameter, which is one of the following types:
boolean
int
string
Indicates whether the parameter is optional. If true, the parameter is optional. If false, the parameter is required.
Indicates whether the parameter is key. If true, the parameter is key. If false, the parameter is not key.
This example shows the JSON representation of the resource for managing a domain. In this example, the DAS is running on the local host and the HTTP port for administration is 4848. The URL to the resource in this example is http://localhost:4848/management/domain.
Line breaks are added to enhance readability.
{ "Domain":{"log-root":"${com.sun.aas.instanceRoot}/logs", "application-root":"${com.sun.aas.instanceRoot}/applications", "locale":"", "version":"73"}, "Methods":{ "Method":{ "Name":"POST", "Message Parameters":{ "log-root":{"Key":"false", "Type":"string", "Optional":"true"}, "application-root":{"Key":"false", "Type":"string", "Optional":"true"}, "locale":{"Key":"false", "Type":"string", "Optional":"true"}, "version":{"Key":"false", "Type":"string", "Optional":"true"} } }, "Method":{ "Name":"GET" } }, "Child Resources":[ "http://localhost:4848/management/domain/configs", "http://localhost:4848/management/domain/resources", "http://localhost:4848/management/domain/servers", "http://localhost:4848/management/domain/property", "http://localhost:4848/management/domain/applications", "http://localhost:4848/management/domain/system-applications", "http://localhost:4848/management/domain/stop", "http://localhost:4848/management/domain/restart", "http://localhost:4848/management/domain/uptime", "http://localhost:4848/management/domain/version", "http://localhost:4848/management/domain/rotate-log", "http://localhost:4848/management/domain/host-port" ] } |