Cloning switch ports with action batch api call

Solved
Badr-eddine
Getting noticed

Cloning switch ports with action batch api call

Hello All,
 
When attempting to utilize the organizations/{{orgId}}/switch/devices/clone api call with Meraki Action Batche, an error message is thrown, indicating that this combination is not supported:
 

 

 

{
    "errors": [
        "organizations/XXXXXXXXX/switch/devices/clone does not support Action Batches."
    ]
}

 

 

 

Here is the action batch body :

 

 

{
    "confirmed": false,
    "synchronous": true,
    "actions": [        {
            "resource": "organizations/{{organizationId}}/switch/devices/clone",
            "operation": "update",
            "body": {
                "sourceSerial": "XXXX-XXXX-XXXX",
                "targetSerials": [
                    "{{SN1}}"
                ]
            }
        }
		]
}

 

 

I'm wondering if there is any workaround?

1 Accepted Solution
JasonM
Meraki Employee
Meraki Employee

From the supported resources list for action batches it looks like you will want to use /organizations/{organizationId}/switch/devices for the resource path with the operation of clone.

View solution in original post

3 Replies 3
FMTeuchter
Conversationalist

Without seeing the whole code you most likely just need to remove the attempt to use batch action and put your code within a for loop going across each switch you want to clone. 

Thank you for your prompt response, it's a good solution, but I'm using only Postman to push the configurations. Additionally, the batch action api call can also be used to test if the configuration will be pushed correctly if the attribute confirmed is set to false

    "confirmed": false,

 

JasonM
Meraki Employee
Meraki Employee

From the supported resources list for action batches it looks like you will want to use /organizations/{organizationId}/switch/devices for the resource path with the operation of clone.

Get notified when there are additional replies to this discussion.