Ask Your Question
0

When connect to openstack cloud, what's meaning of user_agent?

asked 2017-09-01 05:07:12 -0500

liaodalin19903 gravatar image

When I read this link: http://git.openstack.org/cgit/opensta...

I saw this code for connection:

def create_connection(auth_url, region, project_name, username, password):
    prof = profile.Profile()
    prof.set_region(profile.Profile.ALL, region)

    return connection.Connection(
        profile=prof,
        user_agent='examples',
        auth_url=auth_url,
        project_name=project_name,
        username=username,
        password=password
    )

I can not understand the user_agent is for what. who can help me with this? and the project_name should fill what?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2017-09-01 10:42:14 -0500

updated 2017-09-01 10:48:21 -0500

user-agent is used to populate an http header. I don't think it's very important.

From http://git.openstack.org/cgit/opensta...:

    :param str user_agent: If a transport is not provided to the
        connection, this parameter will be used when creating a transport.
        The value given here will be prepended to the default, which is
        specified in :attr:`~openstack.transport.USER_AGENT`.
        The resulting ``user_agent`` value is used for the ``User-Agent``
        HTTP header

project-name is the OpenStack project you use for authenticating. It's part of the auth_args.

    :param auth_args: The rest of the parameters provided are assumed to be
        authentication arguments that are used by the authentication
        plugin.
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2017-09-01 05:07:12 -0500

Seen: 38 times

Last updated: Sep 01 '17