public CreateSubnetResponse createSubnet(CreateSubnetRequest request)
            throws BceClientException {
        checkNotNull(request, "request should not be null.");
        if (Strings.isNullOrEmpty(request.getClientToken())) {
            request.setClientToken(this.generateClientToken());
        }
        checkStringNotEmpty(request.getName(), "name should not be empty");
        checkStringNotEmpty(request.getCidr(), "cidr should not be empty");
        checkStringNotEmpty(request.getZoneName(), "zone name should not be empty");
        checkStringNotEmpty(request.getVpcId(), "vpc id should not be empty");

        InternalRequest internalRequest = this.createRequest(request, HttpMethodName.POST, SUBNET_PREFIX);
        if (!Strings.isNullOrEmpty(request.getClientToken())) {
            internalRequest.addParameter("clientToken", request.getClientToken());
        }
        fillPayload(internalRequest, request);
        return invokeHttpClient(internalRequest, CreateSubnetResponse.class);
    }
public CreateSubnetResponse createSubnet ( CreateSubnetRequest request ) throws BceClientException { checkNotNull ( request , "request should not be null." ) ; if ( Strings . isNullOrEmpty ( request . getClientToken ( ) ) ) { request . setClientToken ( this . generateClientToken ( ) ) ; } checkStringNotEmpty ( request . getName ( ) , "name should not be empty" ) ; checkStringNotEmpty ( request . getCidr ( ) , "cidr should not be empty" ) ; checkStringNotEmpty ( request . getZoneName ( ) , "zone name should not be empty" ) ; checkStringNotEmpty ( request . getVpcId ( ) , "vpc id should not be empty" ) ; InternalRequest internalRequest = this . createRequest ( request , HttpMethodName . POST , SUBNET_PREFIX ) ; if ( ! Strings . isNullOrEmpty ( request . getClientToken ( ) ) ) { internalRequest . addParameter ( "clientToken" , request . getClientToken ( ) ) ; } fillPayload ( internalRequest , request ) ; return invokeHttpClient ( internalRequest , CreateSubnetResponse . class ) ; }
Create a subnet with the specified options.
You must fill the field of clientToken,which is especially for keeping idempotent.
<p/>

@param request The request containing all options for creating subnet.
@return List of subnetId newly created
@throws BceClientException