Create a Post
cancel
Showing results for 
Search instead for 
Did you mean: 
Nüüül
Advisor
Jump to solution

Check Point mgmt api SDK - cme api, wrong method setting new "management"?

Hello,

 

possibly a dump question - when trying to set ("cme-api/v1/management"), i get an error that "wrong method has been used".

according to the documentation a PUT method has to be used, afaik cpapi uses POST. Is there a possibility to let the sdk use the PUT method? I was not able to find some informations regarding this.

any ideas?

 

(as a workaround, i am sending a task with cli commands but that´s ... )

 

Thanks,

 

Daniel

0 Kudos
1 Solution

Accepted Solutions
Olga-Miro
Employee
Employee

Hi @Nüüül ,

We updated the SDK to use all HTTP methods. Please pull the new code from GitHub.

 

Best regards,

Olga

View solution in original post

6 Replies
PhoneBoy
Admin
Admin

Curious why it is not acceptable to use a POST method here, assuming it works?
This might be a documentation bug. 

Also, what version/JHF is running on the management?

0 Kudos
Amir_Senn
Employee
Employee

Have you tried to use CME API documentation? https://app.swaggerhub.com/apis-docs/Check-Point/cme-api/v1

Can you share full command and output?

Kind regards, Amir Senn
0 Kudos
Nüüül
Advisor

Hi Amir,

 

i am getting:

 

Click to Expand
DEBUG:root:{'name': 'azu-vm-rapoc-cp'}
API Response: APIResponse({
"data": {
"code": "err_cme_api_send_command_failed",
"message": "Invalid response message from CME API. Body: <!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 3.2 Final//EN\"> <title>405 Method Not Allowed</title> <h1>Method Not Allowed</h1> <p>The method is not allowed for the requested URL.</p> "
},
"error_message": "code: err_cme_api_send_command_failed\nmessage: Invalid response message from CME API. Body: <!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 3.2 Final//EN\"> <title>405 Method Not Allowed</title> <h1>Method Not Allowed</h1> <p>The method is not allowed for the requested URL.</p> \n",
"res_obj": {
"data": {
"code": "err_cme_api_send_command_failed",
"message": "Invalid response message from CME API. Body: <!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 3.2 Final//EN\"> <title>405 Method Not Allowed</title> <h1>Method Not Allowed</h1> <p>The method is not allowed for the requested URL.</p> "
},
"status_code": 500
},
"status_code": 500,
"success": false
}

Regarding the Documentation you sent (and i already checked 🙂 ) the management config of cme is to be sent via PUT method. 

 

My script does:

 

....
cme_init= {
    'management':
        {'name' : cme_mgmtname}
}
....
client.api_call("cme-api/v1/management", cme_init['management'])
.....

 

 

After that i am sending other commands to cme-api for configuring account and gateway, those are working... (regarding documentation, POST is used there)

 

0 Kudos
natanelm
Employee
Employee

Hi @Nüüül,

RnD are testing the issue, I will keep this thread updated with our findings.

Thanks,
Natanel 

Olga-Miro
Employee
Employee

Hi @Nüüül ,

Currently, the SDK only supports the POST method.
We are working on adding support for the PUT method to the SDK. We will keep you updated on our progress.

Best regards,
Olga

 

Olga-Miro
Employee
Employee

Hi @Nüüül ,

We updated the SDK to use all HTTP methods. Please pull the new code from GitHub.

 

Best regards,

Olga

Leaderboard

Epsum factorial non deposit quid pro quo hic escorol.

Upcoming Events

    CheckMates Events