add
키가 없을 때 저장
/kv/add
Usage and SDK Samples
curl -X POST \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
"http://localhost:49686/kv/add" \
-d '{
"expireTime" : 60,
"key" : "demo:hello",
"value" : "arcus"
}'
import org.openapitools.client.*;
import org.openapitools.client.auth.*;
import org.openapitools.client.model.*;
import org.openapitools.client.api.KVApi;
import java.io.File;
import java.util.*;
public class KVApiExample {
public static void main(String[] args) {
// Create an instance of the API class
KVApi apiInstance = new KVApi();
SetRequest setRequest = ; // SetRequest |
try {
ApiResultSetResponse result = apiInstance.add(setRequest);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling KVApi#add");
e.printStackTrace();
}
}
}
import 'package:openapi/api.dart';
final api_instance = DefaultApi();
final SetRequest setRequest = new SetRequest(); // SetRequest |
try {
final result = await api_instance.add(setRequest);
print(result);
} catch (e) {
print('Exception when calling DefaultApi->add: $e\n');
}
import org.openapitools.client.api.KVApi;
public class KVApiExample {
public static void main(String[] args) {
KVApi apiInstance = new KVApi();
SetRequest setRequest = ; // SetRequest |
try {
ApiResultSetResponse result = apiInstance.add(setRequest);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling KVApi#add");
e.printStackTrace();
}
}
}
// Create an instance of the API class
KVApi *apiInstance = [[KVApi alloc] init];
SetRequest *setRequest = ; //
// 키가 없을 때 저장
[apiInstance addWith:setRequest
completionHandler: ^(ApiResultSetResponse output, NSError* error) {
if (output) {
NSLog(@"%@", output);
}
if (error) {
NSLog(@"Error: %@", error);
}
}];
var ArcusHttpApi = require('arcus_http_api');
// Create an instance of the API class
var api = new ArcusHttpApi.KVApi()
var setRequest = ; // {SetRequest}
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
api.add(setRequest, callback);
using System;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;
namespace Example
{
public class addExample
{
public void main()
{
// Create an instance of the API class
var apiInstance = new KVApi();
var setRequest = new SetRequest(); // SetRequest |
try {
// 키가 없을 때 저장
ApiResultSetResponse result = apiInstance.add(setRequest);
Debug.WriteLine(result);
} catch (Exception e) {
Debug.Print("Exception when calling KVApi.add: " + e.Message );
}
}
}
}
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Create an instance of the API class
$api_instance = new OpenAPITools\Client\Api\KVApi();
$setRequest = ; // SetRequest |
try {
$result = $api_instance->add($setRequest);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling KVApi->add: ', $e->getMessage(), PHP_EOL;
}
?>
use Data::Dumper;
use WWW::OPenAPIClient::Configuration;
use WWW::OPenAPIClient::KVApi;
# Create an instance of the API class
my $api_instance = WWW::OPenAPIClient::KVApi->new();
my $setRequest = WWW::OPenAPIClient::Object::SetRequest->new(); # SetRequest |
eval {
my $result = $api_instance->add(setRequest => $setRequest);
print Dumper($result);
};
if ($@) {
warn "Exception when calling KVApi->add: $@\n";
}
from __future__ import print_statement
import time
import openapi_client
from openapi_client.rest import ApiException
from pprint import pprint
# Create an instance of the API class
api_instance = openapi_client.KVApi()
setRequest = # SetRequest |
try:
# 키가 없을 때 저장
api_response = api_instance.add(setRequest)
pprint(api_response)
except ApiException as e:
print("Exception when calling KVApi->add: %s\n" % e)
extern crate KVApi;
pub fn main() {
let setRequest = ; // SetRequest
let mut context = KVApi::Context::default();
let result = client.add(setRequest, &context).wait();
println!("{:?}", result);
}
Scopes
Parameters
| Name | Description |
|---|---|
| setRequest * |