cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2699
Views
50
Helpful
32
Replies

Modify Resource through company website (http://<server>/adminapi/resources/{id})

RarJacobsen
Level 1
Level 1

Hi everybody,

I have a question regarding changing agent skills automatically every night.

I've been told that it's possible to change agent skills back to "default" by using :

(found in Cisco-uccx-developer-guide-902.pdf)

Modify Resource



URI

http://<server>/adminapi/resources/{id}

Example URI

http://<server>/adminapi/resources/{id}

HTTP Method

PUT

Content Type

Application/XML, Application/JSON

HTTP Success Code

200

HTTP Failure Codes

401, 402, 405

Failure Response

-

Error Codes

-

But when I try I keep getting error 405 (Method not allowed) when using this script :

        Try

            Dim strHTTP = Request.ServerVariables("HTTP_HOST")

            Dim strServerFile As String = strHTTP & "/Webpage/Cisco_files/XML_masterfile.xml"

            Dim wc As WebClient = New WebClient

            wc.Credentials = New System.Net.NetworkCredential(usernameGoesHere, passwordGoesHer)

            wc.UploadString("http://10.146.102.13:8080/adminapi/resource/", "PUT", strServerFile)

        Catch ex As Exception

            Response.Write(ex)

        End Try

Can anybody tell me what I'm doing wrong?

See attached XML file for file details

32 Replies 32

Gergely Szabo
VIP Alumni
VIP Alumni

Hi,

is there any other error message apart from the HTTP status?

Also, did you try looking at the logs? Start up RTMT and look for one named catalina.out.

G.

The problem is that I'm placed in an external company that are using the system, but we dont administrate it from here - so I'm not sure that I have access to those logs. What is the RTMT?

The error I get is in danish :

System.Net.WebException: Fjernserveren returnerede en fejl: (405) Metoden er ikke tilladt.    ved System.Net.WebClient.UploadDataInternal(Uri address, String method, Byte[] data, WebRequest& request)    ved System.Net.WebClient.UploadString(Uri address, String method, String data)    ved System.Net.WebClient.UploadString(String address, String method, String data)    ved _CiscoChange.UpdateAgentSkills() i E:\Projects\Webpage\CiscoChange.aspx.vb:linje 17

Fjernserveren returnerede en fejl: (405) Metoden er ikke tilladt = Remoteserver returned an error : (405) Method is not allowed

Is it possible to do from a SQL storedprocedure instead you think?

Hi,

no, SQL is not an option for administering UCCX. The REST API has been created to do that.

I'll try and install a UCCX 9 in my lab as soon as I find the installation media.

RTMT = RealTime Monitoring Tool, a software to download and analyze logs from UCCX.

G.

Real Time Monitoring Tool? I've got access to that ... I'll be right back!

Hi again Gergely,

I can't find the file i RTMT and I don't have access to root/ where it's also placed

Would be great if you are able to install and help me - thanks

Hi,

it's available on the UCCX. Tools > Pugins.

Once installed, go to the Trace & Log Central, Collect Files, select all files for both UCCX and System, then do the REST API test again, then download the recent logs. We are looking for one named catalina.out.

G.

I still cant find the file, all I get is this :

Collect Files in progress for node telm98cucm01.dk.telmore.net

Downloading results into E:\\TraceCollectionResult_2013-12-17_12-46-59_telm98cucm01.dk.telmore.net.xml for node telm98cucm01.dk.telmore.net

Completed downloading results into ...E:\\TraceCollectionResult_2013-12-17_12-46-59_telm98cucm01.dk.telmore.net.xml for node telm98cucm01.dk.telmore.net

Downloading files for node telm98cucm01.dk.telmore.net

Downloaded cdr_StandAloneCluster_02_201312171142_57043 from the node: telm98cucm01.dk.telmore.net

Downloaded cdr_StandAloneCluster_01_201312171142_84793 from the node: telm98cucm01.dk.telmore.net

Downloaded cdr_StandAloneCluster_02_201312171143_57044 from the node: telm98cucm01.dk.telmore.net

Downloaded cdr_StandAloneCluster_01_201312171143_84794 from the node: telm98cucm01.dk.telmore.net

Downloaded cdr_StandAloneCluster_02_201312171144_57045 from the node: telm98cucm01.dk.telmore.net

Downloaded cdr_StandAloneCluster_01_201312171144_84795 from the node: telm98cucm01.dk.telmore.net

Downloaded cdr_StandAloneCluster_02_201312171145_57046 from the node: telm98cucm01.dk.telmore.net

Downloaded cdr_StandAloneCluster_01_201312171145_84796 from the node: telm98cucm01.dk.telmore.net

Downloaded cdr_StandAloneCluster_02_201312171146_57047 from the node: telm98cucm01.dk.telmore.net

**********Collection Summary**********

HostName: telm98cucm01.dk.telmore.net

No.of files Collected: 9

Collection Failed for: 1 files.

The following files were not collected:

cdr_StandAloneCluster_01_201312171146_84797

*******************************************

Completed downloading for node telm98cucm01.dk.telmore.net

Hi,

er... you are downloding CDR files from a CUCM.

I might need to take a look at the log files from a UCCX.

G.

I'm getting this error, but that might be because it's server 2 - we also have one called telm98cucm01

Okay, this is another CUCM server.

Can you tell me the address of your UCCX server?

G.

I just got a lot more files this time around and I can see that we got catalina.out also

UCCX is called https://10.146.102.12 - but when I called that yesterday it failed collecting Ressources ... today it works

Hi,

I ran through that log quickly, but I can't see anything in detail.

Anyway, what is 10.146.102.13?

G.

One more thing, the doc says you need to pass the user ID (~ agent ID, or in CUCM: End User) in the URL

So you'll have to modify this line of your script:

wc.UploadString("

http://10.146.102.13:8080/adminapi/resource/

", "PUT", strServerFile)

to

wc.UploadString("

http://10.146.102.13:8080/adminapi/resource/johndoe

", "PUT", strServerFile)

G.

10.146.102.13 is Cisco Unified Intelligence Center

Ahh ... I thought I could update all agents in one run.

No I get error (415) Unsupported Media Type - I'll see if I can geet a new catalina file