beautypg.com

1 introduction, Http methods, Different formats and representations – HP StoreEver ESL G3 Tape Libraries User Manual

Page 7: Http methods different formats and representations

background image

1 Introduction

Web Services provides a scriptable interface for users who want to programmatically monitor or
configure their ESL G3 tape libraries. Web Services is particularly beneficial for data centers with
many libraries that want to monitor or configure them at the same time, or who want to configure
many libraries in the same way without manually repeating the processes one-by-one in each web
GUI.

Web Services uses REpresentational State Transfer (REST) architectural principles. REST is a style
of software architecture for building distributed systems consisting of clients and servers. Clients
initiate requests and the Servers process these requests and return responses, where the response
contains a representation of the resource being requested. The ESL G3 uses Hypertext Transfer
Protocol (HTTP) as the application protocol.

Information can be returned in XML format, which can be parsed by a variety of open source tools
and scripting languages. For example, perl, python, Java, Linux shell, and Windows batch can
send and receive HTTP and XML data. Tools like curl, xmlStarlet, xsltproc, or Postman (a Google
Chrome plugin), may also be helpful in exchanging and decoding ESL G3 Web Services data.

NOTE:

The tools and languages mentioned above are only examples and are not owned or

supported by Hewlett-Packard.

HTTP methods

The ESL G3 Web Services interface uses a small set of well-defined HTTP methods/operations to
manipulate resources.

POST—Used to create a new resource on the library. The message body contains the details
on the new resource to be created.

GET—A read only operation. It is used to request data from the library.

PUT—Used to update a resource on the library. The message body typically contains the
information needed to update the resource.

DELETE—Used to remove an existing resource on the library.

Different formats and representations

Each resource can be represented in different formats. Different platforms require different formats:
browsers need Hypertext Markup Language (HTML), JavaScript needs JavaScript Object Notation
(JSON) and JAVA may require Extensible Markup Language (XML).

With HTTP, the representation is the message body of your request or response. The message body
can be in any format. The Content-Type header tells the client or server what format to expect in
the message body. The ESL G3 typically uses text/plain, application/xml and application/json.
It also supports application/x-tar for capturing support tickets.

HTTP methods

7