<p>connect.</p>

@param projectId a {@link java.lang.String} object.
@param instanceId a {@link java.lang.String} object.
@return a {@link org.apache.hadoop.hbase.client.Connection} object.
345049
public static Connection connect(String projectId, String instanceId) {
    return connect(configure(projectId, instanceId));
  }
1333514
func InstanceID(ctx types.Context) (*types.InstanceID, error) {

	hostname, err := getCurrentShortHostname(ctx)
	if err != nil {
		return nil, err
	}

	projectID, err := getCurrentProjectID(ctx)
	if err != nil {
		return nil, err
	}

	zone, err := getCurrentZone(ctx)
	if err != nil {
		return nil, err
	}

	return &types.InstanceID{
		ID:     *hostname,
		Driver: gcepd.Name,
		Fields: map[string]string{
			gcepd.InstanceIDFieldProjectID: projectID,
			gcepd.InstanceIDFieldZone:      zone,
		},
	}, nil
}
1167906
@InternalApi
  public com.google.bigtable.admin.v2.CreateInstanceRequest toProto(String projectId) {
    builder.setParent(NameUtil.formatProjectName(projectId)).clearClusters();

    for (CreateClusterRequest clusterRequest : clusterRequests) {
      builder.putClusters(clusterRequest.getClusterId(), clusterRequest.toEmbeddedProto(projectId));
    }

    return builder.build();
  }
1245946
@InternalApi
  public com.google.bigtable.admin.v2.CreateAppProfileRequest toProto(String projectId) {
    String name = NameUtil.formatInstanceName(projectId, instanceId);

    return proto.setParent(name).build();
  }
495784
func (cs *CSCloud) InstanceID(ctx context.Context, name types.NodeName) (string, error) {
	instance, count, err := cs.client.VirtualMachine.GetVirtualMachineByName(
		string(name),
		cloudstack.WithProject(cs.projectID),
	)
	if err != nil {
		if count == 0 {
			return "", cloudprovider.InstanceNotFound
		}
		return "", fmt.Errorf("error retrieving instance ID: %v", err)
	}

	return instance.Id, nil
}
1235294
private void connect(CompletableFuture<Connection> future) {
    if (!selector.hasNext()) {
      LOGGER.debug("{} - Failed to connect to the cluster", id);
      future.complete(null);
    } else {
      Address address = selector.next();
      LOGGER.debug("{} - Connecting to {}", id, address);
      client.connect(address).whenComplete((c, e) -> handleConnection(address, c, e, future));
    }
  }
818193
public void project_serviceName_instance_instanceId_resume_POST(String serviceName, String instanceId) throws IOException {
		String qPath = "/cloud/project/{serviceName}/instance/{instanceId}/resume";
		StringBuilder sb = path(qPath, serviceName, instanceId);
		exec(qPath, "POST", sb.toString(), null);
	}
233471
@Override
    protected Client instantiateClient(String persistenceUnit)
    {
        return new HBaseClient(indexManager, conf, connection, reader, persistenceUnit, externalProperties,
                clientMetadata, kunderaMetadata);
    }
1118375
public void createInstance(
      final String my_instance_id, final String my_config_id, final String my_client_project) {
    // [START instance_admin_client_create_instance]
    final String instanceId = my_instance_id;
    final String configId = my_config_id;
    final String clientProject = my_client_project;

    OperationFuture<Instance, CreateInstanceMetadata> op =
        instanceAdminClient.createInstance(
            InstanceInfo.newBuilder(InstanceId.of(clientProject, instanceId))
                .setInstanceConfigId(InstanceConfigId.of(clientProject, configId))
                .setDisplayName(instanceId)
                .setNodeCount(1)
                .build());
    try {
      op.get();
    } catch (ExecutionException e) {
      throw (SpannerException) e.getCause();
    } catch (InterruptedException e) {
      throw SpannerExceptionFactory.propagateInterrupt(e);
    }
    // [END instance_admin_client_create_instance]
  }
1225085
public void project_serviceName_instance_instanceId_PUT(String serviceName, String instanceId, String instanceName) throws IOException {
		String qPath = "/cloud/project/{serviceName}/instance/{instanceId}";
		StringBuilder sb = path(qPath, serviceName, instanceId);
		HashMap<String, Object>o = new HashMap<String, Object>();
		addBody(o, "instanceName", instanceName);
		exec(qPath, "PUT", sb.toString(), o);
	}
