Developer

last person joined: 2 days ago 

Expand all | Collapse all

ArubaOS: Set port name/description to blank (via API/REST)

This thread has been viewed 3 times
  • 1.  ArubaOS: Set port name/description to blank (via API/REST)

    MVP GURU
    Posted Oct 08, 2018 04:19 PM

    Hi,

     

    I search howto set to default the name/description of port (using PUT method on /rest/v4/port URI)

     

    but look not possible...



  • 2.  RE: ArubaOS: Set port name/description to blank (via API/REST)

    Posted Oct 11, 2018 09:24 AM

    Hey, 

     

    Totally new to the ArubaOS API, but i like APIs so I gave it a shot.

     

    But I had the same results as you, writing "" or even None/null-types gave me errors:

    {"message":"Incomplete input: name"}

    {"message":"Wrong type for name"}

     

    And there seems to be no delete methods for this either (not sure if you can delete anything that is a sub-command).

     

     



  • 3.  RE: ArubaOS: Set port name/description to blank (via API/REST)

    MVP GURU
    Posted Oct 11, 2018 03:26 PM

    Thanks for feedback... my code is not wrong ;-)

    There is missing feature for this...

     

    I known there is a AnyCLI but no a good solution for me...



  • 4.  RE: ArubaOS: Set port name/description to blank (via API/REST)

    EMPLOYEE
    Posted Oct 19, 2018 03:09 PM

    Currently its a bug in the REST API where we have to specify atleast a charecter  to update the port name using API. We will look into fixing it.

    For now you may need to use anycli api option till that get fixed.



  • 5.  RE: ArubaOS: Set port name/description to blank (via API/REST)

    MVP GURU
    Posted Oct 23, 2018 06:50 AM

    @rajani.abraham wrote:

    Currently its a bug in the REST API where we have to specify atleast a charecter  to update the port name using API. We will look into fixing it.

    For now you may need to use anycli api option till that get fixed.


    Thanks for feedback.

    There is a number of case/issue ? for following this ?



  • 6.  RE: ArubaOS: Set port name/description to blank (via API/REST)

    MVP GURU
    Posted Dec 03, 2018 03:15 PM

    same issue with DNS... it is complicated to remove DNS name or server... :(



  • 7.  RE: ArubaOS: Set port name/description to blank (via API/REST)

    Posted Oct 12, 2018 08:21 AM

    It is not meant to be NULL

    "name":
            {
                "description": "The name of the Port.", 
                "type": "string", 
                "maxLength": 64, 
                "minLength": 1, 
                "sql.unique": true
            },


  • 8.  RE: ArubaOS: Set port name/description to blank (via API/REST)

    MVP GURU
    Posted Oct 14, 2018 08:20 AM

    @dregoriuss wrote:

    It is not meant to be NULL

    "name":
            {
                "description": "The name of the Port.", 
                "type": "string", 
                "maxLength": 64, 
                "minLength": 1, 
                "sql.unique": true
            },

    Bug on API ? :)



  • 9.  RE: ArubaOS: Set port name/description to blank (via API/REST)

    Posted Oct 14, 2018 09:18 AM
    It is documented, so it‘s not a bug.
    The delete option is just missing


  • 10.  RE: ArubaOS: Set port name/description to blank (via API/REST)

    MVP GURU
    Posted Oct 15, 2018 02:38 PM

    @dregoriuss wrote:
    It is documented, so it‘s not a bug.
    The delete option is just missing

    it will be strange to get a DELETE for only remove a description name...

    it is a wront definition for this field... i can be null



  • 11.  RE: ArubaOS: Set port name/description to blank (via API/REST)

    EMPLOYEE
    Posted Jul 01, 2019 02:48 PM

    The key in this resourse will be updated in the AOS-S 16.09 release. 

    The name key will allow for a "null" or "zero length" name.

    "name":
            {
                "description": "The name of the Port. An \"\" denotes removal of 
               already configured name if exists.",
               "type": "string", 
                "maxLength": 64, 
                "minLength": 0, 
                "sql.unique": true
            },

    with a cURL commnad like:curl --noproxy <switch IP> --cookie "<sessionId cookie>" -i -k -X PUT https://<switch IP>/rest/v7/ports/<port ID> -d '{"id": "7", "name": "testPort"}'a response like this will be returned from the API: 

    {
    "uri":"/ports/7","id":"7",
    "name":"testPort",
    "is_port_enabled":true,
    "is_port_up":false,
    "config_mode":"PCM_AUTO",
    "trunk_mode":"PTT_NONE",
    "lacp_status":"LAS_DISABLED",
    "trunk_group":"",
    "is_flow_control_enabled":false,
    "is_dsnoop_port_trusted":false
    }

    or if left empty, curl --noproxy <switch IP> --cookie "<sessionId cookie>" -i -k -X PUT https://<switch IP>/rest/v7/ports/<port ID> -d '{"id": "7", "name": ""}'the respose from the API is:

    {
    "uri":"/ports/7",
    "id":"7",
    "name":"",
    "is_port_enabled":true,
    "is_port_up":false,
    "config_mode":"PCM_AUTO",
    "trunk_mode":"PTT_NONE",
    "lacp_status":"LAS_DISABLED",
    "trunk_group":"",
    "is_flow_control_enabled":false,
    "is_dsnoop_port_trusted":false
    }


  • 12.  RE: ArubaOS: Set port name/description to blank (via API/REST)

    MVP GURU
    Posted Jul 01, 2019 03:10 PM

    Yes, i have see this but not yet tested... (and there is also some other field where it is complicated to set default value...)



  • 13.  RE: ArubaOS: Set port name/description to blank (via API/REST)

    EMPLOYEE
    Posted Jul 03, 2019 05:49 AM

    The updates to the 16.09 API v7 are detailed in the REST guide, these act as the API release notes. See chapter 4:

     

    https://support.hpe.com/hpsc/doc/public/display?docId=a00076277en_us



  • 14.  RE: ArubaOS: Set port name/description to blank (via API/REST)

    MVP GURU
    Posted Jul 03, 2019 06:32 AM

    @joeneville wrote:

    The updates to the 16.09 API v7 are detailed in the REST guide, these act as the API release notes. See chapter 4:

     

    https://support.hpe.com/hpsc/doc/public/display?docId=a00076277en_us


    Yes Changelog is nice !