<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Trying to create an application with Splunk's Restful API in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Trying-to-create-an-application-with-Splunk-s-Restful-API/m-p/98606#M20626</link>
    <description>&lt;P&gt;Thank you.  This helped an I can now create an application.&lt;/P&gt;

&lt;P&gt;Ken&lt;/P&gt;</description>
    <pubDate>Tue, 07 Dec 2010 22:25:00 GMT</pubDate>
    <dc:creator>sloaniebaloney</dc:creator>
    <dc:date>2010-12-07T22:25:00Z</dc:date>
    <item>
      <title>Trying to create an application with Splunk's Restful API</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Trying-to-create-an-application-with-Splunk-s-Restful-API/m-p/98604#M20624</link>
      <description>&lt;P&gt;I'm new to Splunk and am somewhat familiar with REST.  I am trying to create a new application through the Splunk RESTful API.  The installation is on windows and I am attempting to do this via curl on the command line.&lt;/P&gt;

&lt;P&gt;The command I'm typing in is as follows:&lt;/P&gt;

&lt;P&gt;curl -u myUsername:myPassword -k &lt;A href="https://localhost:8089/services/apps/local/_new/" rel="nofollow"&gt;https://localhost:8089/services/apps/local/_new/&lt;/A&gt; -d "name=MyApp"&lt;/P&gt;

&lt;P&gt;I have also tried this as a non-post with the curl command&lt;/P&gt;

&lt;P&gt;curl -u myUsername:myPassword -k &lt;A href="https://localhost:8089/services/apps/local/_new/?name=MyApp" rel="nofollow"&gt;https://localhost:8089/services/apps/local/_new/?name=MyApp&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;The first curl command returns the xml that mimics what is displayed on the splunk services server.  The second one throws an error.  I have also tried the first one with url-encoding the posted data with -data-urlencode&lt;/P&gt;

&lt;P&gt;Any suggestions would be greatly appreciated.&lt;/P&gt;

&lt;P&gt;Thanks,&lt;/P&gt;

&lt;P&gt;Ken&lt;/P&gt;</description>
      <pubDate>Fri, 03 Dec 2010 02:58:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Trying-to-create-an-application-with-Splunk-s-Restful-API/m-p/98604#M20624</guid>
      <dc:creator>sloaniebaloney</dc:creator>
      <dc:date>2010-12-03T02:58:17Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to create an application with Splunk's Restful API</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Trying-to-create-an-application-with-Splunk-s-Restful-API/m-p/98605#M20625</link>
      <description>&lt;P&gt;What version of Splunk are you using? The following instructions work for 4.1.6.&lt;/P&gt;

&lt;P&gt;To create an app, you must provide a name for the new app and a template from which to start:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;$ curl -k -u admin:admin -X POST &lt;A href="https://localhost:8089/services/apps/local" target="test_blank"&gt;https://localhost:8089/services/apps/local&lt;/A&gt; -d 'name=myapp&amp;amp;template=barebones'
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This will create an app named 'myapp' based on the barebones template.&lt;/P&gt;

&lt;P&gt;In general, '_new' is used to determine what arguments are required to create a new object (or edit an existing one). It is &lt;EM&gt;not&lt;/EM&gt; used to create the objects themselves.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;$ curl -u admin:admin -k &lt;A href="https://localhost:8089/services/apps/local/_new" target="test_blank"&gt;https://localhost:8089/services/apps/local/_new&lt;/A&gt; | xmllint --format -
[snip]
    &amp;lt;s:key name="eai:attributes"&amp;gt;
      &amp;lt;s:dict&amp;gt;
        &amp;lt;s:key name="optionalFields"&amp;gt;
          &amp;lt;s:list&amp;gt;
            &amp;lt;s:item&amp;gt;author&amp;lt;/s:item&amp;gt;
            &amp;lt;s:item&amp;gt;description&amp;lt;/s:item&amp;gt;
            &amp;lt;s:item&amp;gt;install&amp;lt;/s:item&amp;gt;
            &amp;lt;s:item&amp;gt;label&amp;lt;/s:item&amp;gt;
            &amp;lt;s:item&amp;gt;manageable&amp;lt;/s:item&amp;gt;
            &amp;lt;s:item&amp;gt;template&amp;lt;/s:item&amp;gt;
            &amp;lt;s:item&amp;gt;visible&amp;lt;/s:item&amp;gt;
          &amp;lt;/s:list&amp;gt;
        &amp;lt;/s:key&amp;gt;
        &amp;lt;s:key name="requiredFields"&amp;gt;
          &amp;lt;s:list&amp;gt;
            &amp;lt;s:item&amp;gt;name&amp;lt;/s:item&amp;gt;
          &amp;lt;/s:list&amp;gt;
        &amp;lt;/s:key&amp;gt;
        &amp;lt;s:key name="wildcardFields"&amp;gt;
          &amp;lt;s:list/&amp;gt;
        &amp;lt;/s:key&amp;gt;
      &amp;lt;/s:dict&amp;gt; 
    &amp;lt;/s:key&amp;gt;
[snip]
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 03 Dec 2010 14:51:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Trying-to-create-an-application-with-Splunk-s-Restful-API/m-p/98605#M20625</guid>
      <dc:creator>ewoo</dc:creator>
      <dc:date>2010-12-03T14:51:22Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to create an application with Splunk's Restful API</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Trying-to-create-an-application-with-Splunk-s-Restful-API/m-p/98606#M20626</link>
      <description>&lt;P&gt;Thank you.  This helped an I can now create an application.&lt;/P&gt;

&lt;P&gt;Ken&lt;/P&gt;</description>
      <pubDate>Tue, 07 Dec 2010 22:25:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Trying-to-create-an-application-with-Splunk-s-Restful-API/m-p/98606#M20626</guid>
      <dc:creator>sloaniebaloney</dc:creator>
      <dc:date>2010-12-07T22:25:00Z</dc:date>
    </item>
  </channel>
</rss>

