Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

migrate code from googleapis/nodejs-game-servers #2818

Closed
wants to merge 61 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
206d086
Initial client library creation
telpirion Feb 10, 2020
1a17529
feat: updates package.json files and quickstart
telpirion Feb 11, 2020
cf12904
Adds quickstart
telpirion Feb 21, 2020
dc4a335
build: get the build passing (#17)
yoshi-automation Mar 1, 2020
fd9690a
build: get sample and system tests passing (#18)
JustinBeckwith Mar 1, 2020
040e951
chore(deps): update dependency @types/mocha (#1)
renovate-bot Mar 1, 2020
6c0ff9c
chore(deps): update dependency c8 to v7 (#2)
renovate-bot Mar 1, 2020
85706d5
chore: release 1.0.0 (#4)
release-please[bot] Mar 2, 2020
ab781b5
feat: adds CRUD samples for GS realms (#21)
telpirion Mar 3, 2020
f31211b
chore: release 1.1.0 (#22)
release-please[bot] Mar 3, 2020
5de65c7
test: adds cleanup function for tests (#28)
telpirion Mar 10, 2020
3372398
chore: regenerate the code (#34)
yoshi-automation Mar 25, 2020
b2274e2
build: generator updates and new coverage approach (#59)
yoshi-automation Apr 27, 2020
be70317
feat: adds CRUD samples, tests for GS clusters (#24)
telpirion Apr 29, 2020
8a2207c
chore(deps): update dependency uuid to v8 (#63)
renovate-bot May 1, 2020
a642f65
feat: check status of long running operation by its name (#65)
alexander-fenster May 6, 2020
38077f2
chore: release 2.0.0 (#38)
release-please[bot] Jun 4, 2020
1419bf5
chore(deps): update dependency mocha to v8 (#72)
renovate-bot Jun 11, 2020
ea12d18
chore: release 2.0.1 (#75)
release-please[bot] Jun 16, 2020
18d5610
test: fix sample test by pointing at a shared cluster with Agones (#81)
xwxw-g Jul 9, 2020
97bbf19
chore: release 2.0.2 (#82)
release-please[bot] Jul 10, 2020
a2da450
docs(samples): fix sample formatting issues (#94)
pooneh-m Jul 16, 2020
15559ef
docs(samples): Add Game Server deployment samples (#92)
pooneh-m Jul 16, 2020
375de1e
docs(samples): change tags to be aligned with golang samples (#97)
pooneh-m Jul 16, 2020
97037c8
chore: updates to readme, add Node8 tests
yoshi-automation Jul 17, 2020
2596c2c
Add samples for GameServerConfigs (#98)
pooneh-m Jul 24, 2020
7d99b92
Add sample for game server rollout (#102)
pooneh-m Jul 24, 2020
b292ebc
docs: update README with additional samples (#104)
yoshi-automation Jul 25, 2020
90df792
chore: release 2.1.0 (#110)
release-please[bot] Aug 5, 2020
9db427d
chore: release 2.1.1 (#133)
release-please[bot] Nov 11, 2020
ea9e63a
chore: release 2.1.2 (#137)
release-please[bot] Dec 2, 2020
1de9760
chore: release 2.2.0 (#143)
release-please[bot] Jan 12, 2021
c5c992a
chore: release 2.3.0 (#148)
release-please[bot] Mar 2, 2021
d9a245a
chore: migrate to owl bot (#153)
SurferJeffAtGoogle May 18, 2021
dc510f5
chore: release 2.3.1 (#163)
release-please[bot] May 20, 2021
50b3549
chore: release 2.3.2 (#173)
release-please[bot] May 24, 2021
fe0efaf
chore: release 2.3.3 (#180)
release-please[bot] Jun 10, 2021
01cf5a8
chore: release 2.3.4 (#187)
release-please[bot] Jun 22, 2021
7decd22
chore: release 2.3.5 (#193)
release-please[bot] Jun 29, 2021
fecc92d
chore: release 2.3.6 (#197)
release-please[bot] Jul 12, 2021
f405853
chore: release 2.3.7 (#199)
release-please[bot] Jul 16, 2021
52c01d3
fix(build): migrate to using main branch (#206)
sofisl Aug 14, 2021
c49e829
chore: release 2.3.8 (#207)
release-please[bot] Aug 17, 2021
4948df5
chore: release 2.4.0 (#210)
release-please[bot] Aug 24, 2021
053b6b2
chore: release 2.5.0 (#214)
release-please[bot] Aug 30, 2021
7e4880a
chore: show cluster installation state details for get and list metho…
irataxy Sep 2, 2021
5cbfc1c
docs(samples): add auto-generated samples for Node with api short nam…
gcf-owl-bot[bot] Sep 28, 2021
e56afbe
docs(samples): add example tags to generated samples (#229)
gcf-owl-bot[bot] Nov 11, 2021
6a7bcf3
docs: add update samples (#230)
irataxy Nov 18, 2021
2d1a688
build: update copyright year to 2022 (#241)
gcf-owl-bot[bot] Jan 20, 2022
1207fcb
docs(samples): include metadata file, add exclusions for samples to h…
gcf-owl-bot[bot] Feb 18, 2022
6c7551c
build(node): update client library version in samples metadata (#1356…
gcf-owl-bot[bot] Apr 20, 2022
3cbbc3f
build!: update library to use Node 12 (#266)
alexander-fenster May 17, 2022
a3faa95
chore(main): release 3.0.0 (#267)
release-please[bot] May 18, 2022
71f5d44
chore(main): release 3.1.0 (#272)
release-please[bot] Jul 5, 2022
b12231c
build: do not test if service is unavailable (#275)
sofisl Jul 12, 2022
76e0bd0
fix: better support for fallback mode (#305)
gcf-owl-bot[bot] Aug 23, 2022
3a3fcb4
chore(main): release 3.1.1 (#307)
release-please[bot] Sep 7, 2022
d93d5b3
chore(deps): update dependency uuid to v9 (#312)
renovate-bot Sep 8, 2022
2520a8b
chore(main): release 3.1.2 (#314)
release-please[bot] Sep 22, 2022
c914a62
Merge remote-tracking branch 'migration/main' into nodejs-game-server…
pattishin Nov 9, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
484 changes: 484 additions & 0 deletions generated,README.md/README.md

Large diffs are not rendered by default.

86 changes: 86 additions & 0 deletions generated,README.md/create_cluster.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
// Copyright 2020, Google LLC.
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

'use strict';

/**
* Create a Game Servers cluster.
* @param {string} projectId string project identifier
* @param {string} location Compute Engine region
* @param {string} realmId the realm to use
* @param {string} gameClusterId unique identifier for the new Game Cluster
* @param {string} gkeClusterName The full resource name of the GKE cluster to use
*/
async function main(
projectId = 'YOUR_PROJECT_ID',
location = 'LOCATION_ID',
realmId = 'REALM_ID',
gameClusterId = 'GAME_CLUSTER_ID',
gkeClusterName = 'GKE_CLUSTER_NAME'
) {
// [START cloud_game_servers_cluster_create]
const {
GameServerClustersServiceClient,
} = require('@google-cloud/game-servers');

const client = new GameServerClustersServiceClient();

async function createGameServerCluster() {
/**
* TODO(developer): Uncomment these variables before running the sample.
*/
// const projectId = 'Your Google Cloud Project ID';
// const location = 'A Compute Engine region, e.g. "us-central1"';
// const realmId = 'The ID of the realm to locate this cluster in';
// const gameClusterId = 'A unique ID for this Game Server Cluster';
// const gkeClusterName= 'The full resource name of the GKE cluster to use';
const request = {
// Provide full resource name of a Game Server Realm
parent: client.realmPath(projectId, location, realmId),
gameServerClusterId: gameClusterId,
gameServerCluster: {
description: 'My Game Server Cluster',
connectionInfo: {
gkeClusterReference: {
// Provide full resource name of a Kubernetes Engine cluster
// In the form of 'projects/<project-id>/locations/<location>/clusters/<gke-cluster-name>'
cluster: gkeClusterName,
},
namespace: 'default',
},
},
};

const [operation] = await client.createGameServerCluster(request);
const [result] = await operation.promise();

console.log('Game Server Cluster created:');
console.log(`\tCluster name: ${result.name}`);
console.log(`\tCluster description: ${result.description}`);
console.log(
`\tGKE cluster: ${result.connectionInfo.gkeClusterReference.cluster}`
);
}

createGameServerCluster();
// [END cloud_game_servers_cluster_create]
}

main(...process.argv.slice(2)).catch(err => {
console.error(err.message);
process.exitCode = 1;
});
process.on('unhandledRejection', err => {
console.error(err.message);
process.exitCode = 1;
});
144 changes: 144 additions & 0 deletions generated,README.md/create_config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
// Copyright 2020, Google LLC.
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

'use strict';

/**
* Create a Game Servers Config.
* @param {string} projectId string project identifier
* @param {string} deploymentId unique identifier for the parent Game Server Deployment
* @param {string} configId unique identifier for the new Game Server Config
* @param {string} fleetName fleet name to be stored in Agones
*/
async function main(
projectId = 'YOUR_PROJECT_ID',
deploymentId = 'DEPLOYMENT_ID',
configId = 'CONFIG_ID',
fleetName = 'FLEET_NAME'
) {
// [START cloud_game_servers_config_create]
const {
GameServerConfigsServiceClient,
} = require('@google-cloud/game-servers');

const client = new GameServerConfigsServiceClient();

async function createGameServerConfig() {
/**
* TODO(developer): Uncomment these variables before running the sample.
*/
// const projectId = 'Your Google Cloud Project ID';
// const deploymentId = 'A unique ID for the Game Server Deployment';
// const configId = 'A unique ID for the Game Server Config';
// const fleetName = 'The fleet name to be stored in Agones';
// fleet is the spec portion of an agones Fleet. It must be in JSON format.
// See https://agones.dev/site/docs/reference/fleet/ for more on fleets.
const fleet = `
{
"replicas": 10,
"scheduling": "Packed",
"strategy": {
"type": "RollingUpdate",
"rollingUpdate": {
"maxSurge": "25%",
"maxUnavailable": "25%"
}
},
"template": {
"metadata": {
"labels": {
"gameName": "udp-server"
}
},
"spec": {
"ports": [
{
"name": "default",
"portPolicy": "Dynamic",
"containerPort": 2156,
"protocol": "TCP"
}
],
"health": {
"initialDelaySeconds": 30,
"periodSeconds": 60
},
"sdkServer": {
"logLevel": "Info",
"grpcPort": 9357,
"httpPort": 9358
},
"template": {
"spec": {
"containers": [
{
"name": "dedicated",
"image": "gcr.io/agones-images/udp-server:0.17",
"imagePullPolicy": "Always",
"resources": {
"requests": {
"memory": "200Mi",
"cpu": "500m"
},
"limits": {
"memory": "200Mi",
"cpu": "500m"
}
}
}
]
}
}
}
}
}
`;
const request = {
parent: client.gameServerDeploymentPath(
projectId,
'global',
deploymentId
),
configId: configId,
gameServerConfig: {
fleetConfigs: [
{
name: fleetName,
fleetSpec: fleet,
},
],
description: 'nodejs test config',
},
};

const [operation] = await client.createGameServerConfig(request);
const [result] = await operation.promise();

console.log('Game Server Config created:');
console.log(`\t Config name: ${result.name}`);
console.log(`\t Config description: ${result.description}`);
}

createGameServerConfig();

// [END cloud_game_servers_config_create]
}

main(...process.argv.slice(2)).catch(err => {
console.error(err.message);
process.exitCode = 1;
});
process.on('unhandledRejection', err => {
console.error(err.message);
process.exitCode = 1;
});
66 changes: 66 additions & 0 deletions generated,README.md/create_deployment.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
// Copyright 2020, Google LLC.
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

'use strict';

/**
* Create a Game Servers Deployment.
* @param {string} projectId string project identifier
* @param {string} deploymentId unique identifier for the new Game Server Deployment
*/
async function main(
projectId = 'YOUR_PROJECT_ID',
deploymentId = 'DEPLOYMENT_ID'
) {
// [START cloud_game_servers_deployment_create]
const {
GameServerDeploymentsServiceClient,
} = require('@google-cloud/game-servers');

const client = new GameServerDeploymentsServiceClient();

async function createGameServerDeployment() {
/**
* TODO(developer): Uncomment these variables before running the sample.
*/
// const projectId = 'Your Google Cloud Project ID';
// const deploymentId = 'A unique ID for the Game Server Deployment';
const request = {
parent: `projects/${projectId}/locations/global`,
deploymentId: deploymentId,
gameServerDeployment: {
description: 'nodejs test deployment',
},
};

const [operation] = await client.createGameServerDeployment(request);
const [result] = await operation.promise();

console.log('Game Server Deployment created:');
console.log(`\t Deployment name: ${result.name}`);
console.log(`\t Deployment description: ${result.description}`);
}

createGameServerDeployment();

// [END cloud_game_servers_deployment_create]
}

main(...process.argv.slice(2)).catch(err => {
console.error(err.message);
process.exitCode = 1;
});
process.on('unhandledRejection', err => {
console.error(err.message);
process.exitCode = 1;
});
72 changes: 72 additions & 0 deletions generated,README.md/create_realm.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
// Copyright 2020, Google LLC.
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

'use strict';

/**
* Create a Game Servers realm.
* @param {string} projectId string project identifier.
* @param {string} location Compute Engine region.
* @param {string} realmId a unique identifier for the new realm
*/
async function main(
projectId = 'YOUR_PROJECT_ID',
location = 'LOCATION_ID',
realmId = 'REALM_ID'
) {
// [START cloud_game_servers_realm_create]
const {RealmsServiceClient} = require('@google-cloud/game-servers');

const client = new RealmsServiceClient();

async function createRealm() {
/**
* TODO(developer): Uncomment these variables before running the sample.
*/
// const projectId = 'Your Google Cloud Project ID';
// const location = 'A Compute Engine region, e.g. "us-central1"';
// const realmId = 'A unique identifier for the realm';
const request = {
parent: `projects/${projectId}/locations/${location}`,
realmId: realmId,
realm: {
// Must use a supported time zone name.
// See https://cloud.google.com/dataprep/docs/html/Supported-Time-Zone-Values_66194188
timeZone: 'US/Pacific',
description: 'My Game Server realm',
},
};

const [operation] = await client.createRealm(request);
const results = await operation.promise();
const [realm] = results;

console.log('Realm created:');

console.log(`\tRealm name: ${realm.name}`);
console.log(`\tRealm description: ${realm.description}`);
console.log(`\tRealm time zone: ${realm.timeZone}`);
}

createRealm();
// [END cloud_game_servers_realm_create]
}

main(...process.argv.slice(2)).catch(err => {
console.error(err.message);
process.exitCode = 1;
});
process.on('unhandledRejection', err => {
console.error(err.message);
process.exitCode = 1;
});
Loading