Ver a proveniência

add networkName to NewNodeNotification. add S3 cloud service. add more message keys.

tags/v0.1.6
Jonathan Cobb há 5 anos
ascendente
cometimento
b67bc8e525
12 ficheiros alterados com 63 adições e 17 eliminações
  1. +1
    -1
      bubble-server/src/main/java/bubble/model/cloud/BubbleNetworkState.java
  2. +1
    -0
      bubble-server/src/main/java/bubble/notify/NewNodeNotification.java
  3. +1
    -0
      bubble-server/src/main/java/bubble/notify/NotificationHandler_hello_from_sage.java
  4. +7
    -0
      bubble-server/src/main/java/bubble/resources/account/AccountsResource.java
  5. +6
    -4
      bubble-server/src/main/java/bubble/service/cloud/StandardNetworkService.java
  6. +39
    -7
      bubble-server/src/main/resources/message_templates/en_US/server/post_auth/ResourceMessages.properties
  7. +3
    -0
      bubble-server/src/main/resources/message_templates/en_US/server/pre_auth/ResourceMessages.properties
  8. +1
    -1
      bubble-server/src/main/resources/models/defaults/cloudService.json
  9. +1
    -1
      bubble-server/src/test/java/bubble/test/S3StorageTest.java
  10. +1
    -1
      bubble-server/src/test/resources/models/system/cloudService.json
  11. +1
    -1
      bubble-web
  12. +1
    -1
      config/activation.json

+ 1
- 1
bubble-server/src/main/java/bubble/model/cloud/BubbleNetworkState.java Ver ficheiro

@@ -6,7 +6,7 @@ import static bubble.ApiConstants.enumFromString;

