Difference between revisions of "Programmatic Administration Interface"

From Gcube Wiki
Jump to: navigation, search
(Add a gCube Resource from a VO to another VO)
(Add a gCube Resource from a VO to another VO)
Line 251: Line 251:
 
:* '''How to find it''': on the classpath
 
:* '''How to find it''': on the classpath
  
:* '''Operation to invoke''':  
+
:* '''Operation to invoke''': [[ExistClient#How_to_query_over_GCUBEResource_profiles|execute]]
  
:* '''Parameters''':  
+
:* '''Parameters''': <code>query=GCUBEResourceQuery</code>(with an appropriate <code>QueryParameter</code> condition on the resource ID), <code>Scope=<source VO></code>,
  
 
* '''Name''': [[IS-Publisher]]
 
* '''Name''': [[IS-Publisher]]
Line 263: Line 263:
 
:* '''Operation to invoke''': [[IS-Publisher#Publishing_a_profile|registerGCUBEResource]]. Before to register the resource, the scope must be added to the local <code>GCUBEResource</code> object by invoking the method <code>GCUBEResource.addScope(<new scope>)</code>
 
:* '''Operation to invoke''': [[IS-Publisher#Publishing_a_profile|registerGCUBEResource]]. Before to register the resource, the scope must be added to the local <code>GCUBEResource</code> object by invoking the method <code>GCUBEResource.addScope(<new scope>)</code>
  
:* '''Parameters''': <code>GCUBEResource=<resource object obtained from the IS-Client></code>, <code>GCUBEScope=<new Scope></code>, <code>GCUBESecurityManager=ServiceContext.getContext()||<dummy manager></code>
+
:* '''Parameters''': <code>GCUBEResource=<resource object obtained from the IS-Client></code>, <code>GCUBEScope=<destination VO></code>, <code>GCUBESecurityManager=ServiceContext.getContext()||<dummy manager></code>
  
 
=== Add a new gCube Resource ===
 
=== Add a new gCube Resource ===

Revision as of 22:55, 20 July 2010

Section contents
Managing a gCube Hosting Node (gHN)
Managing a Running Instance (RI)
Adding / Removing a Scope to a gCube Resource
(different from gHN and RI)
Registering / Unregistering a gCube Resource in a VO
Editing a gCube Resource
Banning a gCube Resource

This section describes the programming interfaces that allow to configure, manage and control nodes, services, applications and resources in a gCube infrastructure. As the gCube technology is deployed as a distributed system, there exist several APIs to manage the different areas of the system. This section is a single point of reference for all these APIs by grouping them for their logical purpose.

This section includes the following topics:

Managing a gCube Hosting Node (gHN) Describes operations related to manage a node of the infrastructure: how to shut it down or restart it (with and without deleting its state), how to add a new scope and remove an existing scope.
Managing a Running Instance (RI) Describes operation related to running instance management: how to add a new scope and remove an existing scope, how to deploy and undeploy them
Adding / Removing a Scope to a gCube Resource
(different from gHN and RI)
Describes how to add and delete scopes to gCube Resources that are not nodes or service's instances. These operations can be performed only from a parent scope to a child scope, e.g. with them it is not possible to add a VO scope if a resource is registered only in another VO (see the next topic for this).
Registering / Unregistering a gCube Resource in a VO Describes how to register and unregister gCube Resources in the context of a Virtual Organization.
Editing a gCube Resource Describes how to change the representation of gCube Resources in the Information System. Depending on the resource type, different components have to be contacted for this.
Banning a gCube Resource Describes how to instruct the Information System to exclude certain gCube resource from a given scope. This operation is available for VO-Managers and makes sense especially for nodes and running instances, when the decision to join or not a scope is partially under the control of Site Managers.


For each of them, a detailed explanation is provided about which component(s) must be contacted for doing what and which are the scope propagation rules.

Managing a gCube Hosting Node (gHN)

Shut down

Target: Shut down the node

Component(s) to contact:

  • Where: the Running Instance on the gHN
  • How to find it: query on the IS that looks for a RI of the gHNManager running on the gHN
  • Parameters: setClean=false, setRestart=false


Restart

Target: Restart the node and preserve its state

Component(s) to contact:

  • Where: the Running Instance on the gHN
  • How to find it: query on the IS that looks for a RI of the gHNManager running on the gHN
  • Parameters: setClean=false, setRestart=true


Restart and Clean

Target: Restart the node and clean its actual state

Component(s) to contact:

  • Where: the Running Instance on the gHN
  • How to find it: query on the IS that looks for a RI of the gHNManager running on the gHN
  • Parameters: setClean=true, setRestart=true


Add an existing Scope

Target: Add a scope to a gHN and the related Service Map is already available on the gHN

Component(s) to contact:

  • Where: the Running Instance managing the Scope to add
  • How to find it: query on the IS that looks for a RI of the Resource Manager in the new scope or query on the IS that looks for the Generic Resource modeling the scope (the condition is /Resource/Profile/Body/Scope/text()=Scope Expression, then extract the service URI from /Resource/Profile/Body/Service/text()
  • Parameters: setID=<GHN ID>, setType=GHN, setTargetScope=<new Scope>


Add a new Scope

Target: Add a scope to a gHN and the related Service Map is not available on the gHN

Component(s) to contact:

  • Where: the Running Instance on the gHN
  • How to find it: query on the IS that looks for a RI of the gHNManager running on the gHN
  • Parameters: setScope=<new Scope>, setMap=<string serialization of the Map>
  • Where: the Running Instance managing the Scope to add
  • How to find it: query on the IS that looks for a RI of the Resource Manager in the new scope or query on the IS that looks for the Generic Resource modeling the scope (the condition is /Resource/Profile/Body/Scope/text()=Scope Expression, then extract the service URI from /Resource/Profile/Body/Service/text()
  • Parameters: setID=<GHN ID>, setType=GHN, setTargetScope=<new Scope>


Remove from a Scope

Target: Remove a gHN from a scope

Component(s) to contact:

  • Where: the Running Instance managing the Scope to remove
  • How to find it: query on the IS that looks for a RI of the Resource Manager in the new scope or query on the IS that looks for the Generic Resource modeling the scope (the condition is /Resource/Profile/Body/Scope/text()=Scope Expression, then extract the service URI from /Resource/Profile/Body/Service/text()
  • Parameters: setID=<GHN ID>, setType=GHN, setTargetScope=<Scope to remove>

Managing a Running Instance (RI)

Join a Scope

Target: Join a Running Instance to a scope

Component(s) to contact:

  • Where: the Running Instance managing the Scope to join
  • How to find it: query on the IS that looks for a RI of the Resource Manager in the new scope or query on the IS that looks for the Generic Resource modeling the scope (the condition is /Resource/Profile/Body/Scope/text()=Scope Expression, then extract the service URI from /Resource/Profile/Body/Service/text()
  • Parameters: setID=<RI ID>, setType=RunningInstance, setTargetScope=<Scope to Join>


Remove from a Scope

Target: Remove a Running Instance from a scope

Component(s) to contact:

  • Where: the Running Instance managing the Scope to remove
  • How to find it: query on the IS that looks for a RI of the Resource Manager in the new scope or query on the IS that looks for the Generic Resource modeling the scope (the condition is /Resource/Profile/Body/Scope/text()=Scope Expression, then extract the service URI from /Resource/Profile/Body/Service/text()
  • Parameters: setID=<RI ID>, setType=RunningInstance, setTargetScope=<Scope to remove>
  • Note: if the Running Instance is joined only to this scope, it is also undeployed


Deploy

Target: Deploy a new Running Instance in a Scope

Component(s) to contact:

  • Where: the Running Instance managing the Scope
  • How to find it: query on the IS that looks for a RI of the Resource Manager in the new scope or query on the IS that looks for the Generic Resource modeling the scope (the condition is /Resource/Profile/Body/Scope/text()=Scope Expression, then extract the service URI from /Resource/Profile/Body/Service/text()
  • Parameters: ServiceItem.setServiceClass=<Service Class>, ServiceItem.setServiceName=<Service Name>, ServiceItem.setServiceVersion=<Service Version>, ServiceItem.setGHN=<GHN ID where to deploy> (optional, suggested gHN to use), setTargetScope=<Scope to deploy in>, ServiceList.setGHN=new String[] {"GHNID1","GHNID2","GHNID3","GHNID4","GHNID5"} (optional, suggested gHNs to use)


Undeploy

Target: Force the undeployment of a Running Instance from all the scopes it is joined; for a gentler undeploy, see here

Component(s) to contact:

  • Where: the Running Instance managing the Scope to remove or (if this not work) try all the other scopes to which the RI is joined
  • How to find it: query on the IS that looks for a RI of the Resource Manager in the new scope or query on the IS that looks for the Generic Resource modeling the scope (the condition is /Resource/Profile/Body/Scope/text()=Scope Expression, then extract the service URI from /Resource/Profile/Body/Service/text()
  • Parameters: ServiceItem.setServiceClass=<Service Class of the RI>, ServiceItem.setServiceName=<Service Name of the RI>, ServiceItem.setServiceVersion=<Service Version of the RI>, setTargetScope=<Scope to undeploy from>

Adding a gCube Resource (different from gHN and RI) to a Scope

Add a gCube Resource to a Scope from the Parent Scope

Target: Add a gCube Resource to (i) a VRE scope from the parent VO or (ii) a VO scope from the infrastructure scope. If the resource is not in the parent scope, it must be registered in that scope before to be added to any scope.

Component(s) to contact:

  • Where: the Running Instance managing the Scope to add
  • How to find it: query on the IS that looks for a RI of the Resource Manager in the new scope or query on the IS that looks for the Generic Resource modeling the scope (the condition is /Resource/Profile/Body/Scope/text()=Scope Expression, then extract the service URI from /Resource/Profile/Body/Service/text()
  • Parameters: setID=<Resouurce ID>, setType=<Resource Type>, setTargetScope=<Scope to add>

Add a gCube Resource from a VO to another VO

Target: Copy a gCube Resource from a VO to another VO

Component(s) to contact:

  • Where: in the local instance of gCore
  • How to find it: on the classpath
  • Parameters: query=GCUBEResourceQuery(with an appropriate QueryParameter condition on the resource ID), Scope=

    Invalid language.

    You need to specify a language like this: <source lang="html4strict">...</source>

    Supported languages for syntax highlighting:

    4cs, 6502acme, 6502kickass, 6502tasm, 68000devpac, abap, actionscript, actionscript3, ada, aimms, algol68, apache, applescript, arm, asm, asp, asymptote, autoconf, autohotkey, autoit, avisynth, awk, bascomavr, bash, basic4gl, bf, bibtex, blitzbasic, bnf, boo, c, caddcl, cadlisp, cfdg, cfm, chaiscript, chapel, cil, clojure, cmake, cobol, coffeescript, cpp, csharp, css, cuesheet, d, dart, dcl, dcpu16, dcs, delphi, diff, div, dos, dot, e, ecmascript, eiffel, email, epc, erlang, euphoria, ezt, f1, falcon, fo, fortran, freebasic, freeswitch, fsharp, gambas, gdb, genero, genie, gettext, glsl, gml, gnuplot, go, groovy, gwbasic, haskell, haxe, hicest, hq9plus, html4strict, html5, icon, idl, ini, inno, intercal, io, ispfpanel, j, java, java5, javascript, jcl, jquery, kixtart, klonec, klonecpp, latex, lb, ldif, lisp, llvm, locobasic, logtalk, lolcode, lotusformulas, lotusscript, lscript, lsl2, lua, m68k, magiksf, make, mapbasic, matlab, mirc, mmix, modula2, modula3, mpasm, mxml, mysql, nagios, netrexx, newlisp, nginx, nimrod, nsis, oberon2, objc, objeck, ocaml, octave, oobas, oorexx, oracle11, oracle8, oxygene, oz, parasail, parigp, pascal, pcre, per, perl, perl6, pf, php, pic16, pike, pixelbender, pli, plsql, postgresql, postscript, povray, powerbuilder, powershell, proftpd, progress, prolog, properties, providex, purebasic, pycon, pys60, python, q, qbasic, qml, racket, rails, rbs, rebol, reg, rexx, robots, rpmspec, rsplus, ruby, rust, sas, scala, scheme, scilab, scl, sdlbasic, smalltalk, smarty, spark, sparql, sql, standardml, stonescript, systemverilog, tcl, teraterm, text, thinbasic, tsql, typoscript, unicon, upc, urbi, uscript, vala, vb, vbnet, vbscript, vedit, verilog, vhdl, vim, visualfoxpro, visualprolog, whitespace, whois, winbatch, xbasic, xml, xpp, yaml, z80, zxbasic


    </code>,
  • '''Name''': [[IS-Publisher]]
  • '''Where''': in the local instance of gCore
  • '''How to find it''': on the classpath
  • '''Operation to invoke''': [[IS-Publisher#Publishing_a_profile|registerGCUBEResource]]. Before to register the resource, the scope must be added to the local <code>GCUBEResource</code> object by invoking the method <code>GCUBEResource.addScope(<new scope>)</code>
  • '''Parameters''': <code>GCUBEResource=<resource object obtained from the IS-Client></code>, <code>GCUBEScope=<destination VO></code>, <code>GCUBESecurityManager=ServiceContext.getContext()||<dummy manager></code>

=== Add a new gCube Resource ===

'''Target''': Register a gCube Resource to ''(i)'' the infrastructure scope or ''(ii)'' a VO scope from scratch (e.g. the resource does not exist in any other scopes).

'''Component(s) to contact''':

  • '''Name''': [[IS-Publisher]]
  • '''Where''': in the local instance of gCore
  • '''How to find it''': on the classpath
  • '''Operation to invoke''': [[IS-Publisher#Publishing_a_profile|registerGCUBEResource]]. Before to register the resource, the scope must be added to the local <code>GCUBEResource</code> object by invoking the method <code>GCUBEResource.addScope(<new scope>)</code>
  • '''Parameters''': <code>GCUBEResource=<resource profile></code>, <code>GCUBEScope=<new Scope></code>, <code>GCUBESecurityManager=ServiceContext.getContext()||<dummy manager></code>

== Removing a gCube Resource (different from gHN and RI) from a Scope ==

=== Remove from a VRE Scope ===

'''Target''': Remove a gCube Resource from a scope

'''Component(s) to contact''':

  • '''Name''': [[Resource_Manager|Resource Manager]]
  • '''Where''': the Running Instance managing the Scope to remove
  • '''How to find it''': query on the IS that looks for a RI of the Resource Manager in the new scope or query on the IS that looks for the Generic Resource modeling the scope (the condition is <code>/Resource/Profile/Body/Scope/text()=Scope Expression</code>, then extract the service URI from <code>/Resource/Profile/Body/Service/text()</code>
  • '''Operation to invoke''': [[Resource_Manager#Request_to_remove_a_resource_from_the_scope|removeResources]]
  • '''Parameters''': <code>setID=<Resouurce ID></code>, <code>setType=<Resource Type></code>, <code>setTargetScope=<Scope to remove></code>

=== Remove from a VO Scope ===

'''Target''': Unregister a Resource from a VO. Before to proceed, the resource has to be [[Programmatic_Administration_Interface#Remove from a VRE Scope| removed from all the VRE scopes]] it belongs to.

'''Component(s) to contact''':

  • '''Name''': [[IS-Publisher]]
  • '''Where''': in the local instance of gCore
  • '''How to find it''': on the classpath
  • '''Operation to invoke''': [[IS-Publisher#Publishing_a_profile|removeGCUBEResource]]
  • '''Parameters''': <code>GCUBEResource=<resource ID></code>, <code>Type=<resource type></code>, <code>GCUBEScope=<Scope to remove from></code>, <code>GCUBESecurityManager=ServiceContext.getContext()||<dummy manager></code>

'''Note''': after the removal, the resource must be also updated in the other VO scopes it belongs to, otherwise it will wrongly report there the scopes actually removed. In order to do so, the just removed scopes must be removed from the local <code>GCUBEResource</code> object by invoking the method <code>GCUBEResource.removeScope(<scope to remove>)</code> for both the VO and all the children VRE scopes and then the [[IS-Publisher#Publishing_a_profile|updateGCUBEResource]] operation of the IS-Publisher has to be invoked in all the remaining VO and VRE scopes.

'''Note''': if one wants to delete the resource from the whole infrastructure, the operations above must be repeated in all the IS-Registry instances belonging the infrastructure.

== Registering / Unregistering a gCube Resource in a VO ==


== Editing a gCube Resource ==


== Banning a gCube Resource ==