Loading Makefile +13 −5 Original line number Diff line number Diff line Loading @@ -58,6 +58,8 @@ LIB_OBJS = \ $(OUT_DIR)/kinetic_allocator.o \ $(OUT_DIR)/kinetic_nbo.o \ $(OUT_DIR)/kinetic_operation.o \ $(OUT_DIR)/kinetic_callbacks.o \ $(OUT_DIR)/kinetic_builder.o \ $(OUT_DIR)/kinetic_request.o \ $(OUT_DIR)/kinetic_response.o \ $(OUT_DIR)/kinetic_bus.o \ Loading @@ -77,7 +79,7 @@ LIB_OBJS = \ $(OUT_DIR)/kinetic_semaphore.o \ $(OUT_DIR)/kinetic_countingsemaphore.o \ $(OUT_DIR)/kinetic_resourcewaiter.o \ $(OUT_DIR)/acl.o \ $(OUT_DIR)/kinetic_acl.o \ $(OUT_DIR)/byte_array.o \ $(OUT_DIR)/kinetic_client.o \ $(OUT_DIR)/kinetic_admin_client.o \ Loading Loading @@ -182,7 +184,7 @@ ci: stop_sims start_sims all stop_sims json: ${OUT_DIR}/libjson-c.a $(OUT_DIR)/acl.o: json $(OUT_DIR)/kinetic_acl.o: json json_install: json cd ${JSONC} && \ Loading Loading @@ -455,11 +457,17 @@ run: $(UTIL_EXEC) @echo exec $(UTIL_EXEC) --put --host $(KINETIC_HOST1) @echo exec $(UTIL_EXEC) --put --key goo --value Goodbye! --host $(KINETIC_HOST1) @echo exec $(UTIL_EXEC) --get --host $(KINETIC_HOST1) @echo exec $(UTIL_EXEC) --getnext --key "A" --host $(KINETIC_HOST1) exec $(UTIL_EXEC) --getnext --key A --host $(KINETIC_HOST1) @echo exec $(UTIL_EXEC) --getnext --key foo --host $(KINETIC_HOST1) @echo exec $(UTIL_EXEC) --getprevious --key zoo --host $(KINETIC_HOST1) @echo exec $(UTIL_EXEC) --getprevious --key "zzzzzzzzzzzzzzzzz" --host $(KINETIC_HOST1) exec $(UTIL_EXEC) --getprevious --key goo --host $(KINETIC_HOST1) @echo exec $(UTIL_EXEC) --delete --host $(KINETIC_HOST1) @echo Loading @@ -479,7 +487,7 @@ run: $(UTIL_EXEC) @echo exec $(UTIL_EXEC) --getlog --logtype limits --host $(KINETIC_HOST1) @echo exec $(UTIL_EXEC) --getlog --logtype device --host $(KINETIC_HOST1) exec $(UTIL_EXEC) --getdevicespecificlog --devicelogname com.Seagate --host $(KINETIC_HOST1) @echo @echo Test Utility integration tests w/ kinetic-c lib passed! @echo Loading README.md +19 −18 Original line number Diff line number Diff line Loading @@ -94,24 +94,25 @@ Usage $ cd bin $ ./kinetic-c-util --help Usage: ./kinetic-c-util --<cmd> [options...] ./kinetic-c-util --help ./kinetic-c-util --noop [--host <ip|hostname>] [--port <port>] [--clusterversion <clusterversion>] ./kinetic-c-util --put [--key <key>] [--value <value>] [--host <ip|hostname>] [--port <port>] [--clusterversion <clusterversion>] ./kinetic-c-util --get [--key <key>] [--host <ip|hostname>] [--port <port>] [--clusterversion <clusterversion>] ./kinetic-c-util --getnext [--key <key>] [--host <ip|hostname>] [--port <port>] [--clusterversion <clusterversion>] ./kinetic-c-util --getprevious [--key <key>] [--host <ip|hostname>] [--port <port>] [--clusterversion <clusterversion>] ./kinetic-c-util --delete [--key <key>] [--host <ip|hostname>] [--port <port>] [--clusterversion <clusterversion>] ./kinetic-c-util --setclusterversion <--newclusterversion <newclusterversion>> [--host <ip|hostname>] [--tlsport <tlsport>] [--clusterversion <clusterversion>] ./kinetic-c-util --seterasepin <--pin <oldpin>> <--newpin <newerasepin>> [--host <ip|hostname>] [--tlsport <tlsport>] [--clusterversion <clusterversion>] ./kinetic-c-util --instanterase <--pin <erasepin>> [--host <ip|hostname>] [--tlsport <tlsport>] [--clusterversion <clusterversion>] ./kinetic-c-util --secureerase <--pin <erasepin>> [--host <ip|hostname>] [--tlsport <tlsport>] [--clusterversion <clusterversion>] ./kinetic-c-util --setlockpin <--pin <oldpin>> <--newpin <newpin>> [--host <ip|hostname>] [--tlsport <tlsport>] [--clusterversion <clusterversion>] ./kinetic-c-util --lockdevice <--pin <lockpin>> [--host <ip|hostname>] [--tlsport <tlsport>] [--clusterversion <clusterversion>] ./kinetic-c-util --unlockdevice <--pin <lockpin>> [--host <ip|hostname>] [--tlsport <tlsport>] [--clusterversion <clusterversion>] ./kinetic-c-util --setacl <--file <acl_json_file>> [--host <ip|hostname>] [--tlsport <tlsport>] [--clusterversion <clusterversion>] ./kinetic-c-util --getlog [--type <utilization|temperature|capacity|configuration|message|statistic|limits> [--host <ip|hostname>] [--tlsport <tlsport>] [--clusterversion <clusterversion>] ./kinetic-c-util --updatefirmware <--file <file>> [--host <ip|hostname>] [--port <port>] [--clusterversion <clusterversion>] [--pin <pin>] Usage: ./bin/kinetic-c-util --<cmd> [options...] ./bin/kinetic-c-util --help ./bin/kinetic-c-util --noop [--host <ip|hostname>] [--port <port>] [--clusterversion <clusterversion>] ./bin/kinetic-c-util --put --key <key> --value <value> [--host <ip|hostname>] [--port <port>] [--clusterversion <clusterversion>] ./bin/kinetic-c-util --get --key <key> [--host <ip|hostname>] [--port <port>] [--clusterversion <clusterversion>] ./bin/kinetic-c-util --getnext --key <key> [--host <ip|hostname>] [--port <port>] [--clusterversion <clusterversion>] ./bin/kinetic-c-util --getprevious --key <key> [--host <ip|hostname>] [--port <port>] [--clusterversion <clusterversion>] ./bin/kinetic-c-util --delete --key <key> [--host <ip|hostname>] [--port <port>] [--clusterversion <clusterversion>] ./bin/kinetic-c-util --getlog --logtype <utilizations|temperatures|capacities|configuration|statistics|messages|limits> [--host <ip|hostname>] [--tlsport <tlsport>] [--clusterversion <clusterversion>] ./bin/kinetic-c-util --getdevicespecificlog --devicelogname <name|ID> [--host <ip|hostname>] [--tlsport <tlsport>] [--clusterversion <clusterversion>] ./bin/kinetic-c-util --setclusterversion --newclusterversion <newclusterversion> [--host <ip|hostname>] [--tlsport <tlsport>] [--clusterversion <clusterversion>] ./bin/kinetic-c-util --seterasepin --pin <oldpin> --newpin <newerasepin> [--host <ip|hostname>] [--tlsport <tlsport>] [--clusterversion <clusterversion>] ./bin/kinetic-c-util --instanterase --pin <erasepin> [--host <ip|hostname>] [--tlsport <tlsport>] [--clusterversion <clusterversion>] ./bin/kinetic-c-util --secureerase --pin <erasepin> [--host <ip|hostname>] [--tlsport <tlsport>] [--clusterversion <clusterversion>] ./bin/kinetic-c-util --setlockpin --pin <oldpin>> <--newpin <newpin> [--host <ip|hostname>] [--tlsport <tlsport>] [--clusterversion <clusterversion>] ./bin/kinetic-c-util --lockdevice --pin <lockpin> [--host <ip|hostname>] [--tlsport <tlsport>] [--clusterversion <clusterversion>] ./bin/kinetic-c-util --unlockdevice --pin <lockpin> [--host <ip|hostname>] [--tlsport <tlsport>] [--clusterversion <clusterversion>] ./bin/kinetic-c-util --setacl --file <acl_json_file> [--host <ip|hostname>] [--tlsport <tlsport>] [--clusterversion <clusterversion>] ./bin/kinetic-c-util --updatefirmware --file <file> --pin <pin> [--host <ip|hostname>] [--port <port>] [--clusterversion <clusterversion>] Kinetic C Client I/O Examples ============================= Loading RELEASE.md +2 −1 Original line number Diff line number Diff line Loading @@ -6,7 +6,7 @@ v0.12.0 (kinetic-protocol 3.0.5) * Added new `KineticAdminClient` API (see `include/kinetic_admin_client.h`) * Reloacted existing admin methods to admin API * `KineticClient_InstantSecureErase` => `KineticAdminClient_InstantErase`/`KineticAdminClient_SecureErase` * `KineticClient_GetLog` => `KineticAdminClient_GetLog` * `KineticClient_GetLog` => `KineticAdminClient_GetLog`/`KineticAdminClient_GetDeviceSpecificLog` * `KineticClient_FreeDeviceInfo` => `KineticAdminClient_LogInfo` * Updated `kinetic-c-util` to support new Admin API. Still need to add support for printing info returned from `KineticAdminClient_GetLog` * Changed `kinetic-c-util` API to use `getopt_long` for operations in addition to parameters and added usage info via `--help`/`-?` option. Loading @@ -22,6 +22,7 @@ v0.12.0 (kinetic-protocol 3.0.5) * `KINETIC_STATUS_ACL_ERROR` * `KINETIC_STATUS_NOT_AUTHORIZED` * `KINETIC_STATUS_INVALID_FILE` * `KINETIC_STATUS_INVALID_LOG_TYPE` * Set larger timeouts for operations that tend to take approx. 10 seconds, to prevent non-deterministic failures. * API change: Eliminated KineticClientConfig.writerThreads, since sender threads are gone. Loading include/kinetic_admin_client.h +52 −33 Original line number Diff line number Diff line Loading @@ -29,10 +29,10 @@ * * @param config A configuration struct. * * @return Returns a pointer to a `KineticClient`. You need to pass * @return Returns a pointer to a KineticClient. You need to pass * this pointer to KineticClient_CreateSession() to create * new connections. * Once you are finished will the `KineticClient`, and there * Once you are finished will the KineticClient, and there * are no active connections. The pointer should be released * with KineticClient_Shutdown() */ Loading @@ -46,7 +46,7 @@ void KineticAdminClient_Shutdown(KineticClient * const client); /** * @brief Creates a session with the Kinetic Device per specified configuration. * * @param config `KineticSessionConfig` structure which must be configured * @param config KineticSessionConfig structure which must be configured * by the client prior to creating the device connection. * .host Host name or IP address to connect to * .port Port to establish socket connection on Loading @@ -54,16 +54,16 @@ void KineticAdminClient_Shutdown(KineticClient * const client); * .identity Identity to use for the session * .hmacKey Key to use for HMAC calculations (NULL-terminated string) * .pin PIN to use for PIN-based operations * @param client The `KineticClient` pointer returned from KineticClient_Init() * @param client The KineticClient pointer returned from KineticClient_Init() * @param session Pointer to a KineticSession pointer that will be populated * with the allocated/created session upon success. * * @return Returns the resulting `KineticStatus`, and `session` * @return Returns the resulting KineticStatus, and `session` * will be populated with a pointer to the session instance * upon success. The client should call * KineticClient_DestroySession() in order to shutdown a * connection and cleanup resources when done using a * `KineticSession`. * KineticSession. */ KineticStatus KineticAdminClient_CreateSession(KineticSessionConfig * const config, KineticClient * const client, KineticSession** session); Loading @@ -71,7 +71,7 @@ KineticStatus KineticAdminClient_CreateSession(KineticSessionConfig * const conf /** * @brief Closes the connection to a host. * * @param session The connected `KineticSession` to close. The session * @param session The connected KineticSession to close. The session * instance will be freed by this call after closing the * connection, so the pointer should not longer be used. * Loading @@ -82,7 +82,7 @@ KineticStatus KineticAdminClient_DestroySession(KineticSession * const session); /** * @brief Sets the erase PIN of the Kinetic Device. * * @param session The connected `KineticSession` to close. The session * @param session The connected KineticSession to close. The session * instance will be freed by this call after closing the * connection, so the pointer should not longer be used. * @param old_pin Old erase PIN to change. Loading @@ -90,35 +90,35 @@ KineticStatus KineticAdminClient_DestroySession(KineticSession * const session); * * @return Returns the resulting KineticStatus. */ KineticStatus KineticAdminClient_SetErasePin(KineticSession const * const session, KineticStatus KineticAdminClient_SetErasePin(KineticSession * const session, ByteArray old_pin, ByteArray new_pin); /** * @brief Executes a SecureErase command to erase all data from the Kinetic device. * @brief Executes a `SecureErase` command to erase all data from the Kinetic device. * * @param session The connected KineticSession to use for the operation. * @param pin PIN to send with operation, which must match the configured erase PIN. * * @return Returns the resulting KineticStatus. */ KineticStatus KineticAdminClient_SecureErase(KineticSession const * const session, KineticStatus KineticAdminClient_SecureErase(KineticSession * const session, ByteArray pin); /** * @brief Executes an InstantErase command to erase all data from the Kinetic device. * @brief Executes an `InstantErase` operation to erase all data from the Kinetic device. * * @param session The connected KineticSession to use for the operation. * @param pin PIN to send with operation, which must match the configured erase PIN. * * @return Returns the resulting KineticStatus. */ KineticStatus KineticAdminClient_InstantErase(KineticSession const * const session, KineticStatus KineticAdminClient_InstantErase(KineticSession * const session, ByteArray pin); /** * @brief Sets the lock PIN of the Kinetic Device. * * @param session The connected `KineticSession` to close. The session * @param session The connected KineticSession to close. The session * instance will be freed by this call after closing the * connection, so the pointer should not longer be used. * @param old_pin Old erase PIN to change. Loading @@ -126,33 +126,33 @@ KineticStatus KineticAdminClient_InstantErase(KineticSession const * const sessi * * @return Returns the resulting KineticStatus. */ KineticStatus KineticAdminClient_SetLockPin(KineticSession const * const session, KineticStatus KineticAdminClient_SetLockPin(KineticSession * const session, ByteArray old_pin, ByteArray new_pin); /** * @brief Executes a LOCK command to lock the Kinetic device. * @brief Executes a `LOCK` operation to lock the Kinetic device. * * @param session The connected KineticSession to use for the operation. * @param pin PIN to send with operation, which must match the configured lock PIN. * * @return Returns the resulting KineticStatus. */ KineticStatus KineticAdminClient_LockDevice(KineticSession const * const session, KineticStatus KineticAdminClient_LockDevice(KineticSession * const session, ByteArray pin); /** * @brief Executes an UNLOCK command to unlock the Kinetic device. * @brief Executes an `UNLOCK` operation to unlock the Kinetic device. * * @param session The connected KineticSession to use for the operation. * @param pin PIN to send with operation, which must match the configured lock PIN. * * @return Returns the resulting KineticStatus. */ KineticStatus KineticAdminClient_UnlockDevice(KineticSession const * const session, KineticStatus KineticAdminClient_UnlockDevice(KineticSession * const session, ByteArray pin); /** * @brief Executes a GETLOG command to retrieve specific configuration and/or * @brief Executes a `GETLOG` operation to retrieve specific configuration and/or * operational data from the Kinetic Device. * * @param session The connected KineticSession to use for the operation Loading @@ -160,19 +160,39 @@ KineticStatus KineticAdminClient_UnlockDevice(KineticSession const * const sessi * @param info KineticLogInfo pointer, which will be assigned to * a dynamically allocated structure populated with * the requested data, if successful. The client should * call free() on this pointer in order to free the root * and any nested structures. * call KineticAdminClient_FreeLogInfo() with this pointer * in order to free all allocated memory. * @param closure Optional closure. If specified, operation will be * executed in asynchronous mode, and closure callback * will be called upon completion in another thread. * * @return Returns 0 upon success, -1 or the Kinetic status code * upon failure * @return Returns the resulting KineticStatus */ KineticStatus KineticAdminClient_GetLog(KineticSession const * const session, KineticStatus KineticAdminClient_GetLog(KineticSession * const session, KineticLogInfo_Type type, KineticLogInfo** info, KineticCompletionClosure* closure); /** * @brief Executes a `GETLOG` operation to retrieve device-specific log info * from the Kinetic Device via name/key. * * @param session The connected KineticSession to use for the operation * @param name Device specific name to retrieve info for. * @param info KineticLogInfo pointer, which will be assigned to * a dynamically allocated structure populated with * the requested data, if successful. The client should * call KineticAdminClient_FreeLogInfo() with this pointer * in order to free all allocated memory. * @param closure Optional closure. If specified, operation will be * executed in asynchronous mode, and closure callback * will be called upon completion in another thread. * * @return Returns the resulting KineticStatus */ KineticStatus KineticAdminClient_GetDeviceSpecificLog(KineticSession * const session, ByteArray name, KineticLogInfo** info, KineticCompletionClosure* closure); /** * @brief Free the KineticLogInfo result from KineticClient_GetLog. Loading @@ -180,7 +200,7 @@ KineticStatus KineticAdminClient_GetLog(KineticSession const * const session, * @param session The connected KineticSession to use for the operation * @param info The KineticLogInfo result to free. */ void KineticAdminClient_FreeLogInfo(KineticSession const * const session, void KineticAdminClient_FreeLogInfo(KineticSession * const session, KineticLogInfo* info); /** Loading @@ -191,30 +211,29 @@ void KineticAdminClient_FreeLogInfo(KineticSession const * const session, * * @return Returns the resulting KineticStatus. */ KineticStatus KineticAdminClient_SetClusterVersion(KineticSession const * const session, KineticStatus KineticAdminClient_SetClusterVersion(KineticSession * const session, int64_t version); /** * @brief Executes a SECURITY operation, setting one or more ACLs. * @brief Executes a `SECURITY` operation, setting one or more ACLs. * * @param session The connected KineticSession to use for the operation * @param ACLPath Path to a JSON file containing one or more ACLs. * * @return Returns 0 upon success, -1 or the Kinetic status code * upon failure. * @return Returns the resulting KineticStatus. */ KineticStatus KineticAdminClient_SetACL(KineticSession const * const session, KineticStatus KineticAdminClient_SetACL(KineticSession * const session, const char *ACLPath); /** * @brief Executes a Firmware Download operation to update the firmware on the Kinetic device. * @brief Executes a `Firmware Download` operation to update the firmware on the Kinetic device. * * @param session The connected KineticSession to use for the operation. * @param fw_path Path to firmware update image file. * * @return Returns the resulting KineticStatus. */ KineticStatus KineticAdminClient_UpdateFirmware(KineticSession const * const session, KineticStatus KineticAdminClient_UpdateFirmware(KineticSession * const session, char const * const fw_path); #endif // _KINETIC_ADMIN_CLIENT_H include/kinetic_client.h +25 −25 File changed.Preview size limit exceeded, changes collapsed. Show changes Loading
Makefile +13 −5 Original line number Diff line number Diff line Loading @@ -58,6 +58,8 @@ LIB_OBJS = \ $(OUT_DIR)/kinetic_allocator.o \ $(OUT_DIR)/kinetic_nbo.o \ $(OUT_DIR)/kinetic_operation.o \ $(OUT_DIR)/kinetic_callbacks.o \ $(OUT_DIR)/kinetic_builder.o \ $(OUT_DIR)/kinetic_request.o \ $(OUT_DIR)/kinetic_response.o \ $(OUT_DIR)/kinetic_bus.o \ Loading @@ -77,7 +79,7 @@ LIB_OBJS = \ $(OUT_DIR)/kinetic_semaphore.o \ $(OUT_DIR)/kinetic_countingsemaphore.o \ $(OUT_DIR)/kinetic_resourcewaiter.o \ $(OUT_DIR)/acl.o \ $(OUT_DIR)/kinetic_acl.o \ $(OUT_DIR)/byte_array.o \ $(OUT_DIR)/kinetic_client.o \ $(OUT_DIR)/kinetic_admin_client.o \ Loading Loading @@ -182,7 +184,7 @@ ci: stop_sims start_sims all stop_sims json: ${OUT_DIR}/libjson-c.a $(OUT_DIR)/acl.o: json $(OUT_DIR)/kinetic_acl.o: json json_install: json cd ${JSONC} && \ Loading Loading @@ -455,11 +457,17 @@ run: $(UTIL_EXEC) @echo exec $(UTIL_EXEC) --put --host $(KINETIC_HOST1) @echo exec $(UTIL_EXEC) --put --key goo --value Goodbye! --host $(KINETIC_HOST1) @echo exec $(UTIL_EXEC) --get --host $(KINETIC_HOST1) @echo exec $(UTIL_EXEC) --getnext --key "A" --host $(KINETIC_HOST1) exec $(UTIL_EXEC) --getnext --key A --host $(KINETIC_HOST1) @echo exec $(UTIL_EXEC) --getnext --key foo --host $(KINETIC_HOST1) @echo exec $(UTIL_EXEC) --getprevious --key zoo --host $(KINETIC_HOST1) @echo exec $(UTIL_EXEC) --getprevious --key "zzzzzzzzzzzzzzzzz" --host $(KINETIC_HOST1) exec $(UTIL_EXEC) --getprevious --key goo --host $(KINETIC_HOST1) @echo exec $(UTIL_EXEC) --delete --host $(KINETIC_HOST1) @echo Loading @@ -479,7 +487,7 @@ run: $(UTIL_EXEC) @echo exec $(UTIL_EXEC) --getlog --logtype limits --host $(KINETIC_HOST1) @echo exec $(UTIL_EXEC) --getlog --logtype device --host $(KINETIC_HOST1) exec $(UTIL_EXEC) --getdevicespecificlog --devicelogname com.Seagate --host $(KINETIC_HOST1) @echo @echo Test Utility integration tests w/ kinetic-c lib passed! @echo Loading
README.md +19 −18 Original line number Diff line number Diff line Loading @@ -94,24 +94,25 @@ Usage $ cd bin $ ./kinetic-c-util --help Usage: ./kinetic-c-util --<cmd> [options...] ./kinetic-c-util --help ./kinetic-c-util --noop [--host <ip|hostname>] [--port <port>] [--clusterversion <clusterversion>] ./kinetic-c-util --put [--key <key>] [--value <value>] [--host <ip|hostname>] [--port <port>] [--clusterversion <clusterversion>] ./kinetic-c-util --get [--key <key>] [--host <ip|hostname>] [--port <port>] [--clusterversion <clusterversion>] ./kinetic-c-util --getnext [--key <key>] [--host <ip|hostname>] [--port <port>] [--clusterversion <clusterversion>] ./kinetic-c-util --getprevious [--key <key>] [--host <ip|hostname>] [--port <port>] [--clusterversion <clusterversion>] ./kinetic-c-util --delete [--key <key>] [--host <ip|hostname>] [--port <port>] [--clusterversion <clusterversion>] ./kinetic-c-util --setclusterversion <--newclusterversion <newclusterversion>> [--host <ip|hostname>] [--tlsport <tlsport>] [--clusterversion <clusterversion>] ./kinetic-c-util --seterasepin <--pin <oldpin>> <--newpin <newerasepin>> [--host <ip|hostname>] [--tlsport <tlsport>] [--clusterversion <clusterversion>] ./kinetic-c-util --instanterase <--pin <erasepin>> [--host <ip|hostname>] [--tlsport <tlsport>] [--clusterversion <clusterversion>] ./kinetic-c-util --secureerase <--pin <erasepin>> [--host <ip|hostname>] [--tlsport <tlsport>] [--clusterversion <clusterversion>] ./kinetic-c-util --setlockpin <--pin <oldpin>> <--newpin <newpin>> [--host <ip|hostname>] [--tlsport <tlsport>] [--clusterversion <clusterversion>] ./kinetic-c-util --lockdevice <--pin <lockpin>> [--host <ip|hostname>] [--tlsport <tlsport>] [--clusterversion <clusterversion>] ./kinetic-c-util --unlockdevice <--pin <lockpin>> [--host <ip|hostname>] [--tlsport <tlsport>] [--clusterversion <clusterversion>] ./kinetic-c-util --setacl <--file <acl_json_file>> [--host <ip|hostname>] [--tlsport <tlsport>] [--clusterversion <clusterversion>] ./kinetic-c-util --getlog [--type <utilization|temperature|capacity|configuration|message|statistic|limits> [--host <ip|hostname>] [--tlsport <tlsport>] [--clusterversion <clusterversion>] ./kinetic-c-util --updatefirmware <--file <file>> [--host <ip|hostname>] [--port <port>] [--clusterversion <clusterversion>] [--pin <pin>] Usage: ./bin/kinetic-c-util --<cmd> [options...] ./bin/kinetic-c-util --help ./bin/kinetic-c-util --noop [--host <ip|hostname>] [--port <port>] [--clusterversion <clusterversion>] ./bin/kinetic-c-util --put --key <key> --value <value> [--host <ip|hostname>] [--port <port>] [--clusterversion <clusterversion>] ./bin/kinetic-c-util --get --key <key> [--host <ip|hostname>] [--port <port>] [--clusterversion <clusterversion>] ./bin/kinetic-c-util --getnext --key <key> [--host <ip|hostname>] [--port <port>] [--clusterversion <clusterversion>] ./bin/kinetic-c-util --getprevious --key <key> [--host <ip|hostname>] [--port <port>] [--clusterversion <clusterversion>] ./bin/kinetic-c-util --delete --key <key> [--host <ip|hostname>] [--port <port>] [--clusterversion <clusterversion>] ./bin/kinetic-c-util --getlog --logtype <utilizations|temperatures|capacities|configuration|statistics|messages|limits> [--host <ip|hostname>] [--tlsport <tlsport>] [--clusterversion <clusterversion>] ./bin/kinetic-c-util --getdevicespecificlog --devicelogname <name|ID> [--host <ip|hostname>] [--tlsport <tlsport>] [--clusterversion <clusterversion>] ./bin/kinetic-c-util --setclusterversion --newclusterversion <newclusterversion> [--host <ip|hostname>] [--tlsport <tlsport>] [--clusterversion <clusterversion>] ./bin/kinetic-c-util --seterasepin --pin <oldpin> --newpin <newerasepin> [--host <ip|hostname>] [--tlsport <tlsport>] [--clusterversion <clusterversion>] ./bin/kinetic-c-util --instanterase --pin <erasepin> [--host <ip|hostname>] [--tlsport <tlsport>] [--clusterversion <clusterversion>] ./bin/kinetic-c-util --secureerase --pin <erasepin> [--host <ip|hostname>] [--tlsport <tlsport>] [--clusterversion <clusterversion>] ./bin/kinetic-c-util --setlockpin --pin <oldpin>> <--newpin <newpin> [--host <ip|hostname>] [--tlsport <tlsport>] [--clusterversion <clusterversion>] ./bin/kinetic-c-util --lockdevice --pin <lockpin> [--host <ip|hostname>] [--tlsport <tlsport>] [--clusterversion <clusterversion>] ./bin/kinetic-c-util --unlockdevice --pin <lockpin> [--host <ip|hostname>] [--tlsport <tlsport>] [--clusterversion <clusterversion>] ./bin/kinetic-c-util --setacl --file <acl_json_file> [--host <ip|hostname>] [--tlsport <tlsport>] [--clusterversion <clusterversion>] ./bin/kinetic-c-util --updatefirmware --file <file> --pin <pin> [--host <ip|hostname>] [--port <port>] [--clusterversion <clusterversion>] Kinetic C Client I/O Examples ============================= Loading
RELEASE.md +2 −1 Original line number Diff line number Diff line Loading @@ -6,7 +6,7 @@ v0.12.0 (kinetic-protocol 3.0.5) * Added new `KineticAdminClient` API (see `include/kinetic_admin_client.h`) * Reloacted existing admin methods to admin API * `KineticClient_InstantSecureErase` => `KineticAdminClient_InstantErase`/`KineticAdminClient_SecureErase` * `KineticClient_GetLog` => `KineticAdminClient_GetLog` * `KineticClient_GetLog` => `KineticAdminClient_GetLog`/`KineticAdminClient_GetDeviceSpecificLog` * `KineticClient_FreeDeviceInfo` => `KineticAdminClient_LogInfo` * Updated `kinetic-c-util` to support new Admin API. Still need to add support for printing info returned from `KineticAdminClient_GetLog` * Changed `kinetic-c-util` API to use `getopt_long` for operations in addition to parameters and added usage info via `--help`/`-?` option. Loading @@ -22,6 +22,7 @@ v0.12.0 (kinetic-protocol 3.0.5) * `KINETIC_STATUS_ACL_ERROR` * `KINETIC_STATUS_NOT_AUTHORIZED` * `KINETIC_STATUS_INVALID_FILE` * `KINETIC_STATUS_INVALID_LOG_TYPE` * Set larger timeouts for operations that tend to take approx. 10 seconds, to prevent non-deterministic failures. * API change: Eliminated KineticClientConfig.writerThreads, since sender threads are gone. Loading
include/kinetic_admin_client.h +52 −33 Original line number Diff line number Diff line Loading @@ -29,10 +29,10 @@ * * @param config A configuration struct. * * @return Returns a pointer to a `KineticClient`. You need to pass * @return Returns a pointer to a KineticClient. You need to pass * this pointer to KineticClient_CreateSession() to create * new connections. * Once you are finished will the `KineticClient`, and there * Once you are finished will the KineticClient, and there * are no active connections. The pointer should be released * with KineticClient_Shutdown() */ Loading @@ -46,7 +46,7 @@ void KineticAdminClient_Shutdown(KineticClient * const client); /** * @brief Creates a session with the Kinetic Device per specified configuration. * * @param config `KineticSessionConfig` structure which must be configured * @param config KineticSessionConfig structure which must be configured * by the client prior to creating the device connection. * .host Host name or IP address to connect to * .port Port to establish socket connection on Loading @@ -54,16 +54,16 @@ void KineticAdminClient_Shutdown(KineticClient * const client); * .identity Identity to use for the session * .hmacKey Key to use for HMAC calculations (NULL-terminated string) * .pin PIN to use for PIN-based operations * @param client The `KineticClient` pointer returned from KineticClient_Init() * @param client The KineticClient pointer returned from KineticClient_Init() * @param session Pointer to a KineticSession pointer that will be populated * with the allocated/created session upon success. * * @return Returns the resulting `KineticStatus`, and `session` * @return Returns the resulting KineticStatus, and `session` * will be populated with a pointer to the session instance * upon success. The client should call * KineticClient_DestroySession() in order to shutdown a * connection and cleanup resources when done using a * `KineticSession`. * KineticSession. */ KineticStatus KineticAdminClient_CreateSession(KineticSessionConfig * const config, KineticClient * const client, KineticSession** session); Loading @@ -71,7 +71,7 @@ KineticStatus KineticAdminClient_CreateSession(KineticSessionConfig * const conf /** * @brief Closes the connection to a host. * * @param session The connected `KineticSession` to close. The session * @param session The connected KineticSession to close. The session * instance will be freed by this call after closing the * connection, so the pointer should not longer be used. * Loading @@ -82,7 +82,7 @@ KineticStatus KineticAdminClient_DestroySession(KineticSession * const session); /** * @brief Sets the erase PIN of the Kinetic Device. * * @param session The connected `KineticSession` to close. The session * @param session The connected KineticSession to close. The session * instance will be freed by this call after closing the * connection, so the pointer should not longer be used. * @param old_pin Old erase PIN to change. Loading @@ -90,35 +90,35 @@ KineticStatus KineticAdminClient_DestroySession(KineticSession * const session); * * @return Returns the resulting KineticStatus. */ KineticStatus KineticAdminClient_SetErasePin(KineticSession const * const session, KineticStatus KineticAdminClient_SetErasePin(KineticSession * const session, ByteArray old_pin, ByteArray new_pin); /** * @brief Executes a SecureErase command to erase all data from the Kinetic device. * @brief Executes a `SecureErase` command to erase all data from the Kinetic device. * * @param session The connected KineticSession to use for the operation. * @param pin PIN to send with operation, which must match the configured erase PIN. * * @return Returns the resulting KineticStatus. */ KineticStatus KineticAdminClient_SecureErase(KineticSession const * const session, KineticStatus KineticAdminClient_SecureErase(KineticSession * const session, ByteArray pin); /** * @brief Executes an InstantErase command to erase all data from the Kinetic device. * @brief Executes an `InstantErase` operation to erase all data from the Kinetic device. * * @param session The connected KineticSession to use for the operation. * @param pin PIN to send with operation, which must match the configured erase PIN. * * @return Returns the resulting KineticStatus. */ KineticStatus KineticAdminClient_InstantErase(KineticSession const * const session, KineticStatus KineticAdminClient_InstantErase(KineticSession * const session, ByteArray pin); /** * @brief Sets the lock PIN of the Kinetic Device. * * @param session The connected `KineticSession` to close. The session * @param session The connected KineticSession to close. The session * instance will be freed by this call after closing the * connection, so the pointer should not longer be used. * @param old_pin Old erase PIN to change. Loading @@ -126,33 +126,33 @@ KineticStatus KineticAdminClient_InstantErase(KineticSession const * const sessi * * @return Returns the resulting KineticStatus. */ KineticStatus KineticAdminClient_SetLockPin(KineticSession const * const session, KineticStatus KineticAdminClient_SetLockPin(KineticSession * const session, ByteArray old_pin, ByteArray new_pin); /** * @brief Executes a LOCK command to lock the Kinetic device. * @brief Executes a `LOCK` operation to lock the Kinetic device. * * @param session The connected KineticSession to use for the operation. * @param pin PIN to send with operation, which must match the configured lock PIN. * * @return Returns the resulting KineticStatus. */ KineticStatus KineticAdminClient_LockDevice(KineticSession const * const session, KineticStatus KineticAdminClient_LockDevice(KineticSession * const session, ByteArray pin); /** * @brief Executes an UNLOCK command to unlock the Kinetic device. * @brief Executes an `UNLOCK` operation to unlock the Kinetic device. * * @param session The connected KineticSession to use for the operation. * @param pin PIN to send with operation, which must match the configured lock PIN. * * @return Returns the resulting KineticStatus. */ KineticStatus KineticAdminClient_UnlockDevice(KineticSession const * const session, KineticStatus KineticAdminClient_UnlockDevice(KineticSession * const session, ByteArray pin); /** * @brief Executes a GETLOG command to retrieve specific configuration and/or * @brief Executes a `GETLOG` operation to retrieve specific configuration and/or * operational data from the Kinetic Device. * * @param session The connected KineticSession to use for the operation Loading @@ -160,19 +160,39 @@ KineticStatus KineticAdminClient_UnlockDevice(KineticSession const * const sessi * @param info KineticLogInfo pointer, which will be assigned to * a dynamically allocated structure populated with * the requested data, if successful. The client should * call free() on this pointer in order to free the root * and any nested structures. * call KineticAdminClient_FreeLogInfo() with this pointer * in order to free all allocated memory. * @param closure Optional closure. If specified, operation will be * executed in asynchronous mode, and closure callback * will be called upon completion in another thread. * * @return Returns 0 upon success, -1 or the Kinetic status code * upon failure * @return Returns the resulting KineticStatus */ KineticStatus KineticAdminClient_GetLog(KineticSession const * const session, KineticStatus KineticAdminClient_GetLog(KineticSession * const session, KineticLogInfo_Type type, KineticLogInfo** info, KineticCompletionClosure* closure); /** * @brief Executes a `GETLOG` operation to retrieve device-specific log info * from the Kinetic Device via name/key. * * @param session The connected KineticSession to use for the operation * @param name Device specific name to retrieve info for. * @param info KineticLogInfo pointer, which will be assigned to * a dynamically allocated structure populated with * the requested data, if successful. The client should * call KineticAdminClient_FreeLogInfo() with this pointer * in order to free all allocated memory. * @param closure Optional closure. If specified, operation will be * executed in asynchronous mode, and closure callback * will be called upon completion in another thread. * * @return Returns the resulting KineticStatus */ KineticStatus KineticAdminClient_GetDeviceSpecificLog(KineticSession * const session, ByteArray name, KineticLogInfo** info, KineticCompletionClosure* closure); /** * @brief Free the KineticLogInfo result from KineticClient_GetLog. Loading @@ -180,7 +200,7 @@ KineticStatus KineticAdminClient_GetLog(KineticSession const * const session, * @param session The connected KineticSession to use for the operation * @param info The KineticLogInfo result to free. */ void KineticAdminClient_FreeLogInfo(KineticSession const * const session, void KineticAdminClient_FreeLogInfo(KineticSession * const session, KineticLogInfo* info); /** Loading @@ -191,30 +211,29 @@ void KineticAdminClient_FreeLogInfo(KineticSession const * const session, * * @return Returns the resulting KineticStatus. */ KineticStatus KineticAdminClient_SetClusterVersion(KineticSession const * const session, KineticStatus KineticAdminClient_SetClusterVersion(KineticSession * const session, int64_t version); /** * @brief Executes a SECURITY operation, setting one or more ACLs. * @brief Executes a `SECURITY` operation, setting one or more ACLs. * * @param session The connected KineticSession to use for the operation * @param ACLPath Path to a JSON file containing one or more ACLs. * * @return Returns 0 upon success, -1 or the Kinetic status code * upon failure. * @return Returns the resulting KineticStatus. */ KineticStatus KineticAdminClient_SetACL(KineticSession const * const session, KineticStatus KineticAdminClient_SetACL(KineticSession * const session, const char *ACLPath); /** * @brief Executes a Firmware Download operation to update the firmware on the Kinetic device. * @brief Executes a `Firmware Download` operation to update the firmware on the Kinetic device. * * @param session The connected KineticSession to use for the operation. * @param fw_path Path to firmware update image file. * * @return Returns the resulting KineticStatus. */ KineticStatus KineticAdminClient_UpdateFirmware(KineticSession const * const session, KineticStatus KineticAdminClient_UpdateFirmware(KineticSession * const session, char const * const fw_path); #endif // _KINETIC_ADMIN_CLIENT_H
include/kinetic_client.h +25 −25 File changed.Preview size limit exceeded, changes collapsed. Show changes