public enum BubbleNetworkState {

created, setup, starting, restoring, running, stopping, stopped;
created, starting, restoring, running, stopping, stopped;

@JsonCreator public static BubbleNetworkState fromString(String v) { return enumFromString(BubbleNetworkState.class, v); }



+ 1
- 0
bubble-server/src/main/java/bubble/notify/NewNodeNotification.java Ver ficheiro

@@ -15,6 +15,7 @@ public class NewNodeNotification {
@Getter @Setter private String account;
@Getter @Setter private String host;
@Getter @Setter private String network;
@Getter @Setter private String networkName;
@Getter @Setter private String domain;
@Getter @Setter private String fqdn;
@Getter @Setter private String cloud;


+ 1
- 0
bubble-server/src/main/java/bubble/notify/NotificationHandler_hello_from_sage.java Ver ficheiro

@@ -113,6 +113,7 @@ public class NotificationHandler_hello_from_sage extends ReceivedNotificationHan
final NewNodeNotification newNodeRequest = new NewNodeNotification()
.setAccount(network.getAccount())
.setNetwork(network.getUuid())
.setNetworkName(network.getName())
.setDomain(network.getDomain())
.setCloud(cloud.getUuid())
.setRegion(closestNotUs.getInternalName())


+ 7
- 0
bubble-server/src/main/java/bubble/resources/account/AccountsResource.java Ver ficheiro

@@ -300,6 +300,13 @@ public class AccountsResource {
return configuration.subResource(DomainsResource.class, c.account);
}

@Path("/{id}"+EP_FOOTPRINTS)
public FootprintsResource getFootprints(@Context ContainerRequest ctx,
@PathParam("id") String id) {
final AccountContext c = new AccountContext(ctx, id);
return configuration.subResource(FootprintsResource.class, c.account);
}

@Path("/{id}"+EP_NETWORKS)
public NetworksResource getNetworks(@Context ContainerRequest ctx,
@PathParam("id") String id) {


+ 6
- 4
bubble-server/src/main/java/bubble/service/cloud/StandardNetworkService.java Ver ficheiro

@@ -131,7 +131,7 @@ public class StandardNetworkService implements NetworkService {

progressMeter.write(METER_TICK_VALIDATING_NODE_NETWORK_AND_PLAN);
final BubbleNetwork network = networkDAO.findByUuid(nn.getNetwork());
if (network.getState() != BubbleNetworkState.setup) {
if (network.getState() != BubbleNetworkState.starting) {
progressMeter.error(METER_ERROR_NETWORK_NOT_READY_FOR_SETUP);
return die("newNode: network is not in 'setup' state: "+network.getState());
}
@@ -406,7 +406,7 @@ public class StandardNetworkService implements NetworkService {

// if there are no running nodes, and network was in 'setup' state, put it network back into 'created' state
final BubbleNetwork network = networkDAO.findByUuid(node.getNetwork());
if (network.getState() == BubbleNetworkState.setup) {
if (network.getState() == BubbleNetworkState.starting) {
if (nodeDAO.findByNetwork(node.getNetwork()).stream().noneMatch(BubbleNode::isRunning)) {
networkDAO.update(network.setState(BubbleNetworkState.created));
}
@@ -502,7 +502,7 @@ public class StandardNetworkService implements NetworkService {
throw invalidEx("err.network.cannotStartInCurrentState");
}

network.setState(BubbleNetworkState.setup);
network.setState(BubbleNetworkState.starting);
networkDAO.update(network);

// ensure NS records for network are in DNS
@@ -515,6 +515,7 @@ public class StandardNetworkService implements NetworkService {
final NewNodeNotification newNodeRequest = new NewNodeNotification()
.setAccount(accountUuid)
.setNetwork(network.getUuid())
.setNetworkName(network.getName())
.setDomain(network.getDomain())
.setFork(network.fork())
.setHost(host)
@@ -554,7 +555,7 @@ public class StandardNetworkService implements NetworkService {
if (network.getState() != BubbleNetworkState.stopped) {
throw invalidEx("err.network.restore.notStopped");
}
network.setState(BubbleNetworkState.setup);
network.setState(BubbleNetworkState.starting);
networkDAO.update(network);

// ensure NS records for network are in DNS
@@ -569,6 +570,7 @@ public class StandardNetworkService implements NetworkService {
final NewNodeNotification newNodeRequest = new NewNodeNotification()
.setAccount(network.getAccount())
.setNetwork(network.getUuid())
.setNetworkName(network.getName())
.setDomain(network.getDomain())
.setRestoreKey(restoreKey)
.setHost(host)


+ 39
- 7
bubble-server/src/main/resources/message_templates/en_US/server/post_auth/ResourceMessages.properties Ver ficheiro

@@ -74,6 +74,8 @@ account_deletion_name_full_delete=Full delete
account_deletion_description_full_delete=If you delete your account, it will be completely deleted. Another user could then register a new Account using your old username.
account_deletion_name_block_delete=Delete all data, block future registrations
account_deletion_description_block_delete=If you delete your account, all your account data and information will be deleted, but an empty stub Account with your username will remain. This prevents anyone from reusing your username in the future.
account_deletion_name_=Error loading deletion policy
account_deletion_description_=Error loading deletion policy
field_label_policy_account_operation_timeout=Account Operation Timeout
field_label_policy_account_operation_timeout_description=To ensure your Account security, certain operations (like downloading your Account data) require your approval. If no response is received before this timeout, the operation will not be allowed to proceed.
field_label_policy_node_operation_timeout=Bubble Operation Timeout
@@ -143,13 +145,13 @@ message_inbound_failure=failed
# Networks table
loading_networks=Loading bubbles...
table_title_networks=Bubbles
table_head_networks_name=Name
table_head_networks_locale=Locale
table_head_networks_timezone=Time Zone
table_head_networks_object_state=State
table_head_networks_action_view=View
table_head_networks_action_start_stop=Start/Stop
table_head_networks_action_delete=Delete
label_field_networks_name=Name
label_field_networks_locale=Locale
label_field_networks_timezone=Time Zone
label_field_networks_object_state=State
label_field_networks_action_view=View
label_field_networks_action_start_stop=Start/Stop
label_field_networks_action_delete=Delete
table_row_networks_action_view=View
table_row_networks_action_start=Start
table_row_networks_action_stop=Stop
@@ -157,6 +159,13 @@ table_row_networks_action_delete=Delete
button_label_new_network=Create Bubble
message_empty_networks=Create your first Bubble!

# Nodes table
label_field_nodes_fqdn=Name
label_field_nodes_region=Region
label_field_nodes_state=State
label_field_nodes_ip4=IPv4
label_field_nodes_ip6=IPv6

# New Network page
message_no_contacts=No authorized contact info found
link_label_no_contacts=Add an email address or SMS-enabled phone number
@@ -267,6 +276,29 @@ meter_error_role_validation_errors=Validation of ansible roles failed, cannot in
# Launch progress meter: catch-all for unknown/unmapped errors
meter_unknown_error=An unknown error occurred

# Network statuses
msg_network_state_created=initialized
msg_network_state_starting=starting
msg_network_state_restoring=restoring
msg_network_state_running=running
msg_network_state_stopping=stopping
msg_network_state_stopped=stopped

# Node states
msg_node_state_created=created
msg_node_state_starting=starting
msg_node_state_booting=booting
msg_node_state_booted=booted
msg_node_state_preparing_install=preparing installation
msg_node_state_awaiting_dns=waiting for DNS to be visible
msg_node_state_installing=installing
msg_node_state_running=running
msg_node_state_stopping=stopping
msg_node_state_unreachable=unreachable
msg_node_state_error_stopping=error stopping
msg_node_state_error_stopped=stopped with error
msg_node_state_unknown_error=unknown error

# Error messages from API server
err.accountContactsJson.length=Account contacts length violation
err.accountOperationTimeout.required=Account operation timeout is required


+ 3
- 0
bubble-server/src/main/resources/message_templates/en_US/server/pre_auth/ResourceMessages.properties Ver ficheiro

@@ -8,6 +8,9 @@ message_false=False
message_null=null
message_undefined=undefined

# Display of percent values has localized variations
label_percent={{percent}}%

button_label_set_locale=Set Language
field_label_locale=Language
field_label_timezone=Time Zone


+ 1
- 1
bubble-server/src/main/resources/models/defaults/cloudService.json Ver ficheiro

@@ -36,7 +36,7 @@
},

{
"name": "S3_US_Standard",
"name": "S3Storage",
"type": "storage",
"driverClass": "bubble.cloud.storage.s3.S3StorageDriver",
"driverConfig": {


+ 1
- 1
bubble-server/src/test/java/bubble/test/S3StorageTest.java Ver ficheiro

@@ -39,7 +39,7 @@ public class S3StorageTest extends NetworkTestBase {
public static final int NUM_FILES_IN_DIR = 13;
public static final int LIST_FETCH_SIZE = 5;

public static final String S3_CLOUD_NAME = "S3_US_Standard";
public static final String S3_CLOUD_NAME = "S3Storage";
public static final String REKEY_S3_CLOUD = "RekeyS3Cloud";

public static String comment = "not running";


+ 1
- 1
bubble-server/src/test/resources/models/system/cloudService.json Ver ficheiro

@@ -1,7 +1,7 @@
[
{
"_subst": true,
"name": "S3_US_Standard",
"name": "S3Storage",
"type": "storage",
"driverClass": "bubble.cloud.storage.s3.S3StorageDriver",
"driverConfig": {


+ 1
- 1
bubble-web

@@ -1 +1 @@
Subproject commit 5929c083466af4326f149feef4576b3fb1f9b89c
Subproject commit 2796ab0a31f995e0c2d3a3e34e08ebafcba3da7c

+ 1
- 1
config/activation.json Ver ficheiro

@@ -30,7 +30,7 @@
},

// You must configure the AWS S3 Storage service in order to launch new Bubbles
"S3_US_Standard" : {
"S3Storage" : {
"config": {
// region must be a valid value from the Regions enum: https://github.com/aws/aws-sdk-java/blob/master/aws-java-sdk-core/src/main/java/com/amazonaws/regions/Regions.java
"region": "US_EAST_1",


Carregando…
Cancelar
Guardar