Skip to content

Allow cmk to pass * as parameter value #128

Closed

Description

@yadvr

In some APIs, the value * isn't encoded properly (for example, setting up global setting values). This has been fixed for the cloudstack-go SDK here: apache/cloudstack-go#52

We should look at changes on https://github.com/apache/cloudstack-go/pull/52/files#diff-866d8df59b9cf9a2319595a38dd83789af4cc7666722d1fde09c1b9e7816bfd2R543 to encode the params at correctly https://github.com/apache/cloudstack-cloudmonkey/blob/main/cmd/network.go#L194 for such cases.

Activity

  1. added this to the 6.3.0 milestone on Apr 3, 2023
  2. davidjumani commented on Apr 4, 2023

    @davidjumani
    Contributor

    Hi @rohityadavcloud Could you please provide an example ? I tried createing a user / account with * in the name as well as updating a global setting with * in the value and the result was as expected
    Although the * character was encoded in the request url, the resuling change / response is as expected

    Eg:

    (localhost) 🐱 > update configuration name=consoleproxy.url.domain value=*.turboio.com
    [debug] ExecLine line:update configuration name=consoleproxy.url.domain value=*.turboio.com
    [debug] ExecCmd args: update, configuration, name=consoleproxy.url.domain, value=*.turboio.com
    [debug] Login POST URL:http://localhost:8080/client/apimap[command:[login] domain:[/] password:[password] response:[json] username:[admin]]
    [debug] Login POST response status code:200
    [debug] Login sessionkey:IYtbd90sWYjnfk-wjOLEl5h9NtA
    [debug] NewAPIRequest API request URL:http://localhost:8080/client/api?command=updateConfiguration&name=consoleproxy.url.domain&response=json&sessionkey=IYtbd90sWYjnfk-wjOLEl5h9NtA&value=%2A.turboio.com
    [debug] NewAPIRequest response status code:200
    [debug] NewAPIRequest response body:{"updateconfigurationresponse":{"configuration":{"category":"Console Proxy","group":"System VMs","subgroup":"ConsoleProxyVM","name":"consoleproxy.url.domain","value":"*.turboio.com","defaultvalue":"","description":"Console proxy url domain","isdynamic":false,"component":"AgentManager","displaytext":"Consoleproxy url domain","type":"String"}}}
    {
      "configuration": {
        "category": "Console Proxy",
        "component": "AgentManager",
        "defaultvalue": "",
        "description": "Console proxy url domain",
        "displaytext": "Consoleproxy url domain",
        "group": "System VMs",
        "isdynamic": false,
        "name": "consoleproxy.url.domain",
        "subgroup": "ConsoleProxyVM",
        "type": "String",
        "value": "*.turboio.com"
      }
    }
    
  3. yadvr commented on Apr 4, 2023

    @yadvr
    MemberAuthor

    @davidjumani can you check apache/cloudstack-go#52 and for testing just pass * as value to the global setting both in cli and via shell script to cmk.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions