Questo contenuto non è disponibile nella lingua selezionata.

Chapter 2. Using XML-RPC with the Red Hat Satellite API


XML-RPC uses HTTP to send an XML-encoded request to a server. The request contains the following:
Namespace
A namespace is a grouping of methods based upon a particular function, object or resource. For example, the auth namespace groups authentication function, or the errata namespace groups function that control errata.
Method
A method represents a certain action. Each method controls a specific function of the Red Hat Satellite. For example, the login method in the auth namespace logs a user into Red Hat Satellite and returns a session key.
Parameter
A parameter is a piece of input to control specific aspects of a method. For example, the login method in the auth namespace requires username and password parameters to specify the login details of a certain user. The login method also accepts an optional duration parameter to specify the length of time until the user session expires..
The XML-encoded request usually appears in the following structure:
<methodCall>
  <methodName>namespace.method</methodName>
  <params>
    <param>
      <value><name>parameter</name></value>
    </param>
    <param>
      <value><name>parameter</name></value>
    </param>
    ...
  </params>
</methodCall>
Copy to Clipboard Toggle word wrap
For example, use the following XML-RPC request to retrieve a list of all Red Hat Satellite API namespaces:
<methodCall>
  <methodName>auth.login</methodName>
  <params>
    <param>
      <value><username>admin</username></value>
    </param>
    <param>
      <value><password>p@55w0rd!</password></value>
    </param>
  </params>
</methodCall>
Copy to Clipboard Toggle word wrap
In this example, the request sends the username and password as a parameters to the login method, which is a part of the auth namespace. The Satellite server returns the following response:
<methodResponse>
  <params>
    <param>
      <value><sessionKey>83d8b35f</sessionKey></value>
    </param>
  </params>
</methodResponse>
Copy to Clipboard Toggle word wrap
The response contains a returned parameter for sessionKey, which is a key used to authenticate most of the API methods.
Most programming languages include XML-RPC modules and libraries that automatically parse the desired method and parameters into the XML-encoded request and parse the resulting response as returned variable. For examples, see Part II, “Examples”.
For more information about XML-RPC, see http://www.xmlrpc.com/.
Torna in cima
Red Hat logoGithubredditYoutubeTwitter

Formazione

Prova, acquista e vendi

Community

Informazioni sulla documentazione di Red Hat

Aiutiamo gli utenti Red Hat a innovarsi e raggiungere i propri obiettivi con i nostri prodotti e servizi grazie a contenuti di cui possono fidarsi. Esplora i nostri ultimi aggiornamenti.

Rendiamo l’open source più inclusivo

Red Hat si impegna a sostituire il linguaggio problematico nel codice, nella documentazione e nelle proprietà web. Per maggiori dettagli, visita il Blog di Red Hat.

Informazioni su Red Hat

Forniamo soluzioni consolidate che rendono più semplice per le aziende lavorare su piattaforme e ambienti diversi, dal datacenter centrale all'edge della rete.

Theme

© 2025 Red Hat