Skip to content

Commit

Permalink
ticket examples
Browse files Browse the repository at this point in the history
  • Loading branch information
allmightyspiff committed Apr 12, 2018
1 parent 2e9980d commit 3cca2e0
Show file tree
Hide file tree
Showing 19 changed files with 578 additions and 38 deletions.
4 changes: 2 additions & 2 deletions classes/index.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9617,7 +9617,7 @@
<item>
<title>Softlayer_ticket</title>
<link>https://softlayer.github.io/classes/softlayer_ticket/</link>
<pubDate>Mon, 12 Feb 2018 00:00:00 +0000</pubDate>
<pubDate>Tue, 10 Apr 2018 00:00:00 +0000</pubDate>

<guid>https://softlayer.github.io/classes/softlayer_ticket/</guid>
<description></description>
Expand Down Expand Up @@ -9671,7 +9671,7 @@
<item>
<title>Softlayer_ticket_attachment_file</title>
<link>https://softlayer.github.io/classes/softlayer_ticket_attachment_file/</link>
<pubDate>Mon, 12 Feb 2018 00:00:00 +0000</pubDate>
<pubDate>Tue, 10 Apr 2018 00:00:00 +0000</pubDate>

<guid>https://softlayer.github.io/classes/softlayer_ticket_attachment_file/</guid>
<description></description>
Expand Down
10 changes: 10 additions & 0 deletions classes/softlayer_ticket/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -461,6 +461,16 @@ <h3>reference</h3>

</ul>

<h3>rest</h3>
<ul>

<li>
<a href="https://softlayer.github.io/rest/tickets/">Tickets</a>
<div class="meta">Examples of how to use and interact with tickets</div>
</li>

</ul>

<h3>ruby</h3>
<ul>

Expand Down
12 changes: 11 additions & 1 deletion classes/softlayer_ticket/index.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,21 @@
<description>Recent content in Softlayer_ticket on SoftLayer API</description>
<generator>Hugo -- gohugo.io</generator>
<language>en-us</language>
<lastBuildDate>Mon, 12 Feb 2018 00:00:00 +0000</lastBuildDate>
<lastBuildDate>Tue, 10 Apr 2018 00:00:00 +0000</lastBuildDate>

<atom:link href="https://softlayer.github.io/classes/softlayer_ticket/index.xml" rel="self" type="application/rss+xml" />


<item>
<title>Tickets</title>
<link>https://softlayer.github.io/rest/tickets/</link>
<pubDate>Tue, 10 Apr 2018 00:00:00 +0000</pubDate>

<guid>https://softlayer.github.io/rest/tickets/</guid>
<description>Tickets Tickets are how SoftLayer and you communicate and resolve problems. They can be about anything from general questions, requests for upgrades, monitoring alerts, or anything else that might come up.
Viewing Tickets To start off, lets see how to go about getting tickets that already exist on our account. There are a variety of helper functions on the SoftLayer_Account service that deal with tickets, and they all work basically the same way.</description>
</item>

<item>
<title>SoftLayer_Ticket</title>
<link>https://softlayer.github.io/reference/services/SoftLayer_Ticket/</link>
Expand Down
10 changes: 10 additions & 0 deletions classes/softlayer_ticket_attachment_file/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,16 @@ <h3>reference</h3>

</ul>

<h3>rest</h3>
<ul>

<li>
<a href="https://softlayer.github.io/rest/tickets/">Tickets</a>
<div class="meta">Examples of how to use and interact with tickets</div>
</li>

</ul>

</ul>
</div>
</div>
Expand Down
12 changes: 11 additions & 1 deletion classes/softlayer_ticket_attachment_file/index.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,21 @@
<description>Recent content in Softlayer_ticket_attachment_file on SoftLayer API</description>
<generator>Hugo -- gohugo.io</generator>
<language>en-us</language>
<lastBuildDate>Mon, 12 Feb 2018 00:00:00 +0000</lastBuildDate>
<lastBuildDate>Tue, 10 Apr 2018 00:00:00 +0000</lastBuildDate>

<atom:link href="https://softlayer.github.io/classes/softlayer_ticket_attachment_file/index.xml" rel="self" type="application/rss+xml" />


