Grassroots Infrastructure
The Grassroots Infrastructure is a suite of computing tools to help users and developers use scientific data infrastructure that can easily be interconnected.
operation.h
Go to the documentation of this file.
1 /*
2 ** Copyright 2014-2016 The Earlham Institute
3 **
4 ** Licensed under the Apache License, Version 2.0 (the "License");
5 ** you may not use this file except in compliance with the License.
6 ** You may obtain a copy of the License at
7 **
8 ** http://www.apache.org/licenses/LICENSE-2.0
9 **
10 ** Unless required by applicable law or agreed to in writing, software
11 ** distributed under the License is distributed on an "AS IS" BASIS,
12 ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 ** See the License for the specific language governing permissions and
14 ** limitations under the License.
15 */
16 
21 #ifndef OPERATION_H
22 #define OPERATION_H
23 
25 
26 #include "jansson.h"
27 
28 
29 #ifndef DOXYGEN_SHOULD_SKIP_THIS
30 
31 #ifdef ALLOCATE_OPERATION_CONSTANTS
32  #define OPERATION_PREFIX GRASSROOTS_UTIL_API
33  #define OPERATION_VAL(x) = x
34 #else
35  #define OPERATION_PREFIX extern GRASSROOTS_UTIL_API
36  #define OPERATION_VAL(x)
37 #endif
38 
39 #endif /* #ifndef DOXYGEN_SHOULD_SKIP_THIS */
40 
46 typedef enum Operation {
48  OP_NONE = -1,
49 
52 
55 
58 
59 
62 
65 
71 
74 
75 
81 
84 } Operation;
85 
86 
87 
96 typedef enum OperationStatus
97 {
99  OS_FAILED = -3,
101  OS_ERROR = -1,
102  OS_IDLE = 0,
112 
113 
114 
115 #ifdef __cplusplus
116 extern "C"
117 {
118 #endif
119 
120 
128 GRASSROOTS_UTIL_API const char *GetOperationAsString (const Operation op);
129 
130 
140 
141 
150 
151 
160 
161 
162 
171 
172 #ifdef __cplusplus
173 }
174 #endif
175 
176 
177 
178 
179 
180 #endif /* #ifndef OPERATION_H */
OS_FINISHED
Definition: operation.h:105
grassroots_util_library.h
OS_LOWER_LIMIT
Definition: operation.h:98
Operation
Operation
The various Operations that a Server can perform.
Definition: operation.h:46
OS_PENDING
Definition: operation.h:103
GetOperationAsString
const char * GetOperationAsString(const Operation op)
Get the string-based representation of a given Operation.
GetOperationStatusFromString
OperationStatus GetOperationStatusFromString(const char *status_s)
Get the OperationStatus for a given String.
OS_STARTED
Definition: operation.h:104
OS_FAILED_TO_START
Definition: operation.h:100
OP_GET_RESOURCE
Get a requested Resource from the Server.
Definition: operation.h:70
OS_FAILED
Definition: operation.h:99
OS_NUM_STATUSES
Definition: operation.h:110
OP_GET_SERVICE_INFO
Get the information for a given Service such as its name, description, config details,...
Definition: operation.h:80
GetOperationFromJSON
Operation GetOperationFromJSON(const json_t *ops_p)
Get the Operation from a JSON fragment with a key of either OPERATION_S or OPERATION_ID_S.
OperationStatus
OperationStatus
The current status of an Operation.
Definition: operation.h:96
OP_LIST_ALL_SERVICES
Get list of all available services.
Definition: operation.h:51
OS_PARTIALLY_SUCCEEDED
Definition: operation.h:106
OP_NONE
No specified Operation found.
Definition: operation.h:48
OP_LIST_INTERESTED_SERVICES
Query services to see if they can work on file.
Definition: operation.h:57
OP_GET_SCHEMA_VERSION
Get the SchemaVersion that the Server is using.
Definition: operation.h:54
GetOperationFromString
Operation GetOperationFromString(const char *op_s)
Get the Operation for a given String.
OS_UPPER_LIMIT
Definition: operation.h:109
OP_NUM_OPERATIONS
The number of available Operations.
Definition: operation.h:83
OS_SUCCEEDED
Definition: operation.h:107
OS_IDLE
Definition: operation.h:102
OP_SERVER_STATUS
Get the current status of a Server.
Definition: operation.h:73
OS_ERROR
Definition: operation.h:101
OP_GET_SERVICE_RESULTS
Get results or the status of jobs.
Definition: operation.h:64
OS_CLEANED_UP
Definition: operation.h:108
GRASSROOTS_UTIL_API
#define GRASSROOTS_UTIL_API
Definition: grassroots_util_library.h:47
GetOperationStatusAsString
const char * GetOperationStatusAsString(const OperationStatus status)
Get the string-based representation of a given OperationStatus.
OP_GET_NAMED_SERVICES
Get list of services matching the given names.
Definition: operation.h:61