Skip to content

Commit d0001e5

Browse files
70u3 release (#139)
Signed-off-by: shweta <[email protected]>
1 parent 15147a4 commit d0001e5

20 files changed

+161
-4
lines changed
-74.4 KB
Binary file not shown.

lib/vapi-authentication-2.25.0.jar

-28.4 KB
Binary file not shown.
90.9 KB
Binary file not shown.

lib/vapi-authentication-2.30.0.jar

34.9 KB
Binary file not shown.

lib/vapi-runtime-2.25.0-javadoc.jar

-2.49 MB
Binary file not shown.

lib/vapi-runtime-2.30.0-javadoc.jar

2.52 MB
Binary file not shown.
Binary file not shown.

lib/vapi-samltoken-2.25.0-javadoc.jar

-623 KB
Binary file not shown.

lib/vapi-samltoken-2.30.0-javadoc.jar

623 KB
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
0 Bytes
Binary file not shown.

pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44

55
<groupId>com.vmware</groupId>
66
<artifactId>vsphere-samples-nodeps</artifactId>
7-
<version>7.0.2.0</version>
7+
<version>7.0.3.0</version>
88
<packaging>jar</packaging>
99

1010
<name>samples</name>
1111
<url>http://maven.apache.org</url>
1212

1313
<properties>
1414
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
15-
<vapi.version>2.25.0</vapi.version>
15+
<vapi.version>2.30.0</vapi.version>
1616
<slf4j.version>1.7.12</slf4j.version>
1717
<httpclient.version>4.5.13</httpclient.version>
1818
<httpasyncclient.version>4.1.4</httpasyncclient.version>
@@ -24,7 +24,7 @@
2424
<commons-beanutils.version>1.9.4</commons-beanutils.version>
2525
<lookupservice.version>1.0.0</lookupservice.version>
2626
<vspherewssdk.version>6.7.3</vspherewssdk.version>
27-
<vsphereautomationsdk.version>3.6.0</vsphereautomationsdk.version>
27+
<vsphereautomationsdk.version>3.7.0</vsphereautomationsdk.version>
2828
<vmc.version>1.56.0</vmc.version>
2929
<nsxpolicysdk.version>3.1.2.1.1</nsxpolicysdk.version>
3030
<nsxvmcawsint.version>3.1.2.1.1</nsxvmcawsint.version>

src/main/java/vmware/samples/contentlibrary/publishsubscribe/LibraryPublishSubscribe.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ protected void run() throws Exception {
193193

194194
// Force synchronize the subscribed library item to fetch and cache the
195195
// content
196-
this.client.subscribedItemService().sync(subItemId, true);
196+
this.client.subscribedItemService().sync(subItemId, true, false);
197197
syncSuccess = this.clsHelper.waitForItemSync(subItemId,
198198
SYNC_TIMEOUT_SEC,
199199
TimeUnit.SECONDS);
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
/*
2+
* *******************************************************
3+
* Copyright VMware, Inc. 2021. All Rights Reserved.
4+
* SPDX-License-Identifier: MIT
5+
* *******************************************************
6+
*
7+
* DISCLAIMER. THIS PROGRAM IS PROVIDED TO YOU "AS IS" WITHOUT
8+
* WARRANTIES OR CONDITIONS OF ANY KIND, WHETHER ORAL OR WRITTEN,
9+
* EXPRESS OR IMPLIED. THE AUTHOR SPECIFICALLY DISCLAIMS ANY IMPLIED
10+
* WARRANTIES OR CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY,
11+
* NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
12+
*/
13+
package vmware.samples.vcenter.certificatemanagement.vcenter;
14+
15+
import com.vmware.vcenter.certificate_management.vcenter.SigningCertificate;
16+
import com.vmware.vcenter.certificate_management.vcenter.SigningCertificateTypes.Info;
17+
18+
import java.util.ArrayList;
19+
20+
import org.apache.commons.cli.Option;
21+
22+
import vmware.samples.common.SamplesAbstractBase;
23+
24+
/**
25+
* Sample code to get the Signing Certificate for the vCenter Server. This
26+
* will enable users to view the certificate actively used to sign tokens and
27+
* certificates used for token signature verification.
28+
*/
29+
public class GetSigningCertificate extends SamplesAbstractBase {
30+
private SigningCertificate certService;
31+
32+
@Override
33+
protected void parseArgs(String args[]) {
34+
super.parseArgs(new ArrayList<Option>(), args);
35+
}
36+
37+
@Override
38+
protected void setup() throws Exception {
39+
this.certService =
40+
vapiAuthHelper.getStubFactory().createStub(SigningCertificate.class,
41+
sessionStubConfig);
42+
}
43+
@Override
44+
protected void run() throws Exception {
45+
Info certInfo= certService.get();
46+
if(certInfo == null)
47+
{
48+
System.out.println("ERROR: Signing certificates not found on this vCenter");
49+
}
50+
System.out.println("vCenter signing certificate \n"+certInfo);
51+
}
52+
53+
public static void main(String[] args) throws Exception {
54+
GetSigningCertificate get = new GetSigningCertificate();
55+
get.execute(args);
56+
}
57+
58+
@Override
59+
protected void cleanup() throws Exception {
60+
// No cleanup required
61+
}
62+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
This directory contains samples for managing vCenter signing certificate:
2+
3+
The samples were tested against vSphere 7.0.3
4+
5+
Author: Andrew Gormley <[email protected]>
6+
Date: 09/15/2021
7+
8+
### SigningCertificate Get operations
9+
Sample | Description
10+
------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------
11+
vmware.samples.vcenter.certificatemanagement.vcenter.GetSigningCerificate.java | Demonstrates SigningCertificate Get operation which displays the active signing certificate chain and certificate chains used to verify token signatures.
12+
13+
### SigningCertificate Refresh operations
14+
Sample | Description
15+
----------------------------------------------------------------------------|------------------------------------
16+
vmware.samples.vcenter.certificatemanagement.vcenter.RefreshSigningCerificate.java | Demonstrates SigningCertificate Refresh operation which creates a new private key and certificate chain issued by VMCA for token signing, and displays the new certificate chain.
17+
18+
### Testbed Requirement:
19+
One (1) vCenter Server
20+
The username being used to run the sample should have the Administrator Role.
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
/*
2+
* *******************************************************
3+
* Copyright VMware, Inc. 2021. All Rights Reserved.
4+
* SPDX-License-Identifier: MIT
5+
* *******************************************************
6+
*
7+
* DISCLAIMER. THIS PROGRAM IS PROVIDED TO YOU "AS IS" WITHOUT
8+
* WARRANTIES OR CONDITIONS OF ANY KIND, WHETHER ORAL OR WRITTEN,
9+
* EXPRESS OR IMPLIED. THE AUTHOR SPECIFICALLY DISCLAIMS ANY IMPLIED
10+
* WARRANTIES OR CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY,
11+
* NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
12+
*/
13+
package vmware.samples.vcenter.certificatemanagement.vcenter;
14+
15+
import com.vmware.vcenter.certificate_management.X509CertChain;
16+
import com.vmware.vcenter.certificate_management.vcenter.SigningCertificate;
17+
18+
import java.util.Arrays;
19+
import java.util.List;
20+
21+
import org.apache.commons.cli.Option;
22+
23+
import vmware.samples.common.SamplesAbstractBase;
24+
25+
/**
26+
* Sample code to refresh the Signing Certificate for the vCenter Server.
27+
* Use the force option to attempt to force the refresh in environments
28+
* that would otherwise fail. On success, the new signing certificates
29+
* will be printed.
30+
*/
31+
public class RefreshSigningCertificate extends SamplesAbstractBase {
32+
private SigningCertificate certService;
33+
protected boolean force;
34+
35+
@Override
36+
protected void parseArgs(String args[]) {
37+
Option forceOption = Option.builder()
38+
.required(false)
39+
.argName("FORCE")
40+
.longOpt("force")
41+
.desc("Attempt to force refresh")
42+
.build();
43+
List<Option> optionList = Arrays.asList(forceOption);
44+
super.parseArgs(optionList, args);
45+
46+
this.force = parsedOptions.get("force") != null;
47+
}
48+
49+
@Override
50+
protected void setup() throws Exception {
51+
this.certService =
52+
vapiAuthHelper.getStubFactory().createStub(SigningCertificate.class,
53+
sessionStubConfig);
54+
}
55+
56+
@Override
57+
protected void run() throws Exception {
58+
X509CertChain newCert= certService.refresh(this.force);
59+
if(newCert == null ) {
60+
System.out.println("ERROR: refresh signing certificate did not return a certificate");
61+
} else {
62+
System.out.println("New vCenter signing certificate \n"+newCert.toString());
63+
}
64+
}
65+
66+
public static void main(String[] args) throws Exception {
67+
RefreshSigningCertificate get = new RefreshSigningCertificate();
68+
get.execute(args);
69+
}
70+
71+
@Override
72+
protected void cleanup() throws Exception {
73+
// No cleanup required
74+
}
75+
}

0 commit comments

Comments
 (0)