<item>
<title>Tickets</title>
<link>https://softlayer.github.io/rest/tickets/</link>
<pubDate>Tue, 10 Apr 2018 00:00:00 +0000</pubDate>

<guid>https://softlayer.github.io/rest/tickets/</guid>
<description>Tickets Tickets are how SoftLayer and you communicate and resolve problems. They can be about anything from general questions, requests for upgrades, monitoring alerts, or anything else that might come up.
Viewing Tickets To start off, lets see how to go about getting tickets that already exist on our account. There are a variety of helper functions on the SoftLayer_Account service that deal with tickets, and they all work basically the same way.</description>
</item>

<item>
<title>SoftLayer_Ticket_Attachment_File</title>
<link>https://softlayer.github.io/reference/services/SoftLayer_Ticket_Attachment_File/</link>
Expand Down
126 changes: 115 additions & 11 deletions index.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,121 @@
<language>en-US</language>
<author>Enthusiastic Hugo User</author>
<rights>Copyright (c) 2014, Enthusiastic Hugo User; all rights reserved.</rights>
<updated>Fri, 06 Apr 2018 00:00:00 UTC</updated>
<updated>Tue, 10 Apr 2018 00:00:00 UTC</updated>

<item>
<title>Tickets</title>
<link>https://softlayer.github.io/rest/tickets/</link>
<pubDate>Tue, 10 Apr 2018 00:00:00 UTC</pubDate>
<author>Enthusiastic Hugo User</author>
<guid>https://softlayer.github.io/rest/tickets/</guid>
<description>

&lt;h1 id=&#34;tickets&#34;&gt;Tickets&lt;/h1&gt;

&lt;p&gt;Tickets are how SoftLayer and you communicate and resolve problems. They can be about anything from general questions, requests for upgrades, monitoring alerts, or anything else that might come up.&lt;/p&gt;

&lt;h2 id=&#34;viewing-tickets&#34;&gt;Viewing Tickets&lt;/h2&gt;

&lt;p&gt;To start off, lets see how to go about getting tickets that already exist on our account. There are a variety of helper functions on the &lt;a href=&#34;https://softlayer.github.io/reference/services/SoftLayer_Account/&#34;&gt;SoftLayer_Account&lt;/a&gt; service that deal with tickets, and they all work basically the same way. &lt;a href=&#34;reference/services/SoftLayer_Account/getTickets/&#34;&gt;SoftLayer_Account::getTickets&lt;/a&gt; and &lt;a href=&#34;reference/services/SoftLayer_Account/getOpenTickets/&#34;&gt;SoftLayer_Account::getOpenTickets&lt;/a&gt; are the most basic of these.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;curl -u $SL_USER:$SL_APIKEY -X GET -H &amp;#34;Accept: */*&amp;#34; -H &amp;#34;Accept-Encoding: gzip, deflate, compress&amp;#34; &amp;#39;https://api.softlayer.com/rest/v3.1/SoftLayer_Account/getOpenTickets.json&amp;#39;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Output:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;[
{
&amp;#34;accountId&amp;#34;: 307608,
&amp;#34;assignedUserId&amp;#34;: 244956,
&amp;#34;createDate&amp;#34;: &amp;#34;2018-03-30T14:41:47-06:00&amp;#34;,
&amp;#34;groupId&amp;#34;: 1004,
&amp;#34;id&amp;#34;: 57894695,
&amp;#34;lastEditDate&amp;#34;: null,
&amp;#34;lastEditType&amp;#34;: &amp;#34;USER&amp;#34;,
&amp;#34;lastResponseDate&amp;#34;: &amp;#34;2018-03-30T14:41:48-06:00&amp;#34;,
&amp;#34;modifyDate&amp;#34;: &amp;#34;2018-03-30T14:41:48-06:00&amp;#34;,
&amp;#34;notifyUserOnUpdateFlag&amp;#34;: false,
&amp;#34;priority&amp;#34;: 0,
&amp;#34;status&amp;#34;: {
&amp;#34;id&amp;#34;: 1001,
&amp;#34;name&amp;#34;: &amp;#34;Open&amp;#34;
},
&amp;#34;statusId&amp;#34;: 1001,
&amp;#34;subjectId&amp;#34;: null,
&amp;#34;title&amp;#34;: &amp;#34;Virtual Server Cancellation - 03/30/18&amp;#34;,
&amp;#34;totalUpdateCount&amp;#34;: 1,
&amp;#34;userEditableFlag&amp;#34;: true
},&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;From there, the &lt;a href=&#34;https://softlayer.github.io/reference/datatypes/SoftLayer_Ticket/&#34;&gt;SoftLayer_Ticket&lt;/a&gt; datatype has quite a few fields we might be interested in. Here is how you would get the updates for the ticket, along with whatever hardware was attached.&lt;/p&gt;

