idx
int64
0
165k
question
stringlengths
73
4.15k
target
stringlengths
5
918
len_question
int64
21
890
len_target
int64
3
255
12,300
public boolean isInstalled ( ) throws ManagedSdkVerificationException , ManagedSdkVersionMismatchException { if ( getSdkHome ( ) == null ) { return false ; } if ( ! Files . isDirectory ( getSdkHome ( ) ) ) { return false ; } if ( ! Files . isRegularFile ( getGcloudPath ( ) ) ) { return false ; } // Verify the versions match up for fixed version installs if ( version != Version . LATEST ) { try { String versionFileContents = new String ( Files . readAllBytes ( getSdkHome ( ) . resolve ( "VERSION" ) ) , StandardCharsets . UTF_8 ) . trim ( ) ; if ( ! versionFileContents . equals ( version . getVersion ( ) ) ) { throw new ManagedSdkVersionMismatchException ( "Installed sdk version: " + versionFileContents + " does not match expected version: " + version . getVersion ( ) + "." ) ; } } catch ( IOException ex ) { throw new ManagedSdkVerificationException ( ex ) ; } } return true ; }
Simple check to verify Cloud SDK installed by verifying the existence of gcloud .
241
15
12,301
public boolean isUpToDate ( ) throws ManagedSdkVerificationException { if ( ! Files . isRegularFile ( getGcloudPath ( ) ) ) { return false ; } if ( version != Version . LATEST ) { return true ; } List < String > updateAvailableCommand = Arrays . asList ( getGcloudPath ( ) . toString ( ) , "components" , "list" , "--format=json" , "--filter=state.name:Update Available" ) ; try { String result = CommandCaller . newCaller ( ) . call ( updateAvailableCommand , null , null ) ; for ( CloudSdkComponent component : CloudSdkComponent . fromJsonList ( result ) ) { State state = component . getState ( ) ; if ( state != null ) { if ( "Update Available" . equals ( state . getName ( ) ) ) { return false ; } } } return true ; } catch ( CommandExecutionException | InterruptedException | CommandExitException ex ) { throw new ManagedSdkVerificationException ( ex ) ; } }
Query gcloud to see if SDK is up to date . Gcloud makes a call to the server to check this .
233
24
12,302
public Extractor newExtractor ( Path archive , Path destination , ProgressListener progressListener ) throws UnknownArchiveTypeException { if ( archive . toString ( ) . toLowerCase ( ) . endsWith ( ".tar.gz" ) ) { return new Extractor ( archive , destination , new TarGzExtractorProvider ( ) , progressListener ) ; } if ( archive . toString ( ) . toLowerCase ( ) . endsWith ( ".zip" ) ) { return new Extractor ( archive , destination , new ZipExtractorProvider ( ) , progressListener ) ; } throw new UnknownArchiveTypeException ( archive ) ; }
Creates a new extractor based on filetype . Filetype determination is based on the filename string this method makes no attempt to validate the file contents to verify they are the type defined by the file extension .
133
42
12,303
@ SuppressWarnings ( "unchecked" ) public static AppYaml parse ( InputStream input ) throws AppEngineException { try { // our needs are simple so just load using primitive objects Yaml yaml = new Yaml ( new SafeConstructor ( ) ) ; Map < String , ? > contents = ( Map < String , ? > ) yaml . load ( input ) ; return new AppYaml ( contents ) ; } catch ( YAMLException ex ) { throw new AppEngineException ( "Malformed 'app.yaml'." , ex ) ; } }
Parse an app . yaml file to an AppYaml object .
123
15
12,304
public Builder toBuilder ( ) { Builder builder = builder ( getServices ( ) ) . additionalArguments ( getAdditionalArguments ( ) ) . automaticRestart ( automaticRestart ) . defaultGcsBucketName ( defaultGcsBucketName ) . environment ( getEnvironment ( ) ) . host ( host ) . jvmFlags ( getJvmFlags ( ) ) . port ( port ) . projectId ( projectId ) ; return builder ; }
Returns a mutable builder initialized with the values of this runtime configuration .
95
14
12,305
@ Override public void handleStream ( final InputStream inputStream ) { if ( executorService . isShutdown ( ) ) { throw new IllegalStateException ( "Cannot re-use " + this . getClass ( ) . getName ( ) ) ; } result . setFuture ( executorService . submit ( ( ) -> consumeBytes ( inputStream ) ) ) ; executorService . shutdown ( ) ; }
Handle an input stream on a separate thread .
88
9
12,306
public static SdkUpdater newUpdater ( OsInfo . Name osName , Path gcloudPath ) { switch ( osName ) { case WINDOWS : return new SdkUpdater ( gcloudPath , CommandRunner . newRunner ( ) , new WindowsBundledPythonCopier ( gcloudPath , CommandCaller . newCaller ( ) ) ) ; default : return new SdkUpdater ( gcloudPath , CommandRunner . newRunner ( ) , null ) ; } }
Configure and create a new Updater instance .
108
11
12,307
public void stageArchive ( AppYamlProjectStageConfiguration config ) throws AppEngineException { Preconditions . checkNotNull ( config ) ; Path stagingDirectory = config . getStagingDirectory ( ) ; if ( ! Files . exists ( stagingDirectory ) ) { throw new AppEngineException ( "Staging directory does not exist. Location: " + stagingDirectory ) ; } if ( ! Files . isDirectory ( stagingDirectory ) ) { throw new AppEngineException ( "Staging location is not a directory. Location: " + stagingDirectory ) ; } try { String env = findEnv ( config ) ; String runtime = findRuntime ( config ) ; if ( "flex" . equals ( env ) ) { stageFlexibleArchive ( config , runtime ) ; } else if ( "java11" . equals ( runtime ) ) { stageStandardArchive ( config ) ; } else { // I don't know how to deploy this throw new AppEngineException ( "Cannot process application with runtime: " + runtime + ( Strings . isNullOrEmpty ( env ) ? "" : " and env: " + env ) ) ; } } catch ( IOException ex ) { throw new AppEngineException ( ex ) ; } }
Stages an app . yaml based App Engine project for deployment . Copies app . yaml the project artifact and any user defined extra files . Will also copy the Docker directory for flex projects .
257
40
12,308
public void extract ( ) throws IOException , InterruptedException { try { extractorProvider . extract ( archive , destination , progressListener ) ; } catch ( IOException ex ) { try { logger . warning ( "Extraction failed, cleaning up " + destination ) ; cleanUp ( destination ) ; } catch ( IOException exx ) { logger . warning ( "Failed to cleanup directory" ) ; } // intentional rethrow after cleanup throw ex ; } // we do not allow interrupt mid extraction, so catch it here, we still end up // with a valid directory though, so don't clean it up. if ( Thread . currentThread ( ) . isInterrupted ( ) ) { logger . warning ( "Process was interrupted" ) ; throw new InterruptedException ( "Process was interrupted" ) ; } }
Extract an archive .
168
5
12,309
public void start ( VersionsSelectionConfiguration configuration ) throws AppEngineException { Preconditions . checkNotNull ( configuration ) ; Preconditions . checkNotNull ( configuration . getVersions ( ) ) ; Preconditions . checkArgument ( configuration . getVersions ( ) . size ( ) > 0 ) ; List < String > arguments = new ArrayList <> ( ) ; arguments . add ( "app" ) ; arguments . add ( "versions" ) ; arguments . add ( "start" ) ; arguments . addAll ( commonVersionSelectionArgs ( configuration ) ) ; execute ( arguments ) ; }
Starts serving a specific version or versions .
127
9
12,310
public void list ( VersionsListConfiguration configuration ) throws AppEngineException { Preconditions . checkNotNull ( configuration ) ; List < String > arguments = new ArrayList <> ( ) ; arguments . add ( "app" ) ; arguments . add ( "versions" ) ; arguments . add ( "list" ) ; arguments . addAll ( GcloudArgs . get ( "service" , configuration . getService ( ) ) ) ; arguments . addAll ( GcloudArgs . get ( "hide-no-traffic" , configuration . getHideNoTraffic ( ) ) ) ; arguments . addAll ( GcloudArgs . get ( "project" , configuration . getProjectId ( ) ) ) ; execute ( arguments ) ; }
Lists the versions for a service or every version of every service if no service is specified .
154
19
12,311
@ Override public void onOutputLine ( String line ) { if ( waitLatch . getCount ( ) > 0 && message != null && line . matches ( message ) ) { waitLatch . countDown ( ) ; } }
Monitors the output of the process to check whether the wait condition is satisfied .
49
16
12,312
public List < CloudSdkComponent > getComponents ( ) throws ProcessHandlerException , JsonSyntaxException , CloudSdkNotFoundException , CloudSdkOutOfDateException , CloudSdkVersionFileException , IOException { sdk . validateCloudSdk ( ) ; // gcloud components list --show-versions --format=json List < String > command = new ImmutableList . Builder < String > ( ) . add ( "components" , "list" ) . addAll ( GcloudArgs . get ( "show-versions" , true ) ) . addAll ( GcloudArgs . get ( "format" , "json" ) ) . build ( ) ; String componentsJson = runCommand ( command ) ; return CloudSdkComponent . fromJsonList ( componentsJson ) ; }
Returns the list of Cloud SDK Components and their settings reported by the current gcloud installation . Unlike other methods in this class that call gcloud this method always uses a synchronous ProcessRunner and will block until the gcloud process returns .
172
47
12,313
public CloudSdkConfig getConfig ( ) throws CloudSdkNotFoundException , CloudSdkOutOfDateException , CloudSdkVersionFileException , IOException , ProcessHandlerException { sdk . validateCloudSdk ( ) ; List < String > command = new ImmutableList . Builder < String > ( ) . add ( "config" , "list" ) . addAll ( GcloudArgs . get ( "format" , "json" ) ) . build ( ) ; String configJson = runCommand ( command ) ; return CloudSdkConfig . fromJson ( configJson ) ; }
Returns a representation of gcloud config it makes a synchronous call to gcloud config list to do so .
128
22
12,314
public String runCommand ( List < String > args ) throws CloudSdkNotFoundException , IOException , ProcessHandlerException { sdk . validateCloudSdkLocation ( ) ; StringBuilderProcessOutputLineListener stdOutListener = StringBuilderProcessOutputLineListener . newListener ( ) ; StringBuilderProcessOutputLineListener stdErrListener = StringBuilderProcessOutputLineListener . newListenerWithNewlines ( ) ; ExitCodeRecorderProcessExitListener exitListener = new ExitCodeRecorderProcessExitListener ( ) ; // build and run the command List < String > command = new ImmutableList . Builder < String > ( ) . add ( sdk . getGCloudPath ( ) . toAbsolutePath ( ) . toString ( ) ) . addAll ( args ) . build ( ) ; Process process = new ProcessBuilder ( command ) . start ( ) ; LegacyProcessHandler . builder ( ) . addStdOutLineListener ( stdOutListener ) . addStdErrLineListener ( stdErrListener ) . setExitListener ( exitListener ) . build ( ) . handleProcess ( process ) ; if ( exitListener . getMostRecentExitCode ( ) != null && ! exitListener . getMostRecentExitCode ( ) . equals ( 0 ) ) { Logger . getLogger ( Gcloud . class . getName ( ) ) . severe ( stdErrListener . toString ( ) ) ; throw new ProcessHandlerException ( "Process exited unsuccessfully with code " + exitListener . getMostRecentExitCode ( ) ) ; } return stdOutListener . toString ( ) ; }
Run short lived gcloud commands .
333
7
12,315
public void run ( List < String > args ) throws ProcessHandlerException , AppEngineJavaComponentsNotInstalledException , InvalidJavaSdkException , IOException { sdk . validateAppEngineJavaComponents ( ) ; sdk . validateJdk ( ) ; // App Engine Java Sdk requires this system property to be set. // TODO: perhaps we should send this in directly to the command instead of changing the global // state here (see DevAppServerRunner) System . setProperty ( "appengine.sdk.root" , sdk . getAppEngineSdkForJavaPath ( ) . toString ( ) ) ; List < String > command = new ArrayList <> ( ) ; command . add ( sdk . getJavaExecutablePath ( ) . toString ( ) ) ; command . add ( "-cp" ) ; command . add ( sdk . getAppEngineToolsJar ( ) . toString ( ) ) ; command . add ( "com.google.appengine.tools.admin.AppCfg" ) ; command . addAll ( args ) ; logger . info ( "submitting command: " + Joiner . on ( " " ) . join ( command ) ) ; ProcessBuilder processBuilder = processBuilderFactory . newProcessBuilder ( ) ; processBuilder . command ( command ) ; Process process = processBuilder . start ( ) ; processHandler . handleProcess ( process ) ; }
Executes an App Engine SDK CLI command .
297
9
12,316
public void generate ( GenRepoInfoFileConfiguration configuration ) throws AppEngineException { List < String > arguments = new ArrayList <> ( ) ; arguments . add ( "beta" ) ; arguments . add ( "debug" ) ; arguments . add ( "source" ) ; arguments . add ( "gen-repo-info-file" ) ; arguments . addAll ( GcloudArgs . get ( "output-directory" , configuration . getOutputDirectory ( ) ) ) ; arguments . addAll ( GcloudArgs . get ( "source-directory" , configuration . getSourceDirectory ( ) ) ) ; try { runner . run ( arguments , null ) ; } catch ( ProcessHandlerException | IOException ex ) { throw new AppEngineException ( ex ) ; } }
Generates source context files .
162
6
12,317
public void download ( ) throws IOException , InterruptedException { if ( ! Files . exists ( destinationFile . getParent ( ) ) ) { Files . createDirectories ( destinationFile . getParent ( ) ) ; } if ( Files . exists ( destinationFile ) ) { throw new FileAlreadyExistsException ( destinationFile . toString ( ) ) ; } URLConnection connection = address . openConnection ( ) ; connection . setRequestProperty ( "User-Agent" , userAgentString ) ; try ( InputStream in = connection . getInputStream ( ) ) { // note : contentLength can potentially be -1 if it is unknown. long contentLength = connection . getContentLengthLong ( ) ; logger . info ( "Downloading " + address + " to " + destinationFile ) ; try ( BufferedOutputStream out = new BufferedOutputStream ( Files . newOutputStream ( destinationFile , StandardOpenOption . CREATE_NEW ) ) ) { progressListener . start ( getDownloadStatus ( contentLength , Locale . getDefault ( ) ) , contentLength ) ; int bytesRead ; byte [ ] buffer = new byte [ BUFFER_SIZE ] ; while ( ( bytesRead = in . read ( buffer ) ) != - 1 ) { if ( Thread . currentThread ( ) . isInterrupted ( ) ) { logger . warning ( "Download was interrupted\n" ) ; cleanUp ( ) ; throw new InterruptedException ( "Download was interrupted" ) ; } out . write ( buffer , 0 , bytesRead ) ; progressListener . update ( bytesRead ) ; } } } progressListener . done ( ) ; }
Download an archive this will NOT overwrite a previously existing file .
341
12
12,318
public CloudSdkVersion getVersion ( ) throws CloudSdkVersionFileException { Path versionFile = getPath ( ) . resolve ( VERSION_FILE_NAME ) ; if ( ! Files . isRegularFile ( versionFile ) ) { throw new CloudSdkVersionFileNotFoundException ( "Cloud SDK version file not found at " + versionFile . toString ( ) ) ; } String contents = "" ; try { List < String > lines = Files . readAllLines ( versionFile , StandardCharsets . UTF_8 ) ; if ( lines . size ( ) > 0 ) { // expect only a single line contents = lines . get ( 0 ) ; } return new CloudSdkVersion ( contents ) ; } catch ( IOException ex ) { throw new CloudSdkVersionFileException ( ex ) ; } catch ( IllegalArgumentException ex ) { throw new CloudSdkVersionFileParseException ( "Pattern found in the Cloud SDK version file could not be parsed: " + contents , ex ) ; } }
Returns the version of the Cloud SDK installation . Version is determined by reading the VERSION file located in the Cloud SDK directory .
215
25
12,319
public Path getGCloudPath ( ) { String gcloud = GCLOUD ; if ( IS_WINDOWS ) { gcloud += ".cmd" ; } return getPath ( ) . resolve ( gcloud ) ; }
Get an OS specific path to gcloud .
46
9
12,320
public Path getAppEngineSdkForJavaPath ( ) { Path resolved = getPath ( ) . resolve ( APPENGINE_SDK_FOR_JAVA_PATH ) ; if ( resolved == null ) { throw new RuntimeException ( "Misconfigured App Engine SDK for Java" ) ; } return resolved ; }
Returns the directory containing JAR files bundled with the Cloud SDK .
68
13
12,321
public void validateAppEngineJavaComponents ( ) throws AppEngineJavaComponentsNotInstalledException { if ( ! Files . isDirectory ( getAppEngineSdkForJavaPath ( ) ) ) { throw new AppEngineJavaComponentsNotInstalledException ( "Validation Error: Java App Engine components not installed." + " Fix by running 'gcloud components install app-engine-java' on command-line." ) ; } if ( ! Files . isRegularFile ( jarLocations . get ( JAVA_TOOLS_JAR ) ) ) { throw new AppEngineJavaComponentsNotInstalledException ( "Validation Error: Java Tools jar location '" + jarLocations . get ( JAVA_TOOLS_JAR ) + "' is not a file." ) ; } }
Checks whether the App Engine Java components are installed in the expected location in the Cloud SDK .
171
19
12,322
public Path getAppEngineToolsJar ( ) { Path path = jarLocations . get ( JAVA_TOOLS_JAR ) ; if ( path == null ) { throw new RuntimeException ( "Misconfigured Cloud SDK" ) ; } return path ; }
Locates appengine - tools - api . jar .
57
11
12,323
public void installComponent ( SdkComponent component , ProgressListener progressListener , ConsoleListener consoleListener ) throws InterruptedException , CommandExitException , CommandExecutionException { progressListener . start ( "Installing " + component . toString ( ) , ProgressListener . UNKNOWN ) ; Map < String , String > environment = null ; if ( pythonCopier != null ) { environment = pythonCopier . copyPython ( ) ; } Path workingDirectory = gcloudPath . getRoot ( ) ; List < String > command = Arrays . asList ( gcloudPath . toString ( ) , "components" , "install" , component . toString ( ) , "--quiet" ) ; commandRunner . run ( command , workingDirectory , environment , consoleListener ) ; progressListener . done ( ) ; }
Install a component .
169
4
12,324
public static SdkComponentInstaller newComponentInstaller ( OsInfo . Name osName , Path gcloudPath ) { switch ( osName ) { case WINDOWS : return new SdkComponentInstaller ( gcloudPath , CommandRunner . newRunner ( ) , new WindowsBundledPythonCopier ( gcloudPath , CommandCaller . newCaller ( ) ) ) ; default : return new SdkComponentInstaller ( gcloudPath , CommandRunner . newRunner ( ) , null ) ; } }
Configure and create a new Component Installer instance .
108
11
12,325
public Path install ( final ProgressListener progressListener , final ConsoleListener consoleListener ) throws IOException , InterruptedException , SdkInstallerException , CommandExecutionException , CommandExitException { FileResourceProvider fileResourceProvider = fileResourceProviderFactory . newFileResourceProvider ( ) ; // Cleanup, remove old downloaded archive if exists if ( Files . isRegularFile ( fileResourceProvider . getArchiveDestination ( ) ) ) { logger . info ( "Removing stale archive: " + fileResourceProvider . getArchiveDestination ( ) ) ; Files . delete ( fileResourceProvider . getArchiveDestination ( ) ) ; } // Cleanup, remove old SDK directory if exists if ( Files . exists ( fileResourceProvider . getArchiveExtractionDestination ( ) ) ) { logger . info ( "Removing stale install: " + fileResourceProvider . getArchiveExtractionDestination ( ) ) ; MoreFiles . deleteRecursively ( fileResourceProvider . getArchiveExtractionDestination ( ) , RecursiveDeleteOption . ALLOW_INSECURE ) ; } progressListener . start ( "Installing Cloud SDK" , installerFactory != null ? 300 : 200 ) ; // download and verify Downloader downloader = downloaderFactory . newDownloader ( fileResourceProvider . getArchiveSource ( ) , fileResourceProvider . getArchiveDestination ( ) , progressListener . newChild ( 100 ) ) ; downloader . download ( ) ; if ( ! Files . isRegularFile ( fileResourceProvider . getArchiveDestination ( ) ) ) { throw new SdkInstallerException ( "Download succeeded but valid archive not found at " + fileResourceProvider . getArchiveDestination ( ) ) ; } try { // extract and verify extractorFactory . newExtractor ( fileResourceProvider . getArchiveDestination ( ) , fileResourceProvider . getArchiveExtractionDestination ( ) , progressListener . newChild ( 100 ) ) . extract ( ) ; if ( ! Files . isDirectory ( fileResourceProvider . getExtractedSdkHome ( ) ) ) { throw new SdkInstallerException ( "Extraction succeeded but valid sdk home not found at " + fileResourceProvider . getExtractedSdkHome ( ) ) ; } } catch ( UnknownArchiveTypeException e ) { // fileResourceProviderFactory.newFileResourceProvider() creates a fileResourceProvider that // returns either .tar.gz or .zip for getArchiveDestination(). throw new RuntimeException ( e ) ; } // install if necessary if ( installerFactory != null ) { installerFactory . newInstaller ( fileResourceProvider . getExtractedSdkHome ( ) , progressListener . newChild ( 100 ) , consoleListener ) . install ( ) ; } // verify final state if ( ! Files . isRegularFile ( fileResourceProvider . getExtractedGcloud ( ) ) ) { throw new SdkInstallerException ( "Installation succeeded but gcloud executable not found at " + fileResourceProvider . getExtractedGcloud ( ) ) ; } progressListener . done ( ) ; return fileResourceProvider . getExtractedSdkHome ( ) ; }
Download and install a new Cloud SDK .
664
8
12,326
public static SdkInstaller newInstaller ( Path managedSdkDirectory , Version version , OsInfo osInfo , String userAgentString , boolean usageReporting ) { DownloaderFactory downloaderFactory = new DownloaderFactory ( userAgentString ) ; ExtractorFactory extractorFactory = new ExtractorFactory ( ) ; InstallerFactory installerFactory = version == Version . LATEST ? new InstallerFactory ( osInfo , usageReporting ) : null ; FileResourceProviderFactory fileResourceProviderFactory = new FileResourceProviderFactory ( version , osInfo , managedSdkDirectory ) ; return new SdkInstaller ( fileResourceProviderFactory , downloaderFactory , extractorFactory , installerFactory ) ; }
Configure and create a new Installer instance .
143
10
12,327
public void run ( RunConfiguration config ) throws AppEngineException { Preconditions . checkNotNull ( config ) ; Preconditions . checkNotNull ( config . getServices ( ) ) ; Preconditions . checkArgument ( config . getServices ( ) . size ( ) > 0 ) ; List < String > arguments = new ArrayList <> ( ) ; List < String > jvmArguments = new ArrayList <> ( ) ; arguments . addAll ( DevAppServerArgs . get ( "address" , config . getHost ( ) ) ) ; arguments . addAll ( DevAppServerArgs . get ( "port" , config . getPort ( ) ) ) ; if ( Boolean . TRUE . equals ( config . getAutomaticRestart ( ) ) ) { jvmArguments . add ( "-Dappengine.fullscan.seconds=1" ) ; } if ( config . getJvmFlags ( ) != null ) { jvmArguments . addAll ( config . getJvmFlags ( ) ) ; } arguments . addAll ( DevAppServerArgs . get ( "default_gcs_bucket" , config . getDefaultGcsBucketName ( ) ) ) ; arguments . addAll ( DevAppServerArgs . get ( "application" , config . getProjectId ( ) ) ) ; arguments . add ( "--allow_remote_shutdown" ) ; arguments . add ( "--disable_update_check" ) ; List < String > additionalArguments = config . getAdditionalArguments ( ) ; if ( additionalArguments != null ) { arguments . addAll ( additionalArguments ) ; } boolean isSandboxEnforced = isSandboxEnforced ( config . getServices ( ) ) ; if ( ! isSandboxEnforced ) { jvmArguments . add ( "-Duse_jetty9_runtime=true" ) ; jvmArguments . add ( "-D--enable_all_permissions=true" ) ; arguments . add ( "--no_java_agent" ) ; } else { // Add in the appengine agent String appengineAgentJar = sdk . getAppEngineSdkForJavaPath ( ) . resolve ( "agent/appengine-agent.jar" ) . toAbsolutePath ( ) . toString ( ) ; jvmArguments . add ( "-javaagent:" + appengineAgentJar ) ; } for ( Path service : config . getServices ( ) ) { arguments . add ( service . toString ( ) ) ; } Map < String , String > appEngineEnvironment = getAllAppEngineWebXmlEnvironmentVariables ( config . getServices ( ) ) ; if ( ! appEngineEnvironment . isEmpty ( ) ) { log . info ( "Setting appengine-web.xml configured environment variables: " + Joiner . on ( "," ) . withKeyValueSeparator ( "=" ) . join ( appEngineEnvironment ) ) ; } String gaeRuntime = getGaeRuntimeJava ( ! isSandboxEnforced ) ; appEngineEnvironment . putAll ( getLocalAppEngineEnvironmentVariables ( gaeRuntime ) ) ; Map < String , String > configEnvironment = config . getEnvironment ( ) ; if ( configEnvironment != null ) { appEngineEnvironment . putAll ( configEnvironment ) ; } try { Path workingDirectory = null ; if ( config . getServices ( ) . size ( ) == 1 ) { workingDirectory = config . getServices ( ) . get ( 0 ) ; } runner . run ( jvmArguments , arguments , appEngineEnvironment , workingDirectory ) ; } catch ( ProcessHandlerException | IOException ex ) { throw new AppEngineException ( ex ) ; } }
Starts the local development server synchronously or asynchronously .
781
13
12,328
public void stop ( StopConfiguration configuration ) throws AppEngineException { Preconditions . checkNotNull ( configuration ) ; HttpURLConnection connection = null ; String host = configuration . getHost ( ) != null ? configuration . getHost ( ) : DEFAULT_HOST ; int port = configuration . getPort ( ) != null ? configuration . getPort ( ) : DEFAULT_PORT ; URL adminServerUrl = null ; try { adminServerUrl = new URL ( "http" , host , port , "/_ah/admin/quit" ) ; connection = ( HttpURLConnection ) adminServerUrl . openConnection ( ) ; connection . setDoOutput ( true ) ; connection . setDoInput ( true ) ; connection . setRequestMethod ( "POST" ) ; connection . getOutputStream ( ) . write ( ' ' ) ; connection . disconnect ( ) ; int responseCode = connection . getResponseCode ( ) ; if ( responseCode < 200 || responseCode > 299 ) { throw new AppEngineException ( adminServerUrl + " responded with " + connection . getResponseMessage ( ) + "." ) ; } } catch ( IOException ex ) { throw new AppEngineException ( "Error connecting to " + adminServerUrl , ex ) ; } finally { if ( connection != null ) { try { connection . getInputStream ( ) . close ( ) ; } catch ( IOException ignore ) { // ignored } } } }
Stops the local development server .
299
7
12,329
@ Override @ Nullable public Path getCloudSdkPath ( ) { // search system environment PATH List < String > possiblePaths = getLocationsFromPath ( System . getenv ( "PATH" ) ) ; // try environment variable GOOGLE_CLOUD_SDK_HOME possiblePaths . add ( System . getenv ( "GOOGLE_CLOUD_SDK_HOME" ) ) ; // search program files if ( IS_WINDOWS ) { possiblePaths . add ( getLocalAppDataLocation ( ) ) ; possiblePaths . add ( getProgramFilesLocation ( ) ) ; } else { // home directory possiblePaths . add ( System . getProperty ( "user.home" ) + "/google-cloud-sdk" ) ; // usr directory possiblePaths . add ( "/usr/lib/google-cloud-sdk" ) ; // try devshell VM possiblePaths . add ( "/google/google-cloud-sdk" ) ; // try bitnami Jenkins VM: possiblePaths . add ( "/usr/local/share/google/google-cloud-sdk" ) ; } Path finalPath = searchPaths ( possiblePaths ) ; logger . log ( Level . FINE , "Resolved SDK path : " + finalPath ) ; return finalPath ; }
Attempts to find the path to Google Cloud SDK .
284
10
12,330
@ Nullable private static String getLocalAppDataLocation ( ) { String localAppData = System . getenv ( "LOCALAPPDATA" ) ; if ( localAppData != null ) { return localAppData + "\\Google\\Cloud SDK\\google-cloud-sdk" ; } else { return null ; } }
The default location for a single - user install of Cloud SDK on Windows .
66
15
12,331
@ VisibleForTesting static void getLocationsFromLink ( List < String > possiblePaths , Path link ) { try { Path resolvedLink = link . toRealPath ( ) ; Path possibleBinDir = resolvedLink . getParent ( ) ; // check if the parent is "bin", we actually depend on that for other resolution if ( possibleBinDir != null && possibleBinDir . getFileName ( ) . toString ( ) . equals ( "bin" ) ) { Path possibleCloudSdkHome = possibleBinDir . getParent ( ) ; if ( possibleCloudSdkHome != null && Files . exists ( possibleCloudSdkHome ) ) { possiblePaths . add ( possibleCloudSdkHome . toString ( ) ) ; } } } catch ( IOException ioe ) { // intentionally ignore exception logger . log ( Level . FINE , "Non-critical exception when searching for cloud-sdk" , ioe ) ; } }
resolve symlinks to a path that could be the bin directory of the cloud sdk
204
18
12,332
public void stageStandard ( AppEngineWebXmlProjectStageConfiguration config ) throws AppEngineException { Preconditions . checkNotNull ( config ) ; Preconditions . checkNotNull ( config . getSourceDirectory ( ) ) ; Preconditions . checkNotNull ( config . getStagingDirectory ( ) ) ; List < String > arguments = new ArrayList <> ( ) ; arguments . addAll ( AppCfgArgs . get ( "enable_quickstart" , config . getEnableQuickstart ( ) ) ) ; arguments . addAll ( AppCfgArgs . get ( "disable_update_check" , config . getDisableUpdateCheck ( ) ) ) ; arguments . addAll ( AppCfgArgs . get ( "enable_jar_splitting" , config . getEnableJarSplitting ( ) ) ) ; arguments . addAll ( AppCfgArgs . get ( "jar_splitting_excludes" , config . getJarSplittingExcludes ( ) ) ) ; arguments . addAll ( AppCfgArgs . get ( "compile_encoding" , config . getCompileEncoding ( ) ) ) ; arguments . addAll ( AppCfgArgs . get ( "delete_jsps" , config . getDeleteJsps ( ) ) ) ; arguments . addAll ( AppCfgArgs . get ( "enable_jar_classes" , config . getEnableJarClasses ( ) ) ) ; arguments . addAll ( AppCfgArgs . get ( "disable_jar_jsps" , config . getDisableJarJsps ( ) ) ) ; if ( config . getRuntime ( ) != null ) { // currently only java7 is allowed without --allow_any_runtime arguments . addAll ( AppCfgArgs . get ( "allow_any_runtime" , true ) ) ; arguments . addAll ( AppCfgArgs . get ( "runtime" , config . getRuntime ( ) ) ) ; } arguments . add ( "stage" ) ; arguments . add ( config . getSourceDirectory ( ) . toString ( ) ) ; arguments . add ( config . getStagingDirectory ( ) . toString ( ) ) ; Path dockerfile = config . getDockerfile ( ) ; try { if ( dockerfile != null && Files . exists ( dockerfile ) ) { Files . copy ( dockerfile , config . getSourceDirectory ( ) . resolve ( dockerfile . getFileName ( ) ) , StandardCopyOption . REPLACE_EXISTING ) ; } runner . run ( arguments ) ; // TODO : Move this fix up the chain (appcfg) if ( config . getRuntime ( ) != null && config . getRuntime ( ) . equals ( "java" ) ) { Path appYaml = config . getStagingDirectory ( ) . resolve ( "app.yaml" ) ; Files . write ( appYaml , "\nruntime_config:\n jdk: openjdk8\n" . getBytes ( StandardCharsets . UTF_8 ) , StandardOpenOption . APPEND ) ; } } catch ( IOException | ProcessHandlerException e ) { throw new AppEngineException ( e ) ; } }
Stages an appengine - web . xml based project for deployment . Calls out to appcfg to execute this staging .
671
24
12,333
public void start ( ) { config . serverConfigs ( ) . forEach ( ( key , serverConfig ) -> servers . put ( key , EbeanServerFactory . create ( serverConfig ) ) ) ; }
Initialise the Ebean servers .
44
7
12,334
@ Override public void create ( ) { if ( ! environment . isProd ( ) ) { config . serverConfigs ( ) . forEach ( ( key , serverConfig ) -> { String evolutionScript = generateEvolutionScript ( servers . get ( key ) ) ; if ( evolutionScript != null ) { File evolutions = environment . getFile ( "conf/evolutions/" + key + "/1.sql" ) ; try { String content = "" ; if ( evolutions . exists ( ) ) { content = new String ( Files . readAllBytes ( evolutions . toPath ( ) ) , "utf-8" ) ; } if ( content . isEmpty ( ) || content . startsWith ( "# --- Created by Ebean DDL" ) ) { environment . getFile ( "conf/evolutions/" + key ) . mkdirs ( ) ; if ( ! content . equals ( evolutionScript ) ) { Files . write ( evolutions . toPath ( ) , evolutionScript . getBytes ( "utf-8" ) ) ; } } } catch ( IOException e ) { throw new RuntimeException ( e ) ; } } } ) ; } }
Generate evolutions .
245
5
12,335
public static String generateEvolutionScript ( EbeanServer server ) { try { SpiEbeanServer spiServer = ( SpiEbeanServer ) server ; CurrentModel ddl = new CurrentModel ( spiServer ) ; String ups = ddl . getCreateDdl ( ) ; String downs = ddl . getDropAllDdl ( ) ; if ( ups == null || ups . trim ( ) . isEmpty ( ) ) { return null ; } return "# --- Created by Ebean DDL\r\n" + "# To stop Ebean DDL generation, remove this comment and start using Evolutions\r\n" + "\r\n" + "# --- !Ups\r\n" + "\r\n" + ups + "\r\n" + "# --- !Downs\r\n" + "\r\n" + downs ; } catch ( IOException ex ) { throw new RuntimeException ( ex ) ; } }
Helper method that generates the required evolution to properly run Ebean .
203
13
12,336
public static EbeanParsedConfig parseFromConfig ( Config config ) { Config playEbeanConfig = config . getConfig ( "play.ebean" ) ; String defaultDatasource = playEbeanConfig . getString ( "defaultDatasource" ) ; String ebeanConfigKey = playEbeanConfig . getString ( "config" ) ; Map < String , List < String > > datasourceModels = new HashMap <> ( ) ; if ( config . hasPath ( ebeanConfigKey ) ) { Config ebeanConfig = config . getConfig ( ebeanConfigKey ) ; ebeanConfig . root ( ) . forEach ( ( key , raw ) -> { List < String > models ; if ( raw . valueType ( ) == ConfigValueType . STRING ) { // Support legacy comma separated string models = Arrays . asList ( ( ( String ) raw . unwrapped ( ) ) . split ( "," ) ) ; } else { models = ebeanConfig . getStringList ( key ) ; } datasourceModels . put ( key , models ) ; } ) ; } return new EbeanParsedConfig ( defaultDatasource , datasourceModels ) ; }
Parse a play configuration .
257
6
12,337
public ArrayList < String > serviceName_renewCertificate_POST ( String serviceName , String domain ) throws IOException { String qPath = "/sslGateway/{serviceName}/renewCertificate" ; StringBuilder sb = path ( qPath , serviceName ) ; HashMap < String , Object > o = new HashMap < String , Object > ( ) ; addBody ( o , "domain" , domain ) ; String resp = exec ( qPath , "POST" , sb . toString ( ) , o ) ; return convertTo ( resp , t1 ) ; }
Renew your SSL certificates
127
5
12,338
public OvhServer serviceName_server_POST ( String serviceName , String address , Long port ) throws IOException { String qPath = "/sslGateway/{serviceName}/server" ; StringBuilder sb = path ( qPath , serviceName ) ; HashMap < String , Object > o = new HashMap < String , Object > ( ) ; addBody ( o , "address" , address ) ; addBody ( o , "port" , port ) ; String resp = exec ( qPath , "POST" , sb . toString ( ) , o ) ; return convertTo ( resp , OvhServer . class ) ; }
Add a new server to your SSL Gateway
137
8
12,339
public ArrayList < OvhTask > serviceName_update_POST ( String serviceName , String ip , String password , Long port , String username ) throws IOException { String qPath = "/veeam/veeamEnterprise/{serviceName}/update" ; StringBuilder sb = path ( qPath , serviceName ) ; HashMap < String , Object > o = new HashMap < String , Object > ( ) ; addBody ( o , "ip" , ip ) ; addBody ( o , "password" , password ) ; addBody ( o , "port" , port ) ; addBody ( o , "username" , username ) ; String resp = exec ( qPath , "POST" , sb . toString ( ) , o ) ; return convertTo ( resp , t1 ) ; }
Update Veeam enterprise configuration
174
6
12,340
public OvhSecret retrieve_POST ( String id ) throws IOException { String qPath = "/secret/retrieve" ; StringBuilder sb = path ( qPath ) ; HashMap < String , Object > o = new HashMap < String , Object > ( ) ; addBody ( o , "id" , id ) ; String resp = execN ( qPath , "POST" , sb . toString ( ) , o ) ; return convertTo ( resp , OvhSecret . class ) ; }
Retrieve a secret sent by email
107
7
12,341
public OvhCustomSslMessage serviceName_ssl_PUT ( String serviceName , OvhInputCustomSsl body ) throws IOException { String qPath = "/caas/containers/{serviceName}/ssl" ; StringBuilder sb = path ( qPath , serviceName ) ; String resp = exec ( qPath , "PUT" , sb . toString ( ) , body ) ; return convertTo ( resp , OvhCustomSslMessage . class ) ; }
Update the custom SSL certificate and private
103
7
12,342
public void serviceName_frameworks_frameworkId_password_PUT ( String serviceName , String frameworkId , OvhPassword body ) throws IOException { String qPath = "/caas/containers/{serviceName}/frameworks/{frameworkId}/password" ; StringBuilder sb = path ( qPath , serviceName , frameworkId ) ; exec ( qPath , "PUT" , sb . toString ( ) , body ) ; }
Update the framework access password
97
5
12,343
public OvhApplication serviceName_frameworks_frameworkId_apps_GET ( String serviceName , String frameworkId ) throws IOException { String qPath = "/caas/containers/{serviceName}/frameworks/{frameworkId}/apps" ; StringBuilder sb = path ( qPath , serviceName , frameworkId ) ; String resp = exec ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , OvhApplication . class ) ; }
List apps in the framework
110
5
12,344
public OvhFramework serviceName_frameworks_frameworkId_GET ( String serviceName , String frameworkId ) throws IOException { String qPath = "/caas/containers/{serviceName}/frameworks/{frameworkId}" ; StringBuilder sb = path ( qPath , serviceName , frameworkId ) ; String resp = exec ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , OvhFramework . class ) ; }
Inspect the stack framework
107
5
12,345
public OvhSlave serviceName_slaves_slaveId_GET ( String serviceName , String slaveId ) throws IOException { String qPath = "/caas/containers/{serviceName}/slaves/{slaveId}" ; StringBuilder sb = path ( qPath , serviceName , slaveId ) ; String resp = exec ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , OvhSlave . class ) ; }
Inspect the argument user slave instance
107
7
12,346
public OvhRegistryCredentials serviceName_registry_credentials_credentialsId_PUT ( String serviceName , String credentialsId , OvhInputCustomSsl body ) throws IOException { String qPath = "/caas/containers/{serviceName}/registry/credentials/{credentialsId}" ; StringBuilder sb = path ( qPath , serviceName , credentialsId ) ; String resp = exec ( qPath , "PUT" , sb . toString ( ) , body ) ; return convertTo ( resp , OvhRegistryCredentials . class ) ; }
Update the registry credentials .
133
5
12,347
public OvhRegistryCredentials serviceName_registry_credentials_credentialsId_GET ( String serviceName , String credentialsId ) throws IOException { String qPath = "/caas/containers/{serviceName}/registry/credentials/{credentialsId}" ; StringBuilder sb = path ( qPath , serviceName , credentialsId ) ; String resp = exec ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , OvhRegistryCredentials . class ) ; }
Inspect the image registry credentials associated to the stack
125
10
12,348
public void serviceName_registry_credentials_credentialsId_DELETE ( String serviceName , String credentialsId ) throws IOException { String qPath = "/caas/containers/{serviceName}/registry/credentials/{credentialsId}" ; StringBuilder sb = path ( qPath , serviceName , credentialsId ) ; exec ( qPath , "DELETE" , sb . toString ( ) , null ) ; }
Delete the registry credentials .
103
5
12,349
public OvhBackend serviceName_domains_domain_backends_POST ( String serviceName , String domain , String ip ) throws IOException { String qPath = "/cdn/dedicated/{serviceName}/domains/{domain}/backends" ; StringBuilder sb = path ( qPath , serviceName , domain ) ; HashMap < String , Object > o = new HashMap < String , Object > ( ) ; addBody ( o , "ip" , ip ) ; String resp = exec ( qPath , "POST" , sb . toString ( ) , o ) ; return convertTo ( resp , OvhBackend . class ) ; }
Add a backend IP
144
4
12,350
public OvhCacheRule serviceName_domains_domain_cacheRules_POST ( String serviceName , String domain , OvhCacheRuleCacheTypeEnum cacheType , String fileMatch , OvhCacheRuleFileTypeEnum fileType , Long ttl ) throws IOException { String qPath = "/cdn/dedicated/{serviceName}/domains/{domain}/cacheRules" ; StringBuilder sb = path ( qPath , serviceName , domain ) ; HashMap < String , Object > o = new HashMap < String , Object > ( ) ; addBody ( o , "cacheType" , cacheType ) ; addBody ( o , "fileMatch" , fileMatch ) ; addBody ( o , "fileType" , fileType ) ; addBody ( o , "ttl" , ttl ) ; String resp = exec ( qPath , "POST" , sb . toString ( ) , o ) ; return convertTo ( resp , OvhCacheRule . class ) ; }
Add a cache rule to a domain
215
7
12,351
public ArrayList < OvhStatsDataType > serviceName_domains_domain_statistics_GET ( String serviceName , String domain , OvhStatsPeriodEnum period , OvhStatsTypeEnum type , OvhStatsValueEnum value ) throws IOException { String qPath = "/cdn/dedicated/{serviceName}/domains/{domain}/statistics" ; StringBuilder sb = path ( qPath , serviceName , domain ) ; query ( sb , "period" , period ) ; query ( sb , "type" , type ) ; query ( sb , "value" , value ) ; String resp = exec ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , t3 ) ; }
Return stats about a domain
171
5
12,352
public ArrayList < OvhStatsDataType > serviceName_quota_GET ( String serviceName , OvhStatsPeriodEnum period ) throws IOException { String qPath = "/cdn/dedicated/{serviceName}/quota" ; StringBuilder sb = path ( qPath , serviceName ) ; query ( sb , "period" , period ) ; String resp = exec ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , t3 ) ; }
Return quota history
114
3
12,353
public ArrayList < OvhOfferEnum > availableOffer_GET ( String domain ) throws IOException { String qPath = "/hosting/web/availableOffer" ; StringBuilder sb = path ( qPath ) ; query ( sb , "domain" , domain ) ; String resp = exec ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , t2 ) ; }
Get available offer
96
3
12,354
public OvhTask serviceName_ovhConfig_id_changeConfiguration_POST ( String serviceName , Long id , OvhContainerEnum container , OvhEngineNameEnum engineName , OvhAvailableEngineVersionEnum engineVersion , OvhEnvironmentEnum environment , OvhHttpFirewallEnum httpFirewall ) throws IOException { String qPath = "/hosting/web/{serviceName}/ovhConfig/{id}/changeConfiguration" ; StringBuilder sb = path ( qPath , serviceName , id ) ; HashMap < String , Object > o = new HashMap < String , Object > ( ) ; addBody ( o , "container" , container ) ; addBody ( o , "engineName" , engineName ) ; addBody ( o , "engineVersion" , engineVersion ) ; addBody ( o , "environment" , environment ) ; addBody ( o , "httpFirewall" , httpFirewall ) ; String resp = exec ( qPath , "POST" , sb . toString ( ) , o ) ; return convertTo ( resp , OvhTask . class ) ; }
Apply a new configuration on this path
241
7
12,355
public ArrayList < Long > serviceName_ovhConfig_GET ( String serviceName , Boolean historical , String path ) throws IOException { String qPath = "/hosting/web/{serviceName}/ovhConfig" ; StringBuilder sb = path ( qPath , serviceName ) ; query ( sb , "historical" , historical ) ; query ( sb , "path" , path ) ; String resp = exec ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , t3 ) ; }
Configuration used on your hosting
122
5
12,356
public ArrayList < OvhTypeEnum > serviceName_runtimeAvailableTypes_GET ( String serviceName , String language ) throws IOException { String qPath = "/hosting/web/{serviceName}/runtimeAvailableTypes" ; StringBuilder sb = path ( qPath , serviceName ) ; query ( sb , "language" , language ) ; String resp = exec ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , t4 ) ; }
List available runtime configurations available backend types
110
7
12,357
public ArrayList < Date > serviceName_boostHistory_GET ( String serviceName , Date date ) throws IOException { String qPath = "/hosting/web/{serviceName}/boostHistory" ; StringBuilder sb = path ( qPath , serviceName ) ; query ( sb , "date" , date ) ; String resp = exec ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , t5 ) ; }
History of your hosting boost
104
5
12,358
public String serviceName_userLogsToken_GET ( String serviceName , String attachedDomain , Boolean remoteCheck , Long ttl ) throws IOException { String qPath = "/hosting/web/{serviceName}/userLogsToken" ; StringBuilder sb = path ( qPath , serviceName ) ; query ( sb , "attachedDomain" , attachedDomain ) ; query ( sb , "remoteCheck" , remoteCheck ) ; query ( sb , "ttl" , ttl ) ; String resp = exec ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , String . class ) ; }
Get a temporary token to access the your web hosting logs interface
145
12
12,359
public ArrayList < Long > serviceName_runtime_GET ( String serviceName , String name , OvhTypeEnum type ) throws IOException { String qPath = "/hosting/web/{serviceName}/runtime" ; StringBuilder sb = path ( qPath , serviceName ) ; query ( sb , "name" , name ) ; query ( sb , "type" , type ) ; String resp = exec ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , t3 ) ; }
List of runtime configurations to your hosting
121
7
12,360
public OvhTask serviceName_runtime_POST ( String serviceName , String appBootstrap , OvhEnvEnum appEnv , String [ ] attachedDomains , Boolean isDefault , String name , String publicDir , OvhTypeEnum type ) throws IOException { String qPath = "/hosting/web/{serviceName}/runtime" ; StringBuilder sb = path ( qPath , serviceName ) ; HashMap < String , Object > o = new HashMap < String , Object > ( ) ; addBody ( o , "appBootstrap" , appBootstrap ) ; addBody ( o , "appEnv" , appEnv ) ; addBody ( o , "attachedDomains" , attachedDomains ) ; addBody ( o , "isDefault" , isDefault ) ; addBody ( o , "name" , name ) ; addBody ( o , "publicDir" , publicDir ) ; addBody ( o , "type" , type ) ; String resp = exec ( qPath , "POST" , sb . toString ( ) , o ) ; return convertTo ( resp , OvhTask . class ) ; }
Request the creation of a new runtime configuration
249
8
12,361
public ArrayList < OvhChartSerie < OvhChartTimestampValue > > serviceName_statistics_GET ( String serviceName , OvhStatisticsPeriodEnum period , OvhStatisticsTypeEnum type ) throws IOException { String qPath = "/hosting/web/{serviceName}/statistics" ; StringBuilder sb = path ( qPath , serviceName ) ; query ( sb , "period" , period ) ; query ( sb , "type" , type ) ; String resp = exec ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , t6 ) ; }
Get statistics about this web hosting
142
6
12,362
public ArrayList < String > serviceName_freedom_GET ( String serviceName , net . minidev . ovh . api . hosting . web . freedom . OvhStatusEnum status ) throws IOException { String qPath = "/hosting/web/{serviceName}/freedom" ; StringBuilder sb = path ( qPath , serviceName ) ; query ( sb , "status" , status ) ; String resp = exec ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , t1 ) ; }
Freedom linked to this hosting account
123
6
12,363
public OvhTask serviceName_request_POST ( String serviceName , OvhRequestActionEnum action ) throws IOException { String qPath = "/hosting/web/{serviceName}/request" ; StringBuilder sb = path ( qPath , serviceName ) ; HashMap < String , Object > o = new HashMap < String , Object > ( ) ; addBody ( o , "action" , action ) ; String resp = exec ( qPath , "POST" , sb . toString ( ) , o ) ; return convertTo ( resp , OvhTask . class ) ; }
Request specific operation for your hosting
128
6
12,364
public OvhAvailableVersionStruct serviceName_databaseAvailableVersion_GET ( String serviceName , OvhDatabaseTypeEnum type ) throws IOException { String qPath = "/hosting/web/{serviceName}/databaseAvailableVersion" ; StringBuilder sb = path ( qPath , serviceName ) ; query ( sb , "type" , type ) ; String resp = exec ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , OvhAvailableVersionStruct . class ) ; }
List available database version following a type
116
7
12,365
public ArrayList < Long > serviceName_localSeo_account_GET ( String serviceName , String email ) throws IOException { String qPath = "/hosting/web/{serviceName}/localSeo/account" ; StringBuilder sb = path ( qPath , serviceName ) ; query ( sb , "email" , email ) ; String resp = exec ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , t3 ) ; }
Local SEO accounts associated to the hosting
110
7
12,366
public String serviceName_ownLogs_id_userLogs_login_DELETE ( String serviceName , Long id , String login ) throws IOException { String qPath = "/hosting/web/{serviceName}/ownLogs/{id}/userLogs/{login}" ; StringBuilder sb = path ( qPath , serviceName , id , login ) ; String resp = exec ( qPath , "DELETE" , sb . toString ( ) , null ) ; return convertTo ( resp , String . class ) ; }
Delete the userLogs
121
5
12,367
public String serviceName_ownLogs_id_userLogs_login_changePassword_POST ( String serviceName , Long id , String login , String password ) throws IOException { String qPath = "/hosting/web/{serviceName}/ownLogs/{id}/userLogs/{login}/changePassword" ; StringBuilder sb = path ( qPath , serviceName , id , login ) ; HashMap < String , Object > o = new HashMap < String , Object > ( ) ; addBody ( o , "password" , password ) ; String resp = exec ( qPath , "POST" , sb . toString ( ) , o ) ; return convertTo ( resp , String . class ) ; }
Request a password change
159
4
12,368
public OvhTask serviceName_restoreSnapshot_POST ( String serviceName , net . minidev . ovh . api . hosting . web . backup . OvhTypeEnum backup ) throws IOException { String qPath = "/hosting/web/{serviceName}/restoreSnapshot" ; StringBuilder sb = path ( qPath , serviceName ) ; HashMap < String , Object > o = new HashMap < String , Object > ( ) ; addBody ( o , "backup" , backup ) ; String resp = exec ( qPath , "POST" , sb . toString ( ) , o ) ; return convertTo ( resp , OvhTask . class ) ; }
Restore this snapshot ALL CURRENT DATA WILL BE REPLACED BY YOUR SNAPSHOT
151
18
12,369
public ArrayList < String > serviceName_database_GET ( String serviceName , OvhModeEnum mode , String name , String server , OvhDatabaseTypeEnum type , String user ) throws IOException { String qPath = "/hosting/web/{serviceName}/database" ; StringBuilder sb = path ( qPath , serviceName ) ; query ( sb , "mode" , mode ) ; query ( sb , "name" , name ) ; query ( sb , "server" , server ) ; query ( sb , "type" , type ) ; query ( sb , "user" , user ) ; String resp = exec ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , t1 ) ; }
Databases linked to your hosting
171
6
12,370
public OvhTask serviceName_database_POST ( String serviceName , OvhDatabaseCapabilitiesTypeEnum capabilitie , String password , OvhExtraSqlQuotaEnum quota , OvhDatabaseTypeEnum type , String user , OvhVersionEnum version ) throws IOException { String qPath = "/hosting/web/{serviceName}/database" ; StringBuilder sb = path ( qPath , serviceName ) ; HashMap < String , Object > o = new HashMap < String , Object > ( ) ; addBody ( o , "capabilitie" , capabilitie ) ; addBody ( o , "password" , password ) ; addBody ( o , "quota" , quota ) ; addBody ( o , "type" , type ) ; addBody ( o , "user" , user ) ; addBody ( o , "version" , version ) ; String resp = exec ( qPath , "POST" , sb . toString ( ) , o ) ; return convertTo ( resp , OvhTask . class ) ; }
Install new database
232
3
12,371
public OvhTask serviceName_database_name_request_POST ( String serviceName , String name , net . minidev . ovh . api . hosting . web . database . OvhRequestActionEnum action ) throws IOException { String qPath = "/hosting/web/{serviceName}/database/{name}/request" ; StringBuilder sb = path ( qPath , serviceName , name ) ; HashMap < String , Object > o = new HashMap < String , Object > ( ) ; addBody ( o , "action" , action ) ; String resp = exec ( qPath , "POST" , sb . toString ( ) , o ) ; return convertTo ( resp , OvhTask . class ) ; }
Request specific operation for your database
160
6
12,372
public ArrayList < Long > serviceName_database_name_dump_GET ( String serviceName , String name , Date creationDate , Date deletionDate , OvhDateEnum type ) throws IOException { String qPath = "/hosting/web/{serviceName}/database/{name}/dump" ; StringBuilder sb = path ( qPath , serviceName , name ) ; query ( sb , "creationDate" , creationDate ) ; query ( sb , "deletionDate" , deletionDate ) ; query ( sb , "type" , type ) ; String resp = exec ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , t3 ) ; }
Dump available for your databases
159
6
12,373
public OvhTask serviceName_database_name_dump_POST ( String serviceName , String name , OvhDateEnum date , Boolean sendEmail ) throws IOException { String qPath = "/hosting/web/{serviceName}/database/{name}/dump" ; StringBuilder sb = path ( qPath , serviceName , name ) ; HashMap < String , Object > o = new HashMap < String , Object > ( ) ; addBody ( o , "date" , date ) ; addBody ( o , "sendEmail" , sendEmail ) ; String resp = exec ( qPath , "POST" , sb . toString ( ) , o ) ; return convertTo ( resp , OvhTask . class ) ; }
Request the dump from your database
160
6
12,374
public ArrayList < OvhChartSerie < OvhChartTimestampValue > > serviceName_database_name_statistics_GET ( String serviceName , String name , OvhStatisticsPeriodEnum period , net . minidev . ovh . api . hosting . web . database . OvhStatisticsTypeEnum type ) throws IOException { String qPath = "/hosting/web/{serviceName}/database/{name}/statistics" ; StringBuilder sb = path ( qPath , serviceName , name ) ; query ( sb , "period" , period ) ; query ( sb , "type" , type ) ; String resp = exec ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , t6 ) ; }
Get statistics about this database
174
5
12,375
public ArrayList < OvhLanguageEnum > serviceName_cronAvailableLanguage_GET ( String serviceName ) throws IOException { String qPath = "/hosting/web/{serviceName}/cronAvailableLanguage" ; StringBuilder sb = path ( qPath , serviceName ) ; String resp = exec ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , t8 ) ; }
List available cron language
97
5
12,376
public ArrayList < OvhDatabaseTypeEnum > serviceName_databaseAvailableType_GET ( String serviceName ) throws IOException { String qPath = "/hosting/web/{serviceName}/databaseAvailableType" ; StringBuilder sb = path ( qPath , serviceName ) ; String resp = exec ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , t9 ) ; }
List available database type
96
4
12,377
public OvhTask serviceName_requestBoost_POST ( String serviceName , OvhOfferEnum offer ) throws IOException { String qPath = "/hosting/web/{serviceName}/requestBoost" ; StringBuilder sb = path ( qPath , serviceName ) ; HashMap < String , Object > o = new HashMap < String , Object > ( ) ; addBody ( o , "offer" , offer ) ; String resp = exec ( qPath , "POST" , sb . toString ( ) , o ) ; return convertTo ( resp , OvhTask . class ) ; }
Allows you to boost your offer .
130
7
12,378
public OvhTask serviceName_module_POST ( String serviceName , String adminName , String adminPassword , OvhDependencyType [ ] dependencies , String domain , net . minidev . ovh . api . hosting . web . module . OvhLanguageEnum language , Long moduleId , String path ) throws IOException { String qPath = "/hosting/web/{serviceName}/module" ; StringBuilder sb = path ( qPath , serviceName ) ; HashMap < String , Object > o = new HashMap < String , Object > ( ) ; addBody ( o , "adminName" , adminName ) ; addBody ( o , "adminPassword" , adminPassword ) ; addBody ( o , "dependencies" , dependencies ) ; addBody ( o , "domain" , domain ) ; addBody ( o , "language" , language ) ; addBody ( o , "moduleId" , moduleId ) ; addBody ( o , "path" , path ) ; String resp = exec ( qPath , "POST" , sb . toString ( ) , o ) ; return convertTo ( resp , OvhTask . class ) ; }
Install a new module
251
4
12,379
public ArrayList < String > serviceName_envVar_GET ( String serviceName , net . minidev . ovh . api . hosting . web . envvar . OvhTypeEnum type ) throws IOException { String qPath = "/hosting/web/{serviceName}/envVar" ; StringBuilder sb = path ( qPath , serviceName ) ; query ( sb , "type" , type ) ; String resp = exec ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , t1 ) ; }
Environment variables set on your webhosting
126
8
12,380
public OvhTask serviceName_envVar_POST ( String serviceName , String key , net . minidev . ovh . api . hosting . web . envvar . OvhTypeEnum type , String value ) throws IOException { String qPath = "/hosting/web/{serviceName}/envVar" ; StringBuilder sb = path ( qPath , serviceName ) ; HashMap < String , Object > o = new HashMap < String , Object > ( ) ; addBody ( o , "key" , key ) ; addBody ( o , "type" , type ) ; addBody ( o , "value" , value ) ; String resp = exec ( qPath , "POST" , sb . toString ( ) , o ) ; return convertTo ( resp , OvhTask . class ) ; }
Set a variable to this hosting
177
6
12,381
public ArrayList < OvhVolumeHistory > serviceName_email_volumes_GET ( String serviceName ) throws IOException { String qPath = "/hosting/web/{serviceName}/email/volumes" ; StringBuilder sb = path ( qPath , serviceName ) ; String resp = exec ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , t10 ) ; }
Request the history volume of email sent
96
7
12,382
public String serviceName_email_request_POST ( String serviceName , OvhActionEnum action ) throws IOException { String qPath = "/hosting/web/{serviceName}/email/request" ; StringBuilder sb = path ( qPath , serviceName ) ; HashMap < String , Object > o = new HashMap < String , Object > ( ) ; addBody ( o , "action" , action ) ; String resp = exec ( qPath , "POST" , sb . toString ( ) , o ) ; return convertTo ( resp , String . class ) ; }
Request specific operation for your email
127
6
12,383
public ArrayList < OvhBounce > serviceName_email_bounces_GET ( String serviceName , Long limit ) throws IOException { String qPath = "/hosting/web/{serviceName}/email/bounces" ; StringBuilder sb = path ( qPath , serviceName ) ; query ( sb , "limit" , limit ) ; String resp = exec ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , t11 ) ; }
Request the last bounces
111
4
12,384
public OvhTask serviceName_attachedDomain_POST ( String serviceName , OvhCdnEnum cdn , String domain , OvhFirewallEnum firewall , String ownLog , String path , Long runtimeId , Boolean ssl ) throws IOException { String qPath = "/hosting/web/{serviceName}/attachedDomain" ; StringBuilder sb = path ( qPath , serviceName ) ; HashMap < String , Object > o = new HashMap < String , Object > ( ) ; addBody ( o , "cdn" , cdn ) ; addBody ( o , "domain" , domain ) ; addBody ( o , "firewall" , firewall ) ; addBody ( o , "ownLog" , ownLog ) ; addBody ( o , "path" , path ) ; addBody ( o , "runtimeId" , runtimeId ) ; addBody ( o , "ssl" , ssl ) ; String resp = exec ( qPath , "POST" , sb . toString ( ) , o ) ; return convertTo ( resp , OvhTask . class ) ; }
Link a domain to this hosting
238
6
12,385
public ArrayList < OvhCreationDatabaseCapabilities > serviceName_databaseCreationCapabilities_GET ( String serviceName ) throws IOException { String qPath = "/hosting/web/{serviceName}/databaseCreationCapabilities" ; StringBuilder sb = path ( qPath , serviceName ) ; String resp = exec ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , t7 ) ; }
List available database you can install
101
6
12,386
public OvhTask serviceName_activatePrivateDatabase_POST ( String serviceName , OvhAvailableRamSizeEnum ram , OvhOrderableVersionEnum version ) throws IOException { String qPath = "/hosting/web/{serviceName}/activatePrivateDatabase" ; StringBuilder sb = path ( qPath , serviceName ) ; HashMap < String , Object > o = new HashMap < String , Object > ( ) ; addBody ( o , "ram" , ram ) ; addBody ( o , "version" , version ) ; String resp = exec ( qPath , "POST" , sb . toString ( ) , o ) ; return convertTo ( resp , OvhTask . class ) ; }
Activate an included private database on your hosting offer
153
10
12,387
public ArrayList < Long > serviceName_cron_GET ( String serviceName , String command , String description , String email , OvhLanguageEnum language ) throws IOException { String qPath = "/hosting/web/{serviceName}/cron" ; StringBuilder sb = path ( qPath , serviceName ) ; query ( sb , "command" , command ) ; query ( sb , "description" , description ) ; query ( sb , "email" , email ) ; query ( sb , "language" , language ) ; String resp = exec ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , t3 ) ; }
Crons on your hosting
153
5
12,388
public String serviceName_cron_POST ( String serviceName , String command , String description , String email , String frequency , OvhLanguageEnum language , net . minidev . ovh . api . hosting . web . cron . OvhStatusEnum status ) throws IOException { String qPath = "/hosting/web/{serviceName}/cron" ; StringBuilder sb = path ( qPath , serviceName ) ; HashMap < String , Object > o = new HashMap < String , Object > ( ) ; addBody ( o , "command" , command ) ; addBody ( o , "description" , description ) ; addBody ( o , "email" , email ) ; addBody ( o , "frequency" , frequency ) ; addBody ( o , "language" , language ) ; addBody ( o , "status" , status ) ; String resp = exec ( qPath , "POST" , sb . toString ( ) , o ) ; return convertTo ( resp , String . class ) ; }
Create new cron
222
4
12,389
public OvhCapabilities offerCapabilities_GET ( OvhOfferCapabilitiesEnum offer ) throws IOException { String qPath = "/hosting/web/offerCapabilities" ; StringBuilder sb = path ( qPath ) ; query ( sb , "offer" , offer ) ; String resp = execN ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , OvhCapabilities . class ) ; }
Get offer capabilities
102
3
12,390
public OvhVisibilityCheckResponse localSeo_visibilityCheck_POST ( OvhCountryEnum country , String name , String street , String zip ) throws IOException { String qPath = "/hosting/web/localSeo/visibilityCheck" ; StringBuilder sb = path ( qPath ) ; HashMap < String , Object > o = new HashMap < String , Object > ( ) ; addBody ( o , "country" , country ) ; addBody ( o , "name" , name ) ; addBody ( o , "street" , street ) ; addBody ( o , "zip" , zip ) ; String resp = execN ( qPath , "POST" , sb . toString ( ) , o ) ; return convertTo ( resp , OvhVisibilityCheckResponse . class ) ; }
Check visibility of a location
176
5
12,391
public OvhDirectoriesList localSeo_directoriesList_GET ( OvhCountryEnum country , net . minidev . ovh . api . hosting . web . localseo . location . OvhOfferEnum offer ) throws IOException { String qPath = "/hosting/web/localSeo/directoriesList" ; StringBuilder sb = path ( qPath ) ; query ( sb , "country" , country ) ; query ( sb , "offer" , offer ) ; String resp = execN ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , OvhDirectoriesList . class ) ; }
Get list of directories associated to a local SEO offer and a country
150
13
12,392
public ArrayList < OvhVisibilityCheckResultResponse > localSeo_visibilityCheckResult_GET ( String directory , Long id , String token ) throws IOException { String qPath = "/hosting/web/localSeo/visibilityCheckResult" ; StringBuilder sb = path ( qPath ) ; query ( sb , "directory" , directory ) ; query ( sb , "id" , id ) ; query ( sb , "token" , token ) ; String resp = execN ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , t12 ) ; }
Get the result of a visibility check
138
7
12,393
public ArrayList < Long > moduleList_GET ( Boolean active , OvhBranchEnum branch , Boolean latest ) throws IOException { String qPath = "/hosting/web/moduleList" ; StringBuilder sb = path ( qPath ) ; query ( sb , "active" , active ) ; query ( sb , "branch" , branch ) ; query ( sb , "latest" , latest ) ; String resp = execN ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , t3 ) ; }
IDs of all modules available
126
5
12,394
public ArrayList < OvhSnapshotEnum > serviceName_partition_partitionName_snapshot_GET ( String serviceName , String partitionName ) throws IOException { String qPath = "/dedicated/nasha/{serviceName}/partition/{partitionName}/snapshot" ; StringBuilder sb = path ( qPath , serviceName , partitionName ) ; String resp = exec ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , t4 ) ; }
Get scheduled snapshot types for this partition
118
7
12,395
public OvhTask serviceName_partition_partitionName_snapshot_POST ( String serviceName , String partitionName , OvhSnapshotEnum snapshotType ) throws IOException { String qPath = "/dedicated/nasha/{serviceName}/partition/{partitionName}/snapshot" ; StringBuilder sb = path ( qPath , serviceName , partitionName ) ; HashMap < String , Object > o = new HashMap < String , Object > ( ) ; addBody ( o , "snapshotType" , snapshotType ) ; String resp = exec ( qPath , "POST" , sb . toString ( ) , o ) ; return convertTo ( resp , OvhTask . class ) ; }
Schedule a new snapshot type
158
6
12,396
public OvhUnitAndValue < Double > serviceName_partition_partitionName_use_GET ( String serviceName , String partitionName , OvhPartitionUsageTypeEnum type ) throws IOException { String qPath = "/dedicated/nasha/{serviceName}/partition/{partitionName}/use" ; StringBuilder sb = path ( qPath , serviceName , partitionName ) ; query ( sb , "type" , type ) ; String resp = exec ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , t5 ) ; }
Return statistics about the partition
136
5
12,397
@ SafeVarargs public final void enable ( Option ... options ) { for ( Option o : options ) { optionSet . add ( o ) ; } }
Enable options .
32
3
12,398
public void setMaximumBatchUpdateSize ( int size ) { if ( ! batchUpdateSupport ) { throw new InvalidOperationException ( "Batch updates not allowed by database driver." ) ; } if ( ! isEnabled ( DB . Option . BATCH_UPDATES ) ) { throw new InvalidOperationException ( DB . Option . BATCH_UPDATES + " option is not enabled." ) ; } if ( size < 1 ) { throw new InvalidOperationException ( "Invalid batch update size: " + size ) ; } maxBatchUpdateSize = size ; }
Set maximum size for batch updates .
118
7
12,399
public void enableFullLogging ( ) { enable ( DB . Option . LOG_ASSERTION_ERRORS , DB . Option . LOG_ASSERTIONS , DB . Option . LOG_SETUP , DB . Option . LOG_QUERIES , DB . Option . LOG_SNAPSHOTS , DB . Option . LOG_DATABASE_EXCEPTIONS ) ; }
Enable all logging options .
81
5