how to get info about the Cloudbolt Python packages

Overview

CloudBolt’s models are exposed through Django’s Object Relational Model, so understanding this ORM is key to effectively querying CloudBolt.

https://docs.cloudbolt.io/articles/#!cloudbolt-latest-docs/resources-for-writing-plug-ins

Procedure

Model Details:

  • Model details can be found on your cb instance at https://intance_ip/alladmin/doc/models/. While it doesn't necessarily provide details in how to use these models, it does provide good information about the objects that are available and their associated properties.

  • One thing to keep in mind when looking at these models: Custom Fields/Attributes are made available as dynamic properties. This means if I have a custom field called "my_custom_field" attached to a Server -- it will not show in this model documentation. It will however be available as server.my_custom_field (where the server is an instance of a Server object) at runtime and in shell_plus.

I’d like to get the documentation for the following code snippet:

  • from accounts.models import Group, Role, UserProfile, ExternalUserAttributeMapping

  • if you want to know all the functions for the UserProfile object, which is not available in model details (https://intance_ip/alladmin/doc/models/)just follow the below steps:
    a. ssh to your CB appliance
    b. /opt/cloudbolt/manage.py shell_plus
    c. import object/method
    d. type UserProfile and give dot(.) then press the "tab" button, you will see all the function which is available for that object
    e. if you won't pass any argument, it will throw an error message what all are the arguments for that function.
    UserProfile:

if you want to see a description of the method, you can use the help(object) command in shell plus.

u = UserProfile.objects.last()
help(object) i.e help(u)

Additional information

Include links to outside source articles or reference material if applicable

Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.