Commit 7a42ec74 authored by Greg Williams's avatar Greg Williams
Browse files

Merge branch 'develop'

parents d0d5b503 3d7e6042
Loading
Loading
Loading
Loading
+44 −63
Original line number Diff line number Diff line
@@ -8,12 +8,18 @@ This repo contains code for producing C Kinetic clients which use the Seagate Ki

Getting Started
================

**Clone the repo**
    > git clone --recursive https://github.com/atomicobject/kinetic-c.git

    > cd kinetic-c
    > bundle install # Ensures you have all RubyGems needed
    > bundle execute rake # Run all tests and build kinetic-c library and examples
    > bundle install # Ensure you have all RubyGems at the proper versions

**Update to the latest version (previously cloned)**
    > git pull
    > git submodule update --init # Ensure submodules are up to date
    > bundle install # Ensure you have all RubyGems at the proper versions

**Build Kinetic-C and run all tests**
    > bundle exec rake

API Documentation
=================
@@ -27,9 +33,6 @@ Dependencies
* [RubyGems](http://rubygems.org) (installed w/ `bundle install)
    * [bundler](http://bundler.io) (v1.3.5 or higher) environment/dependency manager for Ruby projects
    * [rake](https://github.com/jimweirich/rake) (0.9.2.2 or higher) Ruby implementation of Make
    * [require_all](https://github.com/jarmo/require_all)
    * [constructor](https://github.com/atomicobject/constructor)
    * [diy](https://github.com/atomicobject/diy)
    * [ceedling](https://github.com/ThrowTheSwitch/Ceedling) Ruby/Rake-based build/test system for C projects
        * Ceedling also includes the following tools for testing C code
            * [Unity](https://github.com/ThrowTheSwitch/Unity) lightweight assertion framework and test executor for C
@@ -49,8 +52,8 @@ NOTE: Prefix the following commands with `bundle exec` so that they execute in t
    * `rake`
* Build the library
    * `rake release`
* Run all unit/integration tests
    * `rake test:all`
* Run all unit/integration/system/example tests
    * `rake test_all`
* Analyze code
    * `rake cppcheck`
* Generate documentation
@@ -60,63 +63,41 @@ NOTE: Prefix the following commands with `bundle exec` so that they execute in t
* Build/install Google Protocol Buffers support for the Kinetic-Protocol
    * `rake proto`
* Enable verbose output (for current Rake run)
    * `rake verbose *<task_A>* *<task_B>*`
    * `rake verbose <task_A> <task_B>`

Examples
========

The following examples are provided for development reference and as utilities to aid development

In order to execute a given example, execute `kinetic-c` with a given example name and optional arguments (below)


First, `cd` into the `build/release` folder, and then execute the desired command.
If no command is specified, kinetic-c will execute all of the example commands.

The following examples are provided for development reference and as utilities to aid development. In order to execute a given example, you must first do:

**e.g.** - Execute the NoOp operation against default host: `localhost`:

```
cd build/release
kinetic-c noop
```

**e.g.** - Execute the NoOp operation against `my-kinetic-server.com`:

> cd build/artifacts/release`
```
cd build/release
kinetic-c noop --host my-kinetic-server.com
```


`noop [--hostname|-h "some_host.com"|123.253.253.23]`

`read_file_blocking` (incomplete!)

`read_file_nonblocking` (incomplete!)

`write_file_blocking` (incomplete!)

`write_file_nonblocking` (incomplete!)

`write_file_blocking_threads` (incomplete!)

`delete_file_blocking` (incomplete!)

`delete_file_nonblocking` (incomplete!)

`instant_secure_erase` (incomplete!)

`kinetic_stat` (incomplete!)

`dump_keyspace` (incomplete!)

`set_acls` (incomplete!)

`set_pin` (incomplete!)

`set_clusterversion` (incomplete!)

`update_firmware` (incomplete!)

`copy_drive` (incomplete!)
You can then execute `kinetic-c` with a valid example name, optionally preceeded with any of the optional arguments.

**Options**
* `--host [HostName/IP]` or `-h [HostName/IP]` - Set the Kinetic Device host
* `--tls` - Use the TLS port to execute the specified operation(s)

**Operations**
* `kinetic-c [--hostname|-h hostname|123.253.253.23] noop`
    * `kinetic-c noop`
        * Execute the NoOp operation against default host: `localhost`
    * `kinetic-c noop --host my-kinetic-server.com`
        * Execute the NoOp operation against `my-kinetic-server.com`
* `read_file_blocking` (incomplete!)
* `read_file_nonblocking` (incomplete!)
* `write_file_blocking` (incomplete!)
* `write_file_nonblocking` (incomplete!)
* `write_file_blocking_threads` (incomplete!)
* `delete_file_blocking` (incomplete!)
* `delete_file_nonblocking` (incomplete!)
* `instant_secure_erase` (incomplete!)
* `kinetic_stat` (incomplete!)
* `dump_keyspace` (incomplete!)
* `set_acls` (incomplete!)
* `set_pin` (incomplete!)
* `set_clusterversion` (incomplete!)
* `update_firmware` (incomplete!)
* `copy_drive` (incomplete!)
+1 −6
Original line number Diff line number Diff line
@@ -64,7 +64,7 @@ int main(int argc, char** argv)
        {0, 0, 0, 0}
    };

    while ((opt = getopt_long(argc, argv, "npgdh:z:", long_options, &optIndex)) != -1)
    while ((opt = getopt_long(argc, argv, "h", long_options, &optIndex)) != -1)
    {
        // Parse options until we reach the end of the argument list
        if (opt != -1)
@@ -75,11 +75,6 @@ int main(int argc, char** argv)
                    // If this option set a flag, do nothing else now.
                    if (long_options[optIndex].flag != 0)
                        break;
                    printf ("option %s", long_options[optIndex].name);
                    if (optarg)
                        printf (" with arg %s", optarg);
                    printf ("\n");
                    break;
                case 'h':
                    strcpy(cfg.host, optarg);
                    break;