[Users] Fwd: How to approve the host to custom cluster instead the default cluster
Mohua Li
moli at redhat.com
Tue Dec 11 10:38:59 UTC 2012
On Tue, Dec 11, 2012 at 11:23:18AM +0200, Michael Pasternak wrote:
> Hi Mohua,
>
> >
> > -------- Original Message --------
> > Subject: [Users] How to approve the host to custom cluster instead the default cluster
> > Date: Tue, 11 Dec 2012 15:22:43 +0800
> > From: Mohua Li <moli at redhat.com>
> > To: users at ovirt.org
> >
> > Hi all,
> >
> > In admin portal, when try to approve a host, need to select the cluster first, but with rest api,
> >
> > /*code*/
> >
> > try:
> > api = API(url="HOST",
> > username="USER",
> > password="PASS",
> > ca_file="ca.crt")
> > h = api.hosts.get(name="Atlantic")
> > if(h.approve()):
> > print "Host '%s' approved (Status: %s)." % (h.get_name(),
> > h.get_status().get_state())
> > else:
> > print "Approval of '%s' failed." % h.get_name()
> > api.disconnect()
> > except Exception as ex:
> > print "Unexpected error: %s" % ex
> >
> > above code will register to the default cluster, could you give me an example how to register to the custom
> > cluster instead the default? or i misunderstand some workflow, light me pls, thanks
>
> If you'll look at host.approve().__doc__, you will see:
>
> '''
> @type Action:
>
> [@param action.cluster.id|name: string]
> [@param action.async: boolean]
> [@param action.grace_period.expiry: long]
> [@param correlation_id: any string]
>
> @return Response:
> '''
>
> i.e you have to specify action.cluster.id|name in .approve() method.
thanks for the information
>
> >
> >
> >
> > Regards,
> > Mohua Li
> >
> >
> >
> >
> >
>
>
> --
>
> Michael Pasternak
> RedHat, ENG-Virtualization R&D
--
我只担心一件事,我怕我配不上我所遭受的苦难
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 490 bytes
Desc: Digital signature
URL: <http://lists.ovirt.org/pipermail/users/attachments/20121211/c2c6a293/attachment-0001.sig>
More information about the Users
mailing list