&lt;p&gt;&lt;a href=&#34;https://api.softlayer.com/rest/v3.1/SoftLayer_Account/getOpenTickets.json?&#34;&gt;https://api.softlayer.com/rest/v3.1/SoftLayer_Account/getOpenTickets.json?&lt;/a&gt;
objectMask=mask[id, title, updates, attachedHardware[hostname, id]]&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Reminder: When requesting a LOCAL property, the result will remove all local properties not specified. When requesting a RELATIONAL property, that property, along with any of its default properties, will be added&lt;/p&gt;
&lt;/blockquote&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;curl -u $SL_USER:$SL_APIKEY -X GET -H &amp;#34;Accept: */*&amp;#34; -H &amp;#34;Accept-Encoding: gzip, deflate, compress&amp;#34; &amp;#39;https://api.softlayer.com/rest/v3.1/SoftLayer_Account/getOpenTickets.json?objectMask=mask%5Bid%2Ctitle%2Cupdates%2CattachedHardware%5Bhostname%2Cid%5D%5D&amp;#39;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Output:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt; {
&amp;#34;attachedHardware&amp;#34;: [
{
&amp;#34;hostname&amp;#34;: &amp;#34;fmirdal13&amp;#34;,
&amp;#34;id&amp;#34;: 1477781
}
],
&amp;#34;id&amp;#34;: 58043007,
&amp;#34;title&amp;#34;: &amp;#34;Server Cancellation - 04/04/2018&amp;#34;,
&amp;#34;updates&amp;#34;: [
{
&amp;#34;createDate&amp;#34;: &amp;#34;2018-04-03T09:38:36-06:00&amp;#34;,
&amp;#34;editorId&amp;#34;: 205,
&amp;#34;editorType&amp;#34;: &amp;#34;AUTO&amp;#34;,
&amp;#34;entry&amp;#34;: &amp;#34;A cancellation request has been submitted for the following:\nServer: fmirdal13.insomnia.com\nPublic IP: 169.60.129.46\nPrivate IP: 10.186.96.230\nServers and services must be cancelled prior to Apr 03, 2018 23:59:59 CDT.\n=================\nCustomer Note:\n&amp;#34;,
&amp;#34;id&amp;#34;: 358332963,
&amp;#34;ticketId&amp;#34;: 58043007
}
]
},&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;To get information about just one ticket, the &lt;a href=&#34;https://softlayer.github.io/reference/services/SoftLayer_Ticket/getObject&#34;&gt;SoftLayer_Ticket::getObject&lt;/a&gt; method would be used.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;curl -u $SL_USER:$SL_APIKEY -X GET -H &amp;#34;Accept: */*&amp;#34; -H &amp;#34;Accept-Encoding: gzip, deflate, compress&amp;#34; &amp;#39;https://api.softlayer.com/rest/v3.1/SoftLayer_Ticket/58043007/getObject.json?objectMask=mask%5Bid%2Ctitle%2Cupdates%2CattachedHardware%5Bhostname%2Cid%5D%5D&amp;#39;&lt;/pre&gt;&lt;/div&gt;
&lt;h2 id=&#34;creating-tickets&#34;&gt;Creating Tickets&lt;/h2&gt;

