This repository has been archived by the owner on Jan 19, 2018. It is now read-only.
/
BVMServerInfo.h
111 lines (90 loc) · 2.33 KB
/
BVMServerInfo.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
#import <Foundation/Foundation.h>
typedef NS_ENUM(NSUInteger, BVMServerStatus) {
BVMServerStatusOffline = 0,
BVMServerStatusOnline,
BVMServerStatusIndeterminate
};
/**
* Provides methods to asynchronously query server status/info, and
* a representation of that status.
*/
@interface BVMServerInfo : NSObject
/**
* Provides an asynchronous interface to query for info about a server
*
* @param serverName
* name assigned to the server by the user. Used to identify
* the server in user defaults.
*
* @param resultBlock
* block called with results of the query. No error occurred
* if `error` is nil.
*/
+ (void)requestInfoForServerId:(NSString *)serverId
withBlock:(void (^)(BVMServerInfo * info, NSError *error))resultBlock;
#pragma mark Server Info
/**
* Server status
*/
@property (nonatomic, assign) BVMServerStatus status;
/**
* Server hostname
*/
@property (nonatomic, readonly, strong) NSString *hostname;
/**
* "Main" IP for the server
*/
@property (nonatomic, readonly, strong) NSString *mainIpAddress;
/**
* `NSString`s of all IPs for the server
*/
@property (nonatomic, readonly, strong) NSArray *ipAddresses;
/**
* Total HDD capacity, in bytes
*/
@property (nonatomic, readonly, assign) long long hddTotal;
/**
* HDD used, in bytes
*/
@property (nonatomic, readonly, assign) long long hddUsed;
/**
* HDD free, in bytes
*/
@property (nonatomic, readonly, assign) long long hddFree;
/**
* HDD percent used
*/
@property (nonatomic, readonly, assign) NSUInteger hddPercentUsed;
/**
* Total memory, in bytes
*/
@property (nonatomic, readonly, assign) long long memTotal;
/**
* Memory used, in bytes
*/
@property (nonatomic, readonly, assign) long long memUsed;
/**
* Memory free, in bytes
*/
@property (nonatomic, readonly, assign) long long memFree;
/**
* Memory percent used
*/
@property (nonatomic, readonly, assign) NSUInteger memPercentUsed;
/**
* Total bandwidth available, in bytes
*/
@property (nonatomic, readonly, assign) long long bwTotal;
/**
* Bandwidth used, in bytes
*/
@property (nonatomic, readonly, assign) long long bwUsed;
/**
* Bandwidth free, in bytes
*/
@property (nonatomic, readonly, assign) long long bwFree;
/**
* Bandwidth percent used
*/
@property (nonatomic, readonly, assign) NSUInteger bwPercentUsed;
@end