Login | Join Now
  • CUBiT API: HostAssignProfileAndRebuild

    Product:
    CUBiT

    Component:
    CUBiT Web Services

    Summary:

    Assign a profile/version to the host and rebuild it with that profile/version.



     

    1.1. Description

    Assign a profile to the host and rebuild it with that profile/version. The user must be authorized to rebuild the host. The host must also not be in any of the following states: Immutable, Rebuild, or Rebuilding, or this method will fail. If you do not want to change the profile a host is running, and just want to rebuild a host, you can save a few keystrokes and use the Rebuild method instead.

    1.2. URL

    /cubit_api/1/assign_rebuild

    1.3. Authentication

    This method requires authentication using an API key.

    1.4. Parameters

    	host ( Required, once )
    		Fully qualified hostname to assign profile to and rebuild. 
    		Type: String
    	profile ( Required, once )
    		Name of the profile to assign to the host. 
    		Type: String
    	revision ( zero or once )
    		Revision number of the profile you wish to assign to the host. Mutually exclusive with the 
    		version option, but at least one of the version or revision options must be specified. 
    		Type: String
    	sig ( Required, once )
    		API authentication hash signature. 
    		Type: String
    	userid ( Required, once )
    		The login name of the user initiating the request. 
    		Type: String
    	version ( zero or once )
    		Version number or tag name of the profile you wish to assign to the host. The special 
    		version tag HEAD always denotes the latest version of the profile at the moment of execution. 
    		Note that profile tags can move between versions: this is a useful feature, but you should be 
    		aware of it. Mutually exclusive with the revision option, but at least one of the version or 
    		revision options must be specified. 
    		Type: String
    

    1.5. Example Response

    Successful initiation of rebuild:

    	<?xml version='1.0'?>
    	<cubit version='1'>
    		<status>OK</status>
    	</cubit>
    	
    	If the user is unauthorized, or the host does not exist:
    	<?xml version='1.0'?>
    	<cubit version='1'>
    		<error>You are not authorized to allocate a profile to this host and rebuild it.</error>
    	</cubit>
    

    1.6. Response Codes

    • 200 - ok
    • 400 - Login failed / Insufficient permissions