createApiKey
Creates a new api key in the specified project.
/api/v2/projects/{projectId}/api-keys
Usage and SDK Samples
curl -X POST\
-H "Accept: application/json"\
-H "Content-Type: application/json"\
"https://csa110x-sec-1.csa110x-sec.root.hwx.site:18121/api/v2/projects/{projectId}/api-keys"
import io.swagger.client.*;
import io.swagger.client.auth.*;
import io.swagger.client.model.*;
import io.swagger.client.api.APIKeyOperationsApi;
import java.io.File;
import java.util.*;
public class APIKeyOperationsApiExample {
public static void main(String[] args) {
APIKeyOperationsApi apiInstance = new APIKeyOperationsApi();
ApiKeySyncDto body = ; // ApiKeySyncDto |
String projectId = projectId_example; // String |
String authorization = authorization_example; // String |
try {
ApiKeyDto result = apiInstance.createApiKey(body, projectId, authorization);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling APIKeyOperationsApi#createApiKey");
e.printStackTrace();
}
}
}
import io.swagger.client.api.APIKeyOperationsApi;
public class APIKeyOperationsApiExample {
public static void main(String[] args) {
APIKeyOperationsApi apiInstance = new APIKeyOperationsApi();
ApiKeySyncDto body = ; // ApiKeySyncDto |
String projectId = projectId_example; // String |
String authorization = authorization_example; // String |
try {
ApiKeyDto result = apiInstance.createApiKey(body, projectId, authorization);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling APIKeyOperationsApi#createApiKey");
e.printStackTrace();
}
}
}
ApiKeySyncDto *body = ; //
String *projectId = projectId_example; //
String *authorization = authorization_example; // (optional)
APIKeyOperationsApi *apiInstance = [[APIKeyOperationsApi alloc] init];
// Creates a new api key in the specified project.
[apiInstance createApiKeyWith:body
projectId:projectId
authorization:authorization
completionHandler: ^(ApiKeyDto output, NSError* error) {
if (output) {
NSLog(@"%@", output);
}
if (error) {
NSLog(@"Error: %@", error);
}
}];
var StreamingSqlEngineApi = require('streaming_sql_engine_api');
var api = new StreamingSqlEngineApi.APIKeyOperationsApi()
var body = ; // {{ApiKeySyncDto}}
var projectId = projectId_example; // {{String}}
var opts = {
'authorization': authorization_example // {{String}}
};
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
api.createApiKey(bodyprojectId, opts, callback);
using System;
using System.Diagnostics;
using IO.Swagger.Api;
using IO.Swagger.Client;
using IO.Swagger.Model;
namespace Example
{
public class createApiKeyExample
{
public void main()
{
var apiInstance = new APIKeyOperationsApi();
var body = new ApiKeySyncDto(); // ApiKeySyncDto |
var projectId = projectId_example; // String |
var authorization = authorization_example; // String | (optional)
try
{
// Creates a new api key in the specified project.
ApiKeyDto result = apiInstance.createApiKey(body, projectId, authorization);
Debug.WriteLine(result);
}
catch (Exception e)
{
Debug.Print("Exception when calling APIKeyOperationsApi.createApiKey: " + e.Message );
}
}
}
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');
$api_instance = new Swagger\Client\ApiAPIKeyOperationsApi();
$body = ; // ApiKeySyncDto |
$projectId = projectId_example; // String |
$authorization = authorization_example; // String |
try {
$result = $api_instance->createApiKey($body, $projectId, $authorization);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling APIKeyOperationsApi->createApiKey: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::SwaggerClient::Configuration;
use WWW::SwaggerClient::APIKeyOperationsApi;
my $api_instance = WWW::SwaggerClient::APIKeyOperationsApi->new();
my $body = WWW::SwaggerClient::Object::ApiKeySyncDto->new(); # ApiKeySyncDto |
my $projectId = projectId_example; # String |
my $authorization = authorization_example; # String |
eval {
my $result = $api_instance->createApiKey(body => $body, projectId => $projectId, authorization => $authorization);
print Dumper($result);
};
if ($@) {
warn "Exception when calling APIKeyOperationsApi->createApiKey: $@\n";
}
from __future__ import print_statement
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint
# create an instance of the API class
api_instance = swagger_client.APIKeyOperationsApi()
body = # ApiKeySyncDto |
projectId = projectId_example # String |
authorization = authorization_example # String | (optional)
try:
# Creates a new api key in the specified project.
api_response = api_instance.create_api_key(body, projectId, authorization=authorization)
pprint(api_response)
except ApiException as e:
print("Exception when calling APIKeyOperationsApi->createApiKey: %s\n" % e)
Parameters
Name | Description |
---|---|
projectId* |
String
Required
|
Name | Description |
---|---|
Authorization |
Name | Description |
---|---|
body * |