&lt;p&gt;There are a few create options in the SoftLayer_Ticket service, the only difference being which internal group they get routed to, and should be obvious based on the method name which one you need. If in doubt, use the standard ticket, &lt;a href=&#34;reference/services/SoftLayer_Ticket/createStandardTicket/&#34;&gt;SoftLayer_Ticket::createStandardTicket&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The bare minimum to create a ticket is the following command:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;curl -u $SL_USER:$SL_APIKEY -X POST -H &amp;#34;Accept: */*&amp;#34; -H &amp;#34;Accept-Encoding: gzip, deflate, compress&amp;#34; -d &amp;#39;{&amp;#34;parameters&amp;#34;: [{&amp;#34;subjectId&amp;#34;: 1021}, &amp;#34;Content of the ticket goes here&amp;#34;]}&amp;#39; &amp;#39;https://api.softlayer.com/rest/v3.1/SoftLayer_Ticket/createStandardTicket.json&amp;#39;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;The result you get back will be a ticket object. &lt;a href=&#34;https://softlayer.github.io/python/create_ticket/&#34;&gt;This example&lt;/a&gt; has some information about which ticket subjects match up with which Ids. The whole list can be retrieved with this call.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;curl -u $SL_USER:$SL_APIKEY -X GET -H &amp;#34;Accept: */*&amp;#34; -H &amp;#34;Accept-Encoding: gzip, deflate, compress&amp;#34; &amp;#39;https://api.softlayer.com/rest/v3.1/SoftLayer_Ticket_Subject/getAllObjects.json&amp;#39;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;The &lt;code&gt;parameters&lt;/code&gt; array passed into the createStandardTicket method matches the order shown in the documentation for that method.&lt;/p&gt;

&lt;p&gt;Another example&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;curl -u $SL_USER:$SL_APIKEY -X POST -H &amp;#34;Accept: */*&amp;#34; -H &amp;#34;Accept-Encoding: gzip, deflate, compress&amp;#34; -d &amp;#39;{&amp;#34;parameters&amp;#34;: [{&amp;#34;subjectId&amp;#34;: 1021, &amp;#34;title&amp;#34;: &amp;#34;Test API Ticket&amp;#34;}, &amp;#34;Content of the ticket goes here&amp;#34;, 305250,&amp;#34;FakePass&amp;#34;,&amp;#34;Test&amp;#34;,22,&amp;#34;HARDWARE&amp;#34;]}&amp;#39; &amp;#39;https://api.softlayer.com/rest/v3.1/SoftLayer_Ticket/createStandardTicket.json&amp;#39;&lt;/pre&gt;&lt;/div&gt;
&lt;h2 id=&#34;updating-tickets&#34;&gt;Updating Tickets&lt;/h2&gt;

&lt;p&gt;Once a ticket is created, you may want to update it to respond to another update, or add more information. This is done through the &lt;a href=&#34;https://softlayer.github.io/reference/services/SoftLayer_Ticket/addUpdate/&#34;&gt;SoftLayer_Ticket::addUpdate&lt;/a&gt; method.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;curl -u $SL_USER:$SL_APIKEY -X POST -H &amp;#34;Accept: */*&amp;#34; -H &amp;#34;Accept-Encoding: gzip, deflate, compress&amp;#34; -d &amp;#39;{&amp;#34;parameters&amp;#34;: [{&amp;#34;entry&amp;#34;: &amp;#34;Testing updates&amp;#34;}]}&amp;#39; &amp;#39;https://api.softlayer.com/rest/v3.1/SoftLayer_Ticket/&amp;lt;TICKET ID YOU WANT TO UDPATE&amp;gt;/addUpdate.json&amp;#39;&lt;/pre&gt;&lt;/div&gt;
&lt;h2 id=&#34;attachments&#34;&gt;Attachments&lt;/h2&gt;

&lt;h3 id=&#34;attach-files&#34;&gt;Attach Files&lt;/h3&gt;

&lt;p&gt;&lt;a href=&#34;https://softlayer.github.io/reference/services/SoftLayer_Ticket/addAttachedFile/&#34;&gt;SoftLayer_Ticket::addAttachedFile&lt;/a&gt; is useful when you need to add a screenshot, PDF, or something else thats not plain text to a ticket.&lt;/p&gt;