495359
public static String lookupInstanceId(String projectId, String clusterId, String zoneId)
    throws IOException {
    BigtableClusterUtilities utils;
    try {
      utils = BigtableClusterUtilities.forAllInstances(projectId);
    } catch (GeneralSecurityException e) {
      throw new RuntimeException("Could not initialize BigtableClusterUtilities", e);
    }

    try {
      Cluster cluster = utils.getCluster(clusterId, zoneId);
      return new BigtableClusterName(cluster.getName()).getInstanceId();
    } finally {
      try {
        utils.close();
      } catch (Exception e) {
        logger.warn("Error closing BigtableClusterUtilities: ", e);
      }
    }
  }
1286661
public void bindEip(String eip, String instanceId, String instanceType) {
        this.bindEip(new BindEipRequest().withEip(eip).withInstanceId(instanceId).withInstanceType(instanceType));
    }
868326
@SuppressWarnings("WeakerAccess")
  public ApiFuture<Instance> getInstanceAsync(String instanceId) {
    String name = NameUtil.formatInstanceName(projectId, instanceId);

    com.google.bigtable.admin.v2.GetInstanceRequest request =
        com.google.bigtable.admin.v2.GetInstanceRequest.newBuilder().setName(name).build();

    return ApiFutures.transform(
        stub.getInstanceCallable().futureCall(request),
        new ApiFunction<com.google.bigtable.admin.v2.Instance, Instance>() {
          @Override
          public Instance apply(com.google.bigtable.admin.v2.Instance proto) {
            return Instance.fromProto(proto);
          }
        },
        MoreExecutors.directExecutor());
  }
214321
protected CompletableFuture<JsonObjectBuilder> makeBuilder(int instanceId) {
    CompletableFuture<T> futureValue = getValue();

    if (futureValue == null) {
      logger.error("Could not retrieve value " + this.getClass().getName());
      return null;
    }

    return futureValue
        .exceptionally(
            t -> {
              logger.error("Could not retrieve value " + this.getClass().getName(), t);
              return null;
            })
        .thenApply(
            value -> {
              JsonArrayBuilder perms = Json.createArrayBuilder();
              if (isWritable) {
                perms.add("pw");
              }
              if (isReadable) {
                perms.add("pr");
              }
              if (isEventable) {
                perms.add("ev");
              }
              JsonObjectBuilder builder =
                  Json.createObjectBuilder()
                      .add("iid", instanceId)
                      .add("type", shortType)
                      .add("perms", perms.build())
                      .add("format", format)
                      .add("ev", false)
                      .add("description", description);
              setJsonValue(builder, value);
              return builder;
            });
  }
198035
@RequestMapping(value = "branches/{branchId}/template/connect", method = RequestMethod.POST)
    public Branch connectTemplateInstance(@PathVariable ID branchId, @RequestBody BranchTemplateInstanceConnectRequest request) {
        return branchTemplateService.connectTemplateInstance(branchId, request);
    }
477727
func InstanceID(
	ctx types.Context,
	driverName string) (*types.InstanceID, error) {

	req, err := http.NewRequest(http.MethodGet, iidURL, nil)
	if err != nil {
		return nil, err
	}

	res, err := doRequest(ctx, req)
	if err != nil {
		return nil, err
	}
	defer res.Body.Close()

	iid := instanceIdentityDoc{}
	dec := json.NewDecoder(res.Body)
	if err := dec.Decode(&iid); err != nil {
		return nil, err
	}

	return &types.InstanceID{
		ID:     iid.InstanceID,
		Driver: driverName,
		Fields: map[string]string{
			ebs.InstanceIDFieldRegion:           iid.Region,
			ebs.InstanceIDFieldAvailabilityZone: iid.AvailabilityZone,
		},
	}, nil
}
1112039
public void add(String instanceId) {
		ScheduledFuture task = this.scheduler.scheduleAtFixedRate(
				new ConsulHeartbeatTask(instanceId), this.configuration
						.computeHearbeatInterval().toStandardDuration().getMillis());
		ScheduledFuture previousTask = this.serviceHeartbeats.put(instanceId, task);
		if (previousTask != null) {
			previousTask.cancel(true);
		}
	}