It's all about the answers!

Ask a question

Attribute data type POST/PUT/GET in DNG as ADMIN with REST and python


durga sankar (133) | asked Jun 30, 3:12 a.m.
edited Jun 30, 3:58 a.m.

 I am trying to write a script for DNG ( me as new user), i have admin access and this script is to do below,

  1. Create new attribute data type if not present.
  2. Update data type values if data type existing
i am trying to search the template where i can post or put to create or update the data type. but unable to get it.
i am following rootservices-->catalog-->service.xml. But unable to identify any possibility as i am new to it.

Can anyone please guide me how to find links and how to create and update the attribute data type in DNG with REST python. 
i know how to implement with python, if anyone can give me some guide on how to find APIs and how to GET the schema(XML) and how to push with Headers( i got one header which i don't know what value to give "net.jazz.jfs.owning-context"). 

Please give some guidance how to find proper address to push and do get and put for attribute data type in DNG.

3 answers



permanent link
Bhagath P B (3236) | answered Jun 30, 3:20 a.m.

 Hi Durga,


Please refer the general GET, PUT examples in the below documentation.
I am not aware as how this could be implemented using Python


Comments
durga sankar commented Jun 30, 3:22 a.m.

i know how to implement using python , i just need how to get the api links and xml schema. where to push the xml schema so it will be created.  or updated. 


permanent link
Steven Wallace (333) | answered Jul 12, 12:18 p.m.
edited Jul 12, 12:56 p.m.
Durga,

I've used the following to update one.
PUT:  <base-url>/rm/types/<external_id>

Make sure to include the following in the header:
Content-Type
OSLC-Core-Version
If-Match (eTag)

I've never created one though.

-- Steve

Comments
durga sankar commented Jul 14, 6:42 a.m.

so, i need to do a get first to verify it's there or not, 

then if there i will update else create.

so now Q. is how i can get all the attribute types and if i want to push where should i push so the external_id will auto generate. like Slug_someID generates in QM test case create time. 


permanent link
Nasuh Isiktas (461) | answered Jul 13, 2:56 a.m.

Hi Durga,

you can create attribute datatypes over the Rest API of the GC application.

You can take a look at: <host>:port/gc/doc/scenarios
I am also using python, it works pretty well if you have developed a proper framework


Comments
durga sankar commented Jul 14, 3:01 a.m.

 thank you so much for the kick start, i am very new to DNG,  so can you give some more info, how can i go with python more in this ? like what data/body should i post, and any other details please ? will help a lot to me as beginner !


David Honey commented Jul 14, 4:22 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

Nasuh, the OP was asking about attribute data types in DNG, not GCM. The GCM REST APIs are not relevant to the OP's question.

Your answer


Register or to post your answer.