&lt;p&gt;Our ticket ID for this example is 58504963.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;NOTE&lt;/em&gt; the &lt;code&gt;data&lt;/code&gt; field MUST be base64 encoded, which can be tricky to do in bash. The base64 string needs to be enclosed with &amp;ldquo;&amp;rdquo;, but bash needs the $(base64 &lt;file&gt;) bit to be escaped from the &amp;ldquo; string.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;curl -u $SL_USER:$SL_APIKEY -X POST -H &amp;#34;Accept: */*&amp;#34; -H &amp;#34;Accept-Encoding: gzip, deflate, compress&amp;#34; --data &amp;#39;{&amp;#34;parameters&amp;#34;: [{&amp;#34;data&amp;#34;: &amp;#34;&amp;#39;&amp;#34;$(base64 test.txt)&amp;#34;&amp;#39;&amp;#34;, &amp;#34;filename&amp;#34;: &amp;#34;test2.txt&amp;#34;}]}&amp;#39; &amp;#39;https://api.softlayer.com/rest/v3.1/SoftLayer_Ticket/58504963/addAttachedFile&amp;#39;&lt;/pre&gt;&lt;/div&gt;
&lt;h3 id=&#34;attach-hardware&#34;&gt;Attach Hardware&lt;/h3&gt;

&lt;p&gt;For the best response from Support, you should attach any relevant hardware or virtual guests to the ticket, so Support knows which servers you are specifically talking about.&lt;/p&gt;

&lt;p&gt;There are different methods if you want to attach a bare metal or virtual server, but they behave the same.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4&#34;&gt;curl -u $SL_USER:$SL_APIKEY -X POST -H &amp;#34;Accept: */*&amp;#34; -H &amp;#34;Accept-Encoding: gzip, deflate, compress&amp;#34; --data &amp;#39;{&amp;#34;parameters&amp;#34;: [481966]}&amp;#39; &amp;#39;https://api.softlayer.com/rest/v3.1/SoftLayer_Ticket/58504963/addAttachedHardware&amp;#39;

curl -u $SL_USER:$SL_APIKEY -X POST -H &amp;#34;Accept: */*&amp;#34; -H &amp;#34;Accept-Encoding: gzip, deflate, compress&amp;#34; --data &amp;#39;{&amp;#34;parameters&amp;#34;: [27500547]}&amp;#39; &amp;#39;https://api.softlayer.com/rest/v3.1/SoftLayer_Ticket/58504963/addAttachedVirtualGuest&amp;#39;&lt;/pre&gt;&lt;/div&gt;
&lt;h2 id=&#34;final-bits&#34;&gt;Final Bits&lt;/h2&gt;

&lt;p&gt;Hopefully that helps explain most of the actions you can do with tickets.&lt;/p&gt;
</description>
</item>

<item>
<title>Release notes: April 6, 2018</title>
Expand Down Expand Up @@ -1579,15 +1693,5 @@ If you start to experience connection errors on the transition date, the best co
</description>
</item>

<item>
<title>SoftLayer ObjectStorage API</title>
<link>https://softlayer.github.io/reference/objectstorageapi/</link>
<pubDate>Mon, 12 Feb 2018 00:00:00 UTC</pubDate>
<author>Enthusiastic Hugo User</author>
<guid>https://softlayer.github.io/reference/objectstorageapi/</guid>
<description>&lt;p&gt;SoftLayer Object Storage is built from &lt;a href=&#34;https://docs.openstack.org/swift/latest/&#34;&gt;Open Stack Swift&lt;/a&gt;&lt;/p&gt;
</description>
</item>

</channel>
</rss>
10 changes: 10 additions & 0 deletions rest/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,16 @@
<div class="col-md-6">
<div class="well well-sm example">
<h4>
<a href="https://softlayer.github.io/rest/tickets/"><i class="fas fa-terminal"></i> Tickets</a> <small class="pull-right">Apr 10, 2018</small><br>
<small>Examples of how to use and interact with tickets</small>
</h4>
<a class="btn btn-primary btn-xs" href="https://softlayer.github.io/rest/tickets/"> View Example <i class="fas fa-code"></i></a>
</div>
</div>

<div class="col-md-6">
<div class="well well-sm example">
<h4>
<a href="https://softlayer.github.io/rest/events/"><i class="fas fa-terminal"></i> Events</a> <small class="pull-right">Apr 5, 2018</small><br>
<small>Going over Events with some examples of what each might look like</small>
</h4>
Expand Down
Loading

0 comments on commit 3cca2e0

Please sign in to comment.