cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Want the oppurtunity to discuss enhancements to PTC products? Join a working group! X

Get All Services of a Thing

pshashipreetham
17-Peridot

Get All Services of a Thing

Hi,

 

Is there a service where I can get all the Services in a Thing?

 

Thanks,

Shashi Preetham
1 ACCEPTED SOLUTION

Accepted Solutions

Hi,

 

For my useCase, I have used below code:

let metadata = Things["XYZ"].GetMetadata();

result = metadata.serviceDefinitions;

result.RemoveField("description");
result.RemoveField("aspects");
result.RemoveField("sourceName");
result.RemoveField("category");
result.RemoveField("isLocalOnly");
result.RemoveField("isPrivate");
result.RemoveField("isAllowOverride");
result.RemoveField("resultType");
result.RemoveField("parameterDefinitions");
result.RemoveField("sourceType");

 

Thanks @Velkumar for the response.

 

Thanks,

Shashi Preetham

View solution in original post

4 REPLIES 4

Hi @pshashipreetham 

 

You can use GetServiceDefinitions to get services list in a Thing

 

/VR

Hello @pshashipreetham,

 

It looks like you have a response from a community member. If it helped you solve your question please mark the reply as the Accepted Solution. 

Of course, if you have more to share on your issue, please let the Community know so other community members can continue to help you.

Thanks,
Community Moderation Team.

I have another solution, will post soon.

Shashi Preetham

Hi,

 

For my useCase, I have used below code:

let metadata = Things["XYZ"].GetMetadata();

result = metadata.serviceDefinitions;

result.RemoveField("description");
result.RemoveField("aspects");
result.RemoveField("sourceName");
result.RemoveField("category");
result.RemoveField("isLocalOnly");
result.RemoveField("isPrivate");
result.RemoveField("isAllowOverride");
result.RemoveField("resultType");
result.RemoveField("parameterDefinitions");
result.RemoveField("sourceType");

 

Thanks @Velkumar for the response.

 

Thanks,

Shashi Preetham
